Received: from eggs.gnu.org ([208.118.235.92]:39643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs7oU-0001wh-Nu for qemu-devel@nongnu.org; Tue, 21 Aug 2018 10:39:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs7oU-0003xv-4P for qemu-devel@nongnu.org; Tue, 21 Aug 2018 10:39:18 -0400 References: <20180811090836.4024-1-contrib@steffen-goertz.de> <20180811090836.4024-7-contrib@steffen-goertz.de> <6c13fca2-6f16-adb0-1072-7601abefd18d@steffen-goertz.de> From: Julia Suvorova Message-ID: <156619bb-c1c8-3338-b327-6dd298aa16cf@mail.ru> Date: Tue, 21 Aug 2018 17:39:03 +0300 MIME-Version: 1.0 In-Reply-To: <6c13fca2-6f16-adb0-1072-7601abefd18d@steffen-goertz.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 6/7] arm: Instantiate nRF51 peripherals List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Steffen_G=c3=b6rtz?= , =?UTF-8?Q?Steffen_G=c3=b6rtz?= Cc: Peter Maydell , QEMU Developers , Joel Stanley , Stefan Hajnoczi , qemu-arm , Jim Mussared On 21.08.2018 14:43, Steffen Görtz wrote: > Hi Peter, >>> + >>> +static uint64_t clock_read(void *opaque, hwaddr addr, unsigned int size) >>> +{ >>> + qemu_log_mask(LOG_UNIMP, "%s: 0x%" HWADDR_PRIx " [%u]\n", >>> + __func__, addr, size); >>> + return 1; >>> +} >>> + >>> +static void clock_write(void *opaque, hwaddr addr, uint64_t data, >>> + unsigned int size) >>> +{ >>> + qemu_log_mask(LOG_UNIMP, "%s: 0x%" HWADDR_PRIx " <- 0x%" PRIx64 " [%u]\n", >>> + __func__, addr, data, size); >>> +} >>> + >>> +static const MemoryRegionOps clock_ops = { >>> + .read = clock_read, >>> + .write = clock_write >>> +}; >> >> You don't need to roll your own "do nothing but log" device: >> you can use the TYPE_UNIMPLEMENTED_DEVICE to do this. > > Until we have a more proper STUB for POWER/CLOCK/MPU peripherals we actually need this, > because the unimplemented device will return 0 on reads which will cause guest code to stall. Do you need this stub to run micropython code? Could you delete this, please, so that I can post the correct stub structures for js directly on Joel's code? Best regards, Julia Suvorova.