forked from len0rd/rockbox
hwstub/qeditor: add support for atomic read/writes
The current code assumed that READ/WRITE would produce atomic read/writes for 8/16/32-bit words, which in turned put assumption on the memcpy function. Since some memcpy implementation do not always guarantee such strong assumption, introduce two new operation READ/WRITE_ATOMIC which provide the necessary tools to do correct read and write to register in a single memory access. Change-Id: I37451bd5057bb0dcaf5a800d8aef8791c792a090
This commit is contained in:
parent
794169a18f
commit
cd04a5f1aa
12 changed files with 254 additions and 24 deletions
|
|
@ -53,8 +53,11 @@ int hwstub_get_desc(struct hwstub_device_t *dev, uint16_t desc, void *info, size
|
|||
int hwstub_get_log(struct hwstub_device_t *dev, void *buf, size_t sz);
|
||||
/* Returns number of bytes written/read or <0 on error */
|
||||
int hwstub_read(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
|
||||
int hwstub_write(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
|
||||
int hwstub_read_atomic(struct hwstub_device_t *dev, uint32_t addr, void *buf, size_t sz);
|
||||
int hwstub_write(struct hwstub_device_t *dev, uint32_t addr, const void *buf, size_t sz);
|
||||
int hwstub_write_atomic(struct hwstub_device_t *dev, uint32_t addr, const void *buf, size_t sz);
|
||||
int hwstub_rw_mem(struct hwstub_device_t *dev, int read, uint32_t addr, void *buf, size_t sz);
|
||||
int hwstub_rw_mem_atomic(struct hwstub_device_t *dev, int read, uint32_t addr, void *buf, size_t sz);
|
||||
/* Returns <0 on error */
|
||||
int hwstub_exec(struct hwstub_device_t *dev, uint32_t addr, uint16_t flags);
|
||||
int hwstub_call(struct hwstub_device_t *dev, uint32_t addr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue