diff --git a/bsp/CME_M7/drivers/emac.c b/bsp/CME_M7/drivers/emac.c index 2582eab805..5665a95548 100644 --- a/bsp/CME_M7/drivers/emac.c +++ b/bsp/CME_M7/drivers/emac.c @@ -228,13 +228,13 @@ static rt_err_t rt_cme_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_cme_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_cme_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_cme_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_cme_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/Infineon/libraries/HAL_Drivers/drv_i2c.c b/bsp/Infineon/libraries/HAL_Drivers/drv_i2c.c index 86c52f8906..5a91a99cf4 100644 --- a/bsp/Infineon/libraries/HAL_Drivers/drv_i2c.c +++ b/bsp/Infineon/libraries/HAL_Drivers/drv_i2c.c @@ -90,7 +90,7 @@ static int ifx_i2c_write(struct ifx_i2c *hi2c, uint16_t slave_address, uint8_t * return 0; } -static rt_size_t _i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t _i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/Infineon/psoc6-pioneerkit_modus/drivers/uart.c b/bsp/Infineon/psoc6-pioneerkit_modus/drivers/uart.c index 16be3266f1..c750f7c9dc 100644 --- a/bsp/Infineon/psoc6-pioneerkit_modus/drivers/uart.c +++ b/bsp/Infineon/psoc6-pioneerkit_modus/drivers/uart.c @@ -94,7 +94,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read (rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_uart_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; @@ -154,7 +154,7 @@ static rt_size_t rt_uart_read (rt_device_t dev, rt_off_t pos, void* buffer, return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_uart_write (rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_uart_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; diff --git a/bsp/acm32/acm32f0x0-nucleo/drivers/drv_i2c.c b/bsp/acm32/acm32f0x0-nucleo/drivers/drv_i2c.c index dedf02710b..3ee4cc928b 100644 --- a/bsp/acm32/acm32f0x0-nucleo/drivers/drv_i2c.c +++ b/bsp/acm32/acm32f0x0-nucleo/drivers/drv_i2c.c @@ -84,7 +84,7 @@ static int acm32_i2c_write(struct acm32_i2c *hi2c, uint16_t slave_address, uint8 return 0; } -static rt_size_t _i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t _i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/acm32/acm32f0x0-nucleo/drivers/drv_uart.c b/bsp/acm32/acm32f0x0-nucleo/drivers/drv_uart.c index 64951270ff..ca1c7daf8d 100644 --- a/bsp/acm32/acm32f0x0-nucleo/drivers/drv_uart.c +++ b/bsp/acm32/acm32f0x0-nucleo/drivers/drv_uart.c @@ -275,7 +275,7 @@ static void dma_rx_done_isr(struct rt_serial_device *serial) HAL_UART_Receive_DMA(&(uart->handle), &rx_fifo->buffer[rx_fifo->put_index], serial->config.bufsz); } -static rt_size_t _uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t _uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { struct acm32_uart *uart; RT_ASSERT(serial != RT_NULL); diff --git a/bsp/acm32/acm32f4xx-nucleo/drivers/drv_uart.c b/bsp/acm32/acm32f4xx-nucleo/drivers/drv_uart.c index c84c6bfeff..a8a599d3c5 100644 --- a/bsp/acm32/acm32f4xx-nucleo/drivers/drv_uart.c +++ b/bsp/acm32/acm32f4xx-nucleo/drivers/drv_uart.c @@ -274,7 +274,7 @@ static void dma_rx_done_isr(struct rt_serial_device *serial) HAL_UART_Receive_DMA(&(uart->handle), &rx_fifo->buffer[rx_fifo->put_index], serial->config.bufsz); } -static rt_size_t _uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t _uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { struct acm32_uart *uart; RT_ASSERT(serial != RT_NULL); diff --git a/bsp/airm2m/air105/libraries/rt_drivers/drv_i2c.c b/bsp/airm2m/air105/libraries/rt_drivers/drv_i2c.c index ca8feab600..e4ade74c8f 100644 --- a/bsp/airm2m/air105/libraries/rt_drivers/drv_i2c.c +++ b/bsp/airm2m/air105/libraries/rt_drivers/drv_i2c.c @@ -14,10 +14,10 @@ #ifdef BSP_USING_I2C static struct rt_i2c_bus_device prv_air105_i2c; -static rt_size_t air105_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t air105_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); -static rt_size_t air105_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t air105_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t air105_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -32,7 +32,7 @@ static const struct rt_i2c_bus_device_ops air105_i2c_ops = }; -static rt_size_t air105_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t air105_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -81,7 +81,7 @@ static rt_size_t air105_i2c_mst_xfer(struct rt_i2c_bus_device *bus, } return i; } -static rt_size_t air105_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t air105_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/airm2m/air105/libraries/rt_drivers/drv_usart_v2.c b/bsp/airm2m/air105/libraries/rt_drivers/drv_usart_v2.c index d83fcb3a92..cfe5419eb8 100644 --- a/bsp/airm2m/air105/libraries/rt_drivers/drv_usart_v2.c +++ b/bsp/airm2m/air105/libraries/rt_drivers/drv_usart_v2.c @@ -262,7 +262,7 @@ static int air105_getc(struct rt_serial_device *serial) } } -static rt_size_t air105_transmit(struct rt_serial_device *serial, +static rt_ssize_t air105_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) diff --git a/bsp/airm2m/air32f103/libraries/rt_drivers/drv_usart.c b/bsp/airm2m/air32f103/libraries/rt_drivers/drv_usart.c index 3a9180cde7..b1e30f9b99 100644 --- a/bsp/airm2m/air32f103/libraries/rt_drivers/drv_usart.c +++ b/bsp/airm2m/air32f103/libraries/rt_drivers/drv_usart.c @@ -275,7 +275,7 @@ static int air32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t air32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t air32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return 0; } diff --git a/bsp/allwinner/d1s/ports/partition/partition.c b/bsp/allwinner/d1s/ports/partition/partition.c index 37e3dbcb7b..9b9ceb2c37 100644 --- a/bsp/allwinner/d1s/ports/partition/partition.c +++ b/bsp/allwinner/d1s/ports/partition/partition.c @@ -78,7 +78,7 @@ static rt_err_t partition_control(rt_device_t dev, rt_uint8_t cmd, void *args) return RT_EOK; } -static rt_size_t partition_read(rt_device_t dev, +static rt_ssize_t partition_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) @@ -93,7 +93,7 @@ static rt_size_t partition_read(rt_device_t dev, return rt_device_read(part->block_device, pos + part->partition->offset/part->sector_size, buffer, size); } -static rt_size_t partition_write(rt_device_t dev, +static rt_ssize_t partition_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) diff --git a/bsp/allwinner/libraries/drivers/drv_i2c.c b/bsp/allwinner/libraries/drivers/drv_i2c.c index 91897be4e5..ad4515d8fe 100644 --- a/bsp/allwinner/libraries/drivers/drv_i2c.c +++ b/bsp/allwinner/libraries/drivers/drv_i2c.c @@ -24,7 +24,7 @@ struct hal_i2c_bus }; //connect am drv to rt drv. -static rt_size_t _i2c_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg *msgs, rt_uint32_t num) +static rt_ssize_t _i2c_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg *msgs, rt_uint32_t num) { struct hal_i2c_bus *_i2c_bus = (struct hal_i2c_bus *)bus; struct rt_i2c_msg *msg; diff --git a/bsp/allwinner/libraries/drivers/drv_uart.c b/bsp/allwinner/libraries/drivers/drv_uart.c index 3683072086..18956e5e80 100644 --- a/bsp/allwinner/libraries/drivers/drv_uart.c +++ b/bsp/allwinner/libraries/drivers/drv_uart.c @@ -388,7 +388,7 @@ static rt_err_t _uart_configure(struct rt_serial_device *serial, struct serial_c static rt_err_t _uart_control(struct rt_serial_device *serial, int cmd, void *arg); static int _uart_putc(struct rt_serial_device *serial, char c); static int _uart_getc(struct rt_serial_device *serial); -static rt_size_t _uart_transmit(struct rt_serial_device *serial, +static rt_ssize_t _uart_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag); const struct rt_uart_ops _uart_ops = @@ -720,7 +720,7 @@ static int _uart_getc(struct rt_serial_device *serial) return data; } -static rt_size_t _uart_transmit(struct rt_serial_device *serial, +static rt_ssize_t _uart_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) { struct sunxi_uart *uart; diff --git a/bsp/allwinner/libraries/drivers/sdmmc/drv_sdmmc.c b/bsp/allwinner/libraries/drivers/sdmmc/drv_sdmmc.c index 368fcc5369..4b64354f83 100644 --- a/bsp/allwinner/libraries/drivers/sdmmc/drv_sdmmc.c +++ b/bsp/allwinner/libraries/drivers/sdmmc/drv_sdmmc.c @@ -232,7 +232,7 @@ rt_err_t sdmmc_deinit(rt_device_t dev) return 0; } -static rt_size_t sdmmc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t sdmmc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { ssize_t ret, rsz, trsz, msz = 0; struct rt_device_blk_geometry *geometry; @@ -309,7 +309,7 @@ static rt_err_t sdmmc_close(rt_device_t dev) return 0; } -static rt_size_t sdmmc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t sdmmc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { int err = -1; ssize_t ret, wsz, twsz, msz = 0; diff --git a/bsp/allwinner/libraries/drivers/touch/drv_touch.c b/bsp/allwinner/libraries/drivers/touch/drv_touch.c index 9cf0260bfe..8361fb1742 100644 --- a/bsp/allwinner/libraries/drivers/touch/drv_touch.c +++ b/bsp/allwinner/libraries/drivers/touch/drv_touch.c @@ -152,7 +152,7 @@ int rt_touch_write(rt_uint16_t addr, void *data_buf, size_t data_len) return -1; } -static rt_size_t touch_readpoint(struct rt_touch_device *touch, void *buf, rt_size_t touch_num) +static rt_ssize_t touch_readpoint(struct rt_touch_device *touch, void *buf, rt_size_t touch_num) { rt_device_t device; struct rt_touch_data *data = (struct rt_touch_data *)buf; diff --git a/bsp/allwinner/libraries/sunxi-hal/hal/source/gmac/hal_geth.c b/bsp/allwinner/libraries/sunxi-hal/hal/source/gmac/hal_geth.c index e7d56ec00a..d1382f313f 100644 --- a/bsp/allwinner/libraries/sunxi-hal/hal/source/gmac/hal_geth.c +++ b/bsp/allwinner/libraries/sunxi-hal/hal/source/gmac/hal_geth.c @@ -743,14 +743,14 @@ static rt_err_t rt_geth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_geth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_geth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { printf("gmac read\n"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_geth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_geth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { printf("gmac write\n"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/allwinner_tina/drivers/drv_uart.c b/bsp/allwinner_tina/drivers/drv_uart.c index a2889c598f..ccf327ecde 100644 --- a/bsp/allwinner_tina/drivers/drv_uart.c +++ b/bsp/allwinner_tina/drivers/drv_uart.c @@ -40,7 +40,7 @@ static rt_err_t uart_configure(struct rt_serial_device *serial, struct serial_co static rt_err_t uart_control(struct rt_serial_device *serial, int cmd, void *arg); static int uart_putc(struct rt_serial_device *serial, char c); static int uart_getc(struct rt_serial_device *serial); -static rt_size_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); +static rt_ssize_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); void uart_irq_handler(int irqno, void *param); @@ -284,7 +284,7 @@ static int uart_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return (0); } diff --git a/bsp/amebaz/drivers/drv_uart.c b/bsp/amebaz/drivers/drv_uart.c index 008fa3bda5..2ad6e12292 100644 --- a/bsp/amebaz/drivers/drv_uart.c +++ b/bsp/amebaz/drivers/drv_uart.c @@ -31,7 +31,7 @@ static rt_err_t ameba_uart_configure (struct rt_serial_device *serial, struc static rt_err_t ameba_uart_control (struct rt_serial_device *serial, int cmd, void *arg); static int ameba_uart_putc (struct rt_serial_device *serial, char c); static int ameba_uart_getc (struct rt_serial_device *serial); -static rt_size_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); +static rt_ssize_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void ameba_uart_irq(uint32_t id, SerialIrq event); @@ -118,7 +118,7 @@ static int ameba_uart_getc (struct rt_serial_device *serial) return serial_getc(&uart->serial); } -static rt_size_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t ameba_uart_dma_transmit (struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return (0); } diff --git a/bsp/apm32/libraries/Drivers/drv_eth.c b/bsp/apm32/libraries/Drivers/drv_eth.c index 08f803f0fb..406fa17b50 100644 --- a/bsp/apm32/libraries/Drivers/drv_eth.c +++ b/bsp/apm32/libraries/Drivers/drv_eth.c @@ -412,13 +412,13 @@ static rt_err_t rt_apm32_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_apm32_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_apm32_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_apm32_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_apm32_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/apollo2/board/flash.c b/bsp/apollo2/board/flash.c index 2d28920daf..5b1480c650 100644 --- a/bsp/apollo2/board/flash.c +++ b/bsp/apollo2/board/flash.c @@ -75,7 +75,7 @@ static rt_err_t rt_flash_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_flash_read(rt_device_t dev, +static rt_ssize_t rt_flash_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) @@ -85,7 +85,7 @@ static rt_size_t rt_flash_read(rt_device_t dev, return size; } -static rt_size_t rt_flash_write(rt_device_t dev, +static rt_ssize_t rt_flash_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) diff --git a/bsp/apollo2/board/rtc.c b/bsp/apollo2/board/rtc.c index 0eb57aaf84..cbb5dab9d9 100644 --- a/bsp/apollo2/board/rtc.c +++ b/bsp/apollo2/board/rtc.c @@ -29,7 +29,7 @@ static rt_err_t rt_rtc_open(rt_device_t dev, rt_uint16_t oflag) return RT_EOK; } -static rt_size_t rt_rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { return 0; } diff --git a/bsp/at32/libraries/rt_drivers/drv_emac.c b/bsp/at32/libraries/rt_drivers/drv_emac.c index df72259fda..3b2708b1b9 100644 --- a/bsp/at32/libraries/rt_drivers/drv_emac.c +++ b/bsp/at32/libraries/rt_drivers/drv_emac.c @@ -413,14 +413,14 @@ static rt_err_t rt_at32_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_at32_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_at32_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("emac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_at32_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_at32_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("emac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/at32/libraries/rt_drivers/drv_usart.c b/bsp/at32/libraries/rt_drivers/drv_usart.c index 9d2adbb384..7a327d61f3 100644 --- a/bsp/at32/libraries/rt_drivers/drv_usart.c +++ b/bsp/at32/libraries/rt_drivers/drv_usart.c @@ -333,7 +333,7 @@ static void at32_dma_config(struct rt_serial_device *serial, rt_ubase_t flag) nvic_irq_enable(instance->irqn, 1, 0); } -static rt_size_t at32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t at32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { struct at32_uart *instance; instance = (struct at32_uart *) serial->parent.user_data; diff --git a/bsp/at91/at91sam9260/drivers/macb.c b/bsp/at91/at91sam9260/drivers/macb.c index 702d7e04a4..e0e3bda2ea 100644 --- a/bsp/at91/at91sam9260/drivers/macb.c +++ b/bsp/at91/at91sam9260/drivers/macb.c @@ -514,13 +514,13 @@ static rt_err_t rt_macb_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_macb_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_macb_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_macb_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_macb_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/at91/at91sam9g45/drivers/macb.c b/bsp/at91/at91sam9g45/drivers/macb.c index 8a300725c3..8065b4afcb 100644 --- a/bsp/at91/at91sam9g45/drivers/macb.c +++ b/bsp/at91/at91sam9g45/drivers/macb.c @@ -514,13 +514,13 @@ static rt_err_t rt_macb_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_macb_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_macb_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_macb_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_macb_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/bluetrum/libraries/hal_drivers/drv_usart.c b/bsp/bluetrum/libraries/hal_drivers/drv_usart.c index ab296274c5..ea190324ca 100644 --- a/bsp/bluetrum/libraries/hal_drivers/drv_usart.c +++ b/bsp/bluetrum/libraries/hal_drivers/drv_usart.c @@ -209,7 +209,7 @@ static int ab32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t ab32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t ab32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return -1; } diff --git a/bsp/dm365/drivers/davinci_emac.c b/bsp/dm365/drivers/davinci_emac.c index b164bf7aaa..f294727c56 100644 --- a/bsp/dm365/drivers/davinci_emac.c +++ b/bsp/dm365/drivers/davinci_emac.c @@ -1585,16 +1585,14 @@ static rt_err_t rt_davinci_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_davinci_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_davinci_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } -static rt_size_t rt_davinci_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_davinci_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } static rt_err_t rt_davinci_emac_control(rt_device_t dev, int cmd, void *args) diff --git a/bsp/efm32/drv_ethernet.c b/bsp/efm32/drv_ethernet.c index 57d88cab54..7792f20158 100644 --- a/bsp/efm32/drv_ethernet.c +++ b/bsp/efm32/drv_ethernet.c @@ -606,7 +606,7 @@ static rt_err_t efm_eth_close(rt_device_t dev) * @return * Number of read bytes ******************************************************************************/ -static rt_size_t efm_eth_read( +static rt_ssize_t efm_eth_read( rt_device_t dev, rt_off_t pos, void *buffer, @@ -639,7 +639,7 @@ static rt_size_t efm_eth_read( * @return * Number of written bytes ******************************************************************************/ -static rt_size_t efm_eth_write ( +static rt_ssize_t efm_eth_write ( rt_device_t dev, rt_off_t pos, const void *buffer, diff --git a/bsp/efm32/drv_iic.c b/bsp/efm32/drv_iic.c index acb7d09375..4bae9ae94a 100644 --- a/bsp/efm32/drv_iic.c +++ b/bsp/efm32/drv_iic.c @@ -182,7 +182,7 @@ static rt_err_t rt_iic_close(rt_device_t dev) * @return * Error code ******************************************************************************/ -static rt_size_t rt_iic_read ( +static rt_ssize_t rt_iic_read ( rt_device_t dev, rt_off_t pos, void* buffer, @@ -343,7 +343,7 @@ static rt_size_t rt_iic_read ( * @return * Error code ******************************************************************************/ -static rt_size_t rt_iic_write ( +static rt_ssize_t rt_iic_write ( rt_device_t dev, rt_off_t pos, const void* buffer, diff --git a/bsp/efm32/drv_leuart.c b/bsp/efm32/drv_leuart.c index 06aeb9e25e..bf1720b8ad 100644 --- a/bsp/efm32/drv_leuart.c +++ b/bsp/efm32/drv_leuart.c @@ -247,7 +247,7 @@ static rt_err_t rt_leuart_close(rt_device_t dev) * @return * Number of read bytes ******************************************************************************/ -static rt_size_t rt_leuart_read ( +static rt_ssize_t rt_leuart_read ( rt_device_t dev, rt_off_t pos, void *buffer, @@ -372,7 +372,7 @@ static rt_size_t rt_leuart_read ( * @return * Number of written bytes ******************************************************************************/ -static rt_size_t rt_leuart_write ( +static rt_ssize_t rt_leuart_write ( rt_device_t dev, rt_off_t pos, const void* buffer, diff --git a/bsp/efm32/drv_rtc.c b/bsp/efm32/drv_rtc.c index 4956d76953..20acb19666 100644 --- a/bsp/efm32/drv_rtc.c +++ b/bsp/efm32/drv_rtc.c @@ -49,7 +49,7 @@ static rt_err_t rt_rtc_open(rt_device_t dev, rt_uint16_t oflag) return RT_EOK; } -static rt_size_t rt_rtc_read( +static rt_ssize_t rt_rtc_read( rt_device_t dev, rt_off_t pos, void* buffer, diff --git a/bsp/efm32/drv_sdcard.c b/bsp/efm32/drv_sdcard.c index 593bc2b697..f58c126f89 100644 --- a/bsp/efm32/drv_sdcard.c +++ b/bsp/efm32/drv_sdcard.c @@ -136,7 +136,7 @@ static void efm_spiSd_speed(rt_uint8_t level) * @return * Number of read bytes ******************************************************************************/ -static rt_size_t efm_spiSd_read(void *buffer, rt_size_t size) +static rt_ssize_t efm_spiSd_read(void *buffer, rt_size_t size) { RT_ASSERT(spi != RT_NULL); @@ -807,7 +807,7 @@ static rt_err_t rt_spiSd_close(rt_device_t dev) * @return * Number of read sectors ******************************************************************************/ -static rt_size_t rt_spiSd_read( +static rt_ssize_t rt_spiSd_read( rt_device_t dev, rt_off_t sector, void *buffer, @@ -897,7 +897,7 @@ static rt_size_t rt_spiSd_read( * @return * Number of written sectors ******************************************************************************/ -static rt_size_t rt_spiSd_write ( +static rt_ssize_t rt_spiSd_write ( rt_device_t dev, rt_off_t sector, const void *buffer, diff --git a/bsp/efm32/drv_usart.c b/bsp/efm32/drv_usart.c index edf0643564..1c97556eac 100644 --- a/bsp/efm32/drv_usart.c +++ b/bsp/efm32/drv_usart.c @@ -354,7 +354,7 @@ static rt_err_t rt_usart_close(rt_device_t dev) * @return * Number of read bytes ******************************************************************************/ -static rt_size_t rt_usart_read ( +static rt_ssize_t rt_usart_read ( rt_device_t dev, rt_off_t pos, void *buffer, @@ -550,7 +550,7 @@ static rt_size_t rt_usart_read ( * @return * Number of written bytes ******************************************************************************/ -static rt_size_t rt_usart_write ( +static rt_ssize_t rt_usart_write ( rt_device_t dev, rt_off_t pos, const void* buffer, diff --git a/bsp/essemi/es32f0654/drivers/drv_i2c.c b/bsp/essemi/es32f0654/drivers/drv_i2c.c index 96375d31f6..a1ae7fb71f 100644 --- a/bsp/essemi/es32f0654/drivers/drv_i2c.c +++ b/bsp/essemi/es32f0654/drivers/drv_i2c.c @@ -106,7 +106,7 @@ static void _i2c_init(void) #endif } -static rt_size_t es32f0_master_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t es32f0_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/essemi/es32f369x/drivers/drv_i2c.c b/bsp/essemi/es32f369x/drivers/drv_i2c.c index 8f905e314f..dfce73e3a4 100644 --- a/bsp/essemi/es32f369x/drivers/drv_i2c.c +++ b/bsp/essemi/es32f369x/drivers/drv_i2c.c @@ -265,7 +265,7 @@ SUCCESS: return OK; } -static rt_size_t es32f3_master_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t es32f3_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/essemi/es32f369x/drivers/drv_uart.c b/bsp/essemi/es32f369x/drivers/drv_uart.c index 1a738447ff..dfb4ad0f9c 100644 --- a/bsp/essemi/es32f369x/drivers/drv_uart.c +++ b/bsp/essemi/es32f369x/drivers/drv_uart.c @@ -721,7 +721,7 @@ static int es32f3x_getc(struct rt_serial_device *serial) /** * DMA transmit */ -static rt_size_t es32f3x_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t es32f3x_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { struct es32_uart *uart; diff --git a/bsp/frdm-k64f/board/drv_emac.c b/bsp/frdm-k64f/board/drv_emac.c index 87b6c6c34d..94ce23e418 100644 --- a/bsp/frdm-k64f/board/drv_emac.c +++ b/bsp/frdm-k64f/board/drv_emac.c @@ -229,16 +229,14 @@ static rt_err_t k64_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t k64_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t k64_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } -static rt_size_t k64_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t k64_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } static rt_err_t k64_emac_control(rt_device_t dev, int cmd, void *args) diff --git a/bsp/ft2004/drivers/drv_eth.c b/bsp/ft2004/drivers/drv_eth.c index e7148631e4..256ce42e29 100644 --- a/bsp/ft2004/drivers/drv_eth.c +++ b/bsp/ft2004/drivers/drv_eth.c @@ -250,14 +250,14 @@ static rt_err_t rt_ft2004_gmac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_ft2004_gmac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_ft2004_gmac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("gmac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_ft2004_gmac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_ft2004_gmac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("gmac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/ft32/libraries/Drivers/drv_usart.c b/bsp/ft32/libraries/Drivers/drv_usart.c index 1fe34e3763..ee308c946c 100644 --- a/bsp/ft32/libraries/Drivers/drv_usart.c +++ b/bsp/ft32/libraries/Drivers/drv_usart.c @@ -305,7 +305,7 @@ static int ft32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t ft32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t ft32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { RT_ASSERT(serial != RT_NULL); RT_ASSERT(buf != RT_NULL); diff --git a/bsp/fujitsu/mb9x/mb9bf506r/drivers/nand.c b/bsp/fujitsu/mb9x/mb9bf506r/drivers/nand.c index 1c03120d14..0eb9b418a4 100644 --- a/bsp/fujitsu/mb9x/mb9bf506r/drivers/nand.c +++ b/bsp/fujitsu/mb9x/mb9bf506r/drivers/nand.c @@ -358,7 +358,7 @@ static rt_err_t rt_nand_close(rt_device_t dev) } /* nand device read */ -static rt_size_t rt_nand_read (rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_nand_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_ubase_t block; /* block of position */ @@ -456,7 +456,7 @@ static int rt_nand_eraseblock_writepage(struct rt_device_nand* nand, } /* nand device write */ -static rt_size_t rt_nand_write (rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_nand_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_ubase_t block, page; diff --git a/bsp/fujitsu/mb9x/mb9bf568r/drivers/led.c b/bsp/fujitsu/mb9x/mb9bf568r/drivers/led.c index db80b56fd0..9e138d6f0b 100644 --- a/bsp/fujitsu/mb9x/mb9bf568r/drivers/led.c +++ b/bsp/fujitsu/mb9x/mb9bf568r/drivers/led.c @@ -72,7 +72,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read (rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_led_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -97,7 +97,7 @@ static rt_size_t rt_led_read (rt_device_t dev, rt_off_t pos, void* buffer, return index; } -static rt_size_t rt_led_write (rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/fujitsu/mb9x/mb9bf568r/drivers/serial.c b/bsp/fujitsu/mb9x/mb9bf568r/drivers/serial.c index 6c3a132216..305424a2a0 100644 --- a/bsp/fujitsu/mb9x/mb9bf568r/drivers/serial.c +++ b/bsp/fujitsu/mb9x/mb9bf568r/drivers/serial.c @@ -105,7 +105,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; @@ -164,7 +164,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; diff --git a/bsp/fujitsu/mb9x/mb9bf618s/drivers/led.c b/bsp/fujitsu/mb9x/mb9bf618s/drivers/led.c index bfad9947e7..d26ab4f333 100644 --- a/bsp/fujitsu/mb9x/mb9bf618s/drivers/led.c +++ b/bsp/fujitsu/mb9x/mb9bf618s/drivers/led.c @@ -75,7 +75,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read (rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_led_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -100,7 +100,7 @@ static rt_size_t rt_led_read (rt_device_t dev, rt_off_t pos, void* buffer, return index; } -static rt_size_t rt_led_write (rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/fujitsu/mb9x/mb9bf618s/drivers/serial.c b/bsp/fujitsu/mb9x/mb9bf618s/drivers/serial.c index 79279e79e5..c0fd1ac1e6 100644 --- a/bsp/fujitsu/mb9x/mb9bf618s/drivers/serial.c +++ b/bsp/fujitsu/mb9x/mb9bf618s/drivers/serial.c @@ -105,7 +105,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; @@ -164,7 +164,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; diff --git a/bsp/gd32/arm/libraries/gd32_drivers/drv_sdio.c b/bsp/gd32/arm/libraries/gd32_drivers/drv_sdio.c index be13acb872..d7d408ac1d 100644 --- a/bsp/gd32/arm/libraries/gd32_drivers/drv_sdio.c +++ b/bsp/gd32/arm/libraries/gd32_drivers/drv_sdio.c @@ -232,7 +232,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) } static uint32_t dma_buffer[SECTOR_SIZE/sizeof(uint32_t)]; -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); @@ -283,7 +283,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ } } -static rt_size_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { #define WR_RETRY_TIMES 2 diff --git a/bsp/gd32105c-eval/drivers/drv_i2c.c b/bsp/gd32105c-eval/drivers/drv_i2c.c index 6d3d2cedcc..1f442d6afb 100644 --- a/bsp/gd32105c-eval/drivers/drv_i2c.c +++ b/bsp/gd32105c-eval/drivers/drv_i2c.c @@ -225,7 +225,7 @@ static int gd32_i2c_write(rt_uint32_t i2c_periph, uint16_t slave_address, uint8_ return 0; } -static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/gd32107c-eval/drivers/drv_i2c.c b/bsp/gd32107c-eval/drivers/drv_i2c.c index 6d3d2cedcc..1f442d6afb 100644 --- a/bsp/gd32107c-eval/drivers/drv_i2c.c +++ b/bsp/gd32107c-eval/drivers/drv_i2c.c @@ -225,7 +225,7 @@ static int gd32_i2c_write(rt_uint32_t i2c_periph, uint16_t slave_address, uint8_ return 0; } -static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/gd32303e-eval/drivers/drv_i2c.c b/bsp/gd32303e-eval/drivers/drv_i2c.c index e7587618fe..4f080d2c83 100644 --- a/bsp/gd32303e-eval/drivers/drv_i2c.c +++ b/bsp/gd32303e-eval/drivers/drv_i2c.c @@ -226,7 +226,7 @@ static int gd32_i2c_write(rt_uint32_t i2c_periph, uint16_t slave_address, uint8_ return 0; } -static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/gd32450z-eval/drivers/drv_enet.c b/bsp/gd32450z-eval/drivers/drv_enet.c index f461b50fba..b37146e3c3 100644 --- a/bsp/gd32450z-eval/drivers/drv_enet.c +++ b/bsp/gd32450z-eval/drivers/drv_enet.c @@ -200,16 +200,14 @@ static rt_err_t gd32_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t gd32_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t gd32_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } -static rt_size_t gd32_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t gd32_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } static rt_err_t gd32_emac_control(rt_device_t dev, int cmd, void *args) diff --git a/bsp/gd32e230k-start/drivers/drv_i2c.c b/bsp/gd32e230k-start/drivers/drv_i2c.c index 62cd4eb973..cad5cd4b08 100644 --- a/bsp/gd32e230k-start/drivers/drv_i2c.c +++ b/bsp/gd32e230k-start/drivers/drv_i2c.c @@ -227,7 +227,7 @@ static int gd32_i2c_write(rt_uint32_t i2c_periph, uint16_t slave_address, uint8_ return 0; } -static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/hc32/libraries/hc32_drivers/drv_eth.c b/bsp/hc32/libraries/hc32_drivers/drv_eth.c index 9e687621f0..da5c9aace1 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_eth.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_eth.c @@ -178,14 +178,14 @@ static rt_err_t rt_hc32_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_hc32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_hc32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("eth read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_hc32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_hc32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("eth write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/hc32/libraries/hc32_drivers/drv_usart.c b/bsp/hc32/libraries/hc32_drivers/drv_usart.c index a960418db5..82f2a637a2 100644 --- a/bsp/hc32/libraries/hc32_drivers/drv_usart.c +++ b/bsp/hc32/libraries/hc32_drivers/drv_usart.c @@ -374,7 +374,7 @@ static int hc32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t hc32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t hc32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { #ifdef RT_SERIAL_USING_DMA struct hc32_uart *uart; diff --git a/bsp/hc32l136/drivers/drv_usart.c b/bsp/hc32l136/drivers/drv_usart.c index 7f81374dbb..d5904a63d6 100644 --- a/bsp/hc32l136/drivers/drv_usart.c +++ b/bsp/hc32l136/drivers/drv_usart.c @@ -383,7 +383,7 @@ static int hc32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t hc32_dma_transmit(struct rt_serial_device *serial, +static rt_ssize_t hc32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) diff --git a/bsp/hpmicro/hpm6750evk/board/eth_phy_port.c b/bsp/hpmicro/hpm6750evk/board/eth_phy_port.c index e229bf41d8..68c4f46406 100644 --- a/bsp/hpmicro/hpm6750evk/board/eth_phy_port.c +++ b/bsp/hpmicro/hpm6750evk/board/eth_phy_port.c @@ -101,14 +101,14 @@ static rt_phy_status phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t sr return PHY_STATUS_OK; } -static rt_size_t phy_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) +static rt_ssize_t phy_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) { *(uint16_t *)data = enet_read_phy(((struct rt_mdio_bus *)bus)->hw_obj, addr, reg); return size; } -static rt_size_t phy_write(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) +static rt_ssize_t phy_write(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) { enet_write_phy(((struct rt_mdio_bus *)bus)->hw_obj, addr, reg, *(uint16_t *)data); diff --git a/bsp/hpmicro/hpm6750evkmini/board/eth_phy_port.c b/bsp/hpmicro/hpm6750evkmini/board/eth_phy_port.c index 665541daec..c5b6b55f12 100644 --- a/bsp/hpmicro/hpm6750evkmini/board/eth_phy_port.c +++ b/bsp/hpmicro/hpm6750evkmini/board/eth_phy_port.c @@ -101,14 +101,14 @@ static rt_phy_status phy_init(void *object, rt_uint32_t phy_addr, rt_uint32_t sr return PHY_STATUS_OK; } -static rt_size_t phy_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) +static rt_ssize_t phy_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) { *(uint16_t *)data = enet_read_phy(((struct rt_mdio_bus *)bus)->hw_obj, addr, reg); return size; } -static rt_size_t phy_write(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) +static rt_ssize_t phy_write(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) { enet_write_phy(((struct rt_mdio_bus *)bus)->hw_obj, addr, reg, *(uint16_t *)data); diff --git a/bsp/hpmicro/libraries/drivers/drv_dao.c b/bsp/hpmicro/libraries/drivers/drv_dao.c index 01cdf69ffe..3ba9096395 100644 --- a/bsp/hpmicro/libraries/drivers/drv_dao.c +++ b/bsp/hpmicro/libraries/drivers/drv_dao.c @@ -214,7 +214,7 @@ static rt_err_t hpm_dao_stop(struct rt_audio_device* audio, int stream) return RT_EOK; } -static rt_size_t hpm_dao_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size) +static rt_ssize_t hpm_dao_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size) { RT_ASSERT(audio != RT_NULL); diff --git a/bsp/hpmicro/libraries/drivers/drv_enet.c b/bsp/hpmicro/libraries/drivers/drv_enet.c index c9e4819ebb..860a867682 100644 --- a/bsp/hpmicro/libraries/drivers/drv_enet.c +++ b/bsp/hpmicro/libraries/drivers/drv_enet.c @@ -196,12 +196,12 @@ static rt_err_t rt_hpm_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_hpm_eth_read(rt_device_t dev, rt_off_t pos, void * buffer, rt_size_t size) +static rt_ssize_t rt_hpm_eth_read(rt_device_t dev, rt_off_t pos, void * buffer, rt_size_t size) { return 0; } -static rt_size_t rt_hpm_eth_write(rt_device_t dev, rt_off_t pos, const void * buffer, rt_size_t size) +static rt_ssize_t rt_hpm_eth_write(rt_device_t dev, rt_off_t pos, const void * buffer, rt_size_t size) { return 0; } diff --git a/bsp/hpmicro/libraries/drivers/drv_i2c.c b/bsp/hpmicro/libraries/drivers/drv_i2c.c index 4d83707262..4549d81c0a 100644 --- a/bsp/hpmicro/libraries/drivers/drv_i2c.c +++ b/bsp/hpmicro/libraries/drivers/drv_i2c.c @@ -55,7 +55,7 @@ static struct hpm_i2c hpm_i2cs[] = #endif }; -static rt_size_t hpm_i2c_master_transfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); +static rt_ssize_t hpm_i2c_master_transfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); struct rt_i2c_bus_device_ops hpm_i2c_ops = @@ -65,7 +65,7 @@ struct rt_i2c_bus_device_ops hpm_i2c_ops = RT_NULL }; -static rt_size_t hpm_i2c_master_transfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t hpm_i2c_master_transfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { RT_ASSERT(bus != RT_NULL); RT_ASSERT(msgs != RT_NULL); diff --git a/bsp/hpmicro/libraries/drivers/drv_i2s.c b/bsp/hpmicro/libraries/drivers/drv_i2s.c index 5312ee0a10..bac0bf677f 100644 --- a/bsp/hpmicro/libraries/drivers/drv_i2s.c +++ b/bsp/hpmicro/libraries/drivers/drv_i2s.c @@ -24,7 +24,7 @@ #include "drv_i2s.h" #include "drivers/audio.h" -static rt_size_t hpm_i2s_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size); +static rt_ssize_t hpm_i2s_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size); struct hpm_i2s { @@ -462,7 +462,7 @@ static rt_err_t hpm_i2s_stop(struct rt_audio_device* audio, int stream) return RT_EOK; } -static rt_size_t hpm_i2s_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size) +static rt_ssize_t hpm_i2s_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size) { RT_ASSERT(audio != RT_NULL); struct hpm_i2s* hpm_audio = (struct hpm_i2s*)audio->parent.user_data; diff --git a/bsp/hpmicro/libraries/drivers/drv_rtc.c b/bsp/hpmicro/libraries/drivers/drv_rtc.c index f701d71195..114ad7a07b 100644 --- a/bsp/hpmicro/libraries/drivers/drv_rtc.c +++ b/bsp/hpmicro/libraries/drivers/drv_rtc.c @@ -25,8 +25,8 @@ static rt_err_t hpm_rtc_init(rt_device_t dev); static rt_err_t hpm_rtc_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t hpm_rtc_close(rt_device_t dev); -static rt_size_t hpm_rtc_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t size); -static rt_size_t hpm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buf, rt_size_t size); +static rt_ssize_t hpm_rtc_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t size); +static rt_ssize_t hpm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buf, rt_size_t size); static rt_err_t hpm_rtc_control(rt_device_t dev, int cmd, void *args); static time_t hpm_rtc_get_timestamp(void); @@ -64,11 +64,11 @@ static rt_err_t hpm_rtc_close(rt_device_t dev) { return RT_EOK; } -static rt_size_t hpm_rtc_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t size) +static rt_ssize_t hpm_rtc_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t size) { return 0; } -static rt_size_t hpm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buf, rt_size_t size) +static rt_ssize_t hpm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buf, rt_size_t size) { return 0; } diff --git a/bsp/hpmicro/libraries/drivers/drv_uart_v2.c b/bsp/hpmicro/libraries/drivers/drv_uart_v2.c index ce82dfb0cb..6f4f012cb3 100644 --- a/bsp/hpmicro/libraries/drivers/drv_uart_v2.c +++ b/bsp/hpmicro/libraries/drivers/drv_uart_v2.c @@ -864,7 +864,7 @@ static int hpm_uart_getc(struct rt_serial_device *serial) return result; } -static rt_size_t hpm_uart_transmit(struct rt_serial_device *serial, +static rt_ssize_t hpm_uart_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) diff --git a/bsp/hpmicro/libraries/drivers/drv_usb.c b/bsp/hpmicro/libraries/drivers/drv_usb.c index 946a9f3a1a..1d00550e0b 100644 --- a/bsp/hpmicro/libraries/drivers/drv_usb.c +++ b/bsp/hpmicro/libraries/drivers/drv_usb.c @@ -13,8 +13,8 @@ /* Definition of logic unit number for each drive */ #define LUN_USB (0U) /* lun 0 of usb drive */ -static rt_size_t hpm_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t hpm_usb_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t hpm_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t hpm_usb_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_err_t hpm_usb_control(rt_device_t dev, int cmd, void *args); rt_uint8_t usb_dev_addr; @@ -50,7 +50,7 @@ void hpm_usb_set_addr(uint8_t dev_addr) usb_dev_addr = dev_addr; } -static rt_size_t hpm_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t hpm_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_bool_t result; @@ -63,7 +63,7 @@ static rt_size_t hpm_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_si return result ? size : 0; } -static rt_size_t hpm_usb_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t hpm_usb_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { bool result; diff --git a/bsp/imx6sx/cortex-a9/drivers/emac_drv.c b/bsp/imx6sx/cortex-a9/drivers/emac_drv.c index ff8a579435..80d2a95618 100644 --- a/bsp/imx6sx/cortex-a9/drivers/emac_drv.c +++ b/bsp/imx6sx/cortex-a9/drivers/emac_drv.c @@ -116,13 +116,13 @@ static rt_err_t imx_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t imx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t imx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t imx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t imx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/imxrt/libraries/drivers/drv_eth.c b/bsp/imxrt/libraries/drivers/drv_eth.c index df22eab181..7454fd18f7 100644 --- a/bsp/imxrt/libraries/drivers/drv_eth.c +++ b/bsp/imxrt/libraries/drivers/drv_eth.c @@ -489,14 +489,14 @@ static rt_err_t rt_imxrt_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_imxrt_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_imxrt_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { dbg_log(DBG_LOG, "rt_imxrt_eth_read...\n"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_imxrt_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_imxrt_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { dbg_log(DBG_LOG, "rt_imxrt_eth_write...\n"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/imxrt/libraries/drivers/drv_i2c.c b/bsp/imxrt/libraries/drivers/drv_i2c.c index ed16dee061..6f66a68451 100644 --- a/bsp/imxrt/libraries/drivers/drv_i2c.c +++ b/bsp/imxrt/libraries/drivers/drv_i2c.c @@ -134,10 +134,10 @@ static struct imxrt_i2c_bus lpi2c6 = #if (defined(BSP_USING_I2C1) || defined(BSP_USING_I2C2) || defined(BSP_USING_I2C3) || defined(BSP_USING_I2C4) ||defined(BSP_USING_I2C5) || defined(BSP_USING_I2C6)) -static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); -static rt_size_t imxrt_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t imxrt_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t imxrt_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -249,7 +249,7 @@ static status_t LPI2C_MasterWaitForTxFifoAllEmpty(LPI2C_Type *base) return kStatus_Success; } -static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -365,7 +365,7 @@ static rt_size_t imxrt_i2c_mst_xfer(struct rt_i2c_bus_device *bus, return i; } -static rt_size_t imxrt_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t imxrt_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/imxrt/libraries/drivers/drv_mdio.c b/bsp/imxrt/libraries/drivers/drv_mdio.c index 354b982280..98f8d3a5c8 100644 --- a/bsp/imxrt/libraries/drivers/drv_mdio.c +++ b/bsp/imxrt/libraries/drivers/drv_mdio.c @@ -51,7 +51,7 @@ static rt_bool_t rt_hw_mdio_init(void *bus, rt_uint32_t src_clock_hz) return RT_TRUE; } -static rt_size_t rt_hw_mdio_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) +static rt_ssize_t rt_hw_mdio_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) { RT_ASSERT(data); struct rt_mdio_bus *bus_obj = (struct rt_mdio_bus *)bus; @@ -96,7 +96,7 @@ static rt_size_t rt_hw_mdio_read(void *bus, rt_uint32_t addr, rt_uint32_t reg, v } -static rt_size_t rt_hw_mdio_write(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) +static rt_ssize_t rt_hw_mdio_write(void *bus, rt_uint32_t addr, rt_uint32_t reg, void *data, rt_uint32_t size) { struct rt_mdio_bus *bus_obj = (struct rt_mdio_bus *)bus; uint32_t counter; diff --git a/bsp/imxrt/libraries/drivers/drv_rtc.c b/bsp/imxrt/libraries/drivers/drv_rtc.c index 4a95b496d0..c7e9ad58d2 100644 --- a/bsp/imxrt/libraries/drivers/drv_rtc.c +++ b/bsp/imxrt/libraries/drivers/drv_rtc.c @@ -103,12 +103,12 @@ static rt_err_t imxrt_hp_rtc_close(rt_device_t dev) return RT_EOK; } -static rt_size_t imxrt_hp_rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t imxrt_hp_rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { return -RT_EINVAL; } -static rt_size_t imxrt_hp_rtc_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t imxrt_hp_rtc_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { return -RT_EINVAL; } diff --git a/bsp/imxrt/libraries/drivers/drv_sai.c b/bsp/imxrt/libraries/drivers/drv_sai.c index 166498cae3..5dcdf52bfc 100644 --- a/bsp/imxrt/libraries/drivers/drv_sai.c +++ b/bsp/imxrt/libraries/drivers/drv_sai.c @@ -504,7 +504,7 @@ static rt_err_t imxrt_payer_stop(struct rt_audio_device* audio, int stream) return RT_EOK; } -static rt_size_t imxrt_payer_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size) +static rt_ssize_t imxrt_payer_transmit(struct rt_audio_device* audio, const void* writeBuf, void* readBuf, rt_size_t size) { RT_ASSERT(audio != RT_NULL); #if defined (BSP_USING_AUDIO_RECORD) diff --git a/bsp/imxrt/libraries/drivers/drv_usbd.c b/bsp/imxrt/libraries/drivers/drv_usbd.c index 49f47e4d1d..547e6c5988 100644 --- a/bsp/imxrt/libraries/drivers/drv_usbd.c +++ b/bsp/imxrt/libraries/drivers/drv_usbd.c @@ -152,7 +152,7 @@ static rt_err_t _ehci0_ep_disable(uep_t ep) return RT_EOK; } -static rt_size_t _ehci0_ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ehci0_ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; @@ -161,13 +161,13 @@ static rt_size_t _ehci0_ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ehci0_ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ehci0_ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { USB_DeviceRecvRequest(ehci0_handle, address, buffer, size); return size; } -static rt_size_t _ehci0_ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ehci0_ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { USB_DeviceSendRequest(ehci0_handle, address, buffer, size); return size; diff --git a/bsp/juicevm/driver/drv_uart.c b/bsp/juicevm/driver/drv_uart.c index b4fc7abab9..412a5d081a 100755 --- a/bsp/juicevm/driver/drv_uart.c +++ b/bsp/juicevm/driver/drv_uart.c @@ -24,7 +24,7 @@ static rt_err_t uart_configure(struct rt_serial_device *serial, struct serial_c static rt_err_t uart_control(struct rt_serial_device *serial, int cmd, void *arg); static int uart_putc(struct rt_serial_device *serial, char c); static int uart_getc(struct rt_serial_device *serial); -static rt_size_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); +static rt_ssize_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); void UART0_DriverIRQHandler(void); @@ -115,7 +115,7 @@ static int uart_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return (0); } diff --git a/bsp/k210/drivers/drv_lcd.c b/bsp/k210/drivers/drv_lcd.c index 3e626553b7..40300b4e5d 100644 --- a/bsp/k210/drivers/drv_lcd.c +++ b/bsp/k210/drivers/drv_lcd.c @@ -443,7 +443,7 @@ static rt_err_t drv_lcd_close(rt_device_t dev) return RT_EOK; } -static rt_size_t drv_lcd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t drv_lcd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { /* Not need */ @@ -451,7 +451,7 @@ static rt_size_t drv_lcd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_si return 0; } -static rt_size_t drv_lcd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t drv_lcd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { /* Not need */ diff --git a/bsp/lm3s8962/drivers/sdcard.c b/bsp/lm3s8962/drivers/sdcard.c index 55bec74635..93cce84f30 100644 --- a/bsp/lm3s8962/drivers/sdcard.c +++ b/bsp/lm3s8962/drivers/sdcard.c @@ -691,7 +691,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { DRESULT status; @@ -705,7 +705,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return size; } -static rt_size_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { DRESULT status; diff --git a/bsp/lm3s8962/drivers/serial.c b/bsp/lm3s8962/drivers/serial.c index 35060f8269..9bfba0b6a1 100644 --- a/bsp/lm3s8962/drivers/serial.c +++ b/bsp/lm3s8962/drivers/serial.c @@ -188,7 +188,7 @@ static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_lm3s_serial *serial = (struct rt_lm3s_serial*)dev; @@ -248,7 +248,7 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return (rt_size_t)ptr - (rt_size_t)buffer; } -static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_lm3s_serial* serial; char *ptr; diff --git a/bsp/lm3s9b9x/drivers/sdcard.c b/bsp/lm3s9b9x/drivers/sdcard.c index 55bec74635..93cce84f30 100644 --- a/bsp/lm3s9b9x/drivers/sdcard.c +++ b/bsp/lm3s9b9x/drivers/sdcard.c @@ -691,7 +691,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { DRESULT status; @@ -705,7 +705,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return size; } -static rt_size_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { DRESULT status; diff --git a/bsp/lm3s9b9x/drivers/serial.c b/bsp/lm3s9b9x/drivers/serial.c index 35060f8269..9bfba0b6a1 100644 --- a/bsp/lm3s9b9x/drivers/serial.c +++ b/bsp/lm3s9b9x/drivers/serial.c @@ -188,7 +188,7 @@ static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_lm3s_serial *serial = (struct rt_lm3s_serial*)dev; @@ -248,7 +248,7 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return (rt_size_t)ptr - (rt_size_t)buffer; } -static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_lm3s_serial* serial; char *ptr; diff --git a/bsp/lm4f232/drivers/serial.c b/bsp/lm4f232/drivers/serial.c index 35060f8269..9bfba0b6a1 100644 --- a/bsp/lm4f232/drivers/serial.c +++ b/bsp/lm4f232/drivers/serial.c @@ -188,7 +188,7 @@ static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_lm3s_serial *serial = (struct rt_lm3s_serial*)dev; @@ -248,7 +248,7 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return (rt_size_t)ptr - (rt_size_t)buffer; } -static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_lm3s_serial* serial; char *ptr; diff --git a/bsp/loongson/ls1cdev/drivers/drv_rtc.c b/bsp/loongson/ls1cdev/drivers/drv_rtc.c index 89d72a5bb3..3f2f3af1b6 100644 --- a/bsp/loongson/ls1cdev/drivers/drv_rtc.c +++ b/bsp/loongson/ls1cdev/drivers/drv_rtc.c @@ -84,7 +84,7 @@ static rt_err_t rt_rtc_open(rt_device_t dev, rt_uint16_t oflag) return RT_EOK; } -static rt_size_t rt_rtc_read( +static rt_ssize_t rt_rtc_read( rt_device_t dev, rt_off_t pos, void* buffer, diff --git a/bsp/loongson/ls1cdev/drivers/net/synopGMAC.c b/bsp/loongson/ls1cdev/drivers/net/synopGMAC.c index dcdf4afb03..48c043fcee 100644 --- a/bsp/loongson/ls1cdev/drivers/net/synopGMAC.c +++ b/bsp/loongson/ls1cdev/drivers/net/synopGMAC.c @@ -403,13 +403,13 @@ static rt_err_t eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c b/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c index bf76636e06..aca793c1a1 100644 --- a/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c +++ b/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.c @@ -1197,13 +1197,13 @@ int dwc_ahsata_probe(struct rt_device *dev) return dwc_ahci_start_ports(uc_priv); } -rt_size_t dwc_ahsata_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +rt_ssize_t dwc_ahsata_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { struct blk_device *blk = (struct blk_device *)dev; return sata_read_common(blk->ahci_device, blk, pos, size, buffer); } -rt_size_t dwc_ahsata_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +rt_ssize_t dwc_ahsata_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct blk_device *blk = (struct blk_device *)dev; return sata_write_common(blk->ahci_device, blk, pos, size, buffer); diff --git a/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.h b/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.h index 44e993d03e..80389a5fd6 100644 --- a/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.h +++ b/bsp/loongson/ls2kdev/drivers/ata/dwc_ahsata.h @@ -18,8 +18,8 @@ int dwc_ahsata_bus_reset(struct rt_device *dev); int dwc_ahsata_probe(struct rt_device *dev); int dwc_ahsata_scan(struct rt_device *dev); int dwc_ahsata_port_status(struct rt_device *dev, int port); -rt_size_t dwc_ahsata_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -rt_size_t dwc_ahsata_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +rt_ssize_t dwc_ahsata_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +rt_ssize_t dwc_ahsata_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_err_t dwc_ahsata_control(rt_device_t dev, int cmd, void *args); #endif diff --git a/bsp/loongson/ls2kdev/drivers/drv_rtc.c b/bsp/loongson/ls2kdev/drivers/drv_rtc.c index 82cb25ddd5..ae90e2c79e 100644 --- a/bsp/loongson/ls2kdev/drivers/drv_rtc.c +++ b/bsp/loongson/ls2kdev/drivers/drv_rtc.c @@ -108,7 +108,7 @@ static rt_err_t rt_rtc_open(rt_device_t dev, rt_uint16_t oflag) return RT_EOK; } -static rt_size_t rt_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { return 0; } diff --git a/bsp/loongson/ls2kdev/drivers/net/synopGMAC.c b/bsp/loongson/ls2kdev/drivers/net/synopGMAC.c index 22e51de712..e2c4d2bf82 100644 --- a/bsp/loongson/ls2kdev/drivers/net/synopGMAC.c +++ b/bsp/loongson/ls2kdev/drivers/net/synopGMAC.c @@ -423,13 +423,13 @@ static rt_err_t eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/lpc176x/drivers/emac.c b/bsp/lpc176x/drivers/emac.c index e4f0363626..c5b11f48c7 100644 --- a/bsp/lpc176x/drivers/emac.c +++ b/bsp/lpc176x/drivers/emac.c @@ -342,16 +342,14 @@ static rt_err_t lpc17xx_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t lpc17xx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t lpc17xx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } -static rt_size_t lpc17xx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t lpc17xx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } static rt_err_t lpc17xx_emac_control(rt_device_t dev, int cmd, void *args) diff --git a/bsp/lpc176x/drivers/sd.c b/bsp/lpc176x/drivers/sd.c index 53b57676de..27e6382825 100644 --- a/bsp/lpc176x/drivers/sd.c +++ b/bsp/lpc176x/drivers/sd.c @@ -438,7 +438,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { bool status; @@ -450,7 +450,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_ return 0; } -static rt_size_t rt_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { bool status; diff --git a/bsp/lpc176x/drivers/uart.c b/bsp/lpc176x/drivers/uart.c index a32952124b..82d4a4fa1d 100644 --- a/bsp/lpc176x/drivers/uart.c +++ b/bsp/lpc176x/drivers/uart.c @@ -203,7 +203,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint8_t *ptr; struct rt_uart_lpc *uart = (struct rt_uart_lpc *)dev; @@ -250,7 +250,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { char *ptr; ptr = (char *)buffer; diff --git a/bsp/lpc178x/drivers/emac.c b/bsp/lpc178x/drivers/emac.c index ec48ea8833..7314964f04 100644 --- a/bsp/lpc178x/drivers/emac.c +++ b/bsp/lpc178x/drivers/emac.c @@ -366,16 +366,14 @@ static rt_err_t lpc17xx_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t lpc17xx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t lpc17xx_emac_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } -static rt_size_t lpc17xx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t lpc17xx_emac_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - return 0; + return -RT_ENOSYS; } static rt_err_t lpc17xx_emac_control(rt_device_t dev, int cmd, void *args) diff --git a/bsp/lpc178x/drivers/uart.c b/bsp/lpc178x/drivers/uart.c index cb8e68d30c..b55f487429 100644 --- a/bsp/lpc178x/drivers/uart.c +++ b/bsp/lpc178x/drivers/uart.c @@ -220,7 +220,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_uart_lpc *uart = (struct rt_uart_lpc*)dev; @@ -267,7 +267,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_uart_lpc *uart = (struct rt_uart_lpc*)dev; char *ptr; diff --git a/bsp/lpc2148/drivers/dm9000.c b/bsp/lpc2148/drivers/dm9000.c index 9bc8d445f9..6677b1bf0d 100644 --- a/bsp/lpc2148/drivers/dm9000.c +++ b/bsp/lpc2148/drivers/dm9000.c @@ -60,13 +60,13 @@ static rt_err_t rt_dm9000_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_dm9000_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_dm9000_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_dm9000_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_dm9000_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/lpc2148/drivers/sd.c b/bsp/lpc2148/drivers/sd.c index 144c9f2ff5..a283a4b146 100644 --- a/bsp/lpc2148/drivers/sd.c +++ b/bsp/lpc2148/drivers/sd.c @@ -30,7 +30,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { /* append partition offset */ pos += part.offset * 512; @@ -38,7 +38,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return 0; } -static rt_size_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { /* append partition offset */ pos += part.offset * 512; diff --git a/bsp/lpc2148/drivers/serial.c b/bsp/lpc2148/drivers/serial.c index 4fff9c78c8..284b9accae 100644 --- a/bsp/lpc2148/drivers/serial.c +++ b/bsp/lpc2148/drivers/serial.c @@ -190,7 +190,7 @@ static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_lpcserial *lpc_serial = (struct rt_lpcserial*)dev; @@ -252,7 +252,7 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return (rt_size_t)ptr - (rt_size_t)buffer; } -static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_lpcserial* lpc_serial; char *ptr; diff --git a/bsp/lpc2478/drivers/serial.c b/bsp/lpc2478/drivers/serial.c index e53b5075dc..d5ee6763ad 100644 --- a/bsp/lpc2478/drivers/serial.c +++ b/bsp/lpc2478/drivers/serial.c @@ -163,7 +163,7 @@ static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_lpcserial *lpc_serial = (struct rt_lpcserial*)dev; @@ -225,7 +225,7 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return (rt_size_t)ptr - (rt_size_t)buffer; } -static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_lpcserial* lpc_serial; char *ptr; diff --git a/bsp/lpc408x/drivers/drv_emac.c b/bsp/lpc408x/drivers/drv_emac.c index 0bae0f1456..a92aba8845 100644 --- a/bsp/lpc408x/drivers/drv_emac.c +++ b/bsp/lpc408x/drivers/drv_emac.c @@ -334,13 +334,13 @@ static rt_err_t lpc_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t lpc_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t lpc_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t lpc_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t lpc_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/lpc408x/drivers/drv_led.c b/bsp/lpc408x/drivers/drv_led.c index 29c74af1af..5c18ef67d1 100644 --- a/bsp/lpc408x/drivers/drv_led.c +++ b/bsp/lpc408x/drivers/drv_led.c @@ -61,7 +61,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, +static rt_ssize_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -86,7 +86,7 @@ static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, return index; } -static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/lpc43xx/drivers/drv_emac.c b/bsp/lpc43xx/drivers/drv_emac.c index 03c6321dbf..f88505fa88 100644 --- a/bsp/lpc43xx/drivers/drv_emac.c +++ b/bsp/lpc43xx/drivers/drv_emac.c @@ -355,13 +355,13 @@ static rt_err_t lpc_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t lpc_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t lpc_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t lpc_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t lpc_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/lpc43xx/drivers/drv_led.c b/bsp/lpc43xx/drivers/drv_led.c index 464ddb4f9f..02ce94d548 100644 --- a/bsp/lpc43xx/drivers/drv_led.c +++ b/bsp/lpc43xx/drivers/drv_led.c @@ -76,7 +76,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, +static rt_ssize_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -101,7 +101,7 @@ static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, return index; } -static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/lpc5410x/drivers/drv_led.c b/bsp/lpc5410x/drivers/drv_led.c index 108707aee1..fc6ca6abed 100644 --- a/bsp/lpc5410x/drivers/drv_led.c +++ b/bsp/lpc5410x/drivers/drv_led.c @@ -61,7 +61,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, +static rt_ssize_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -86,7 +86,7 @@ static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, return index; } -static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/lpc54114-lite/drivers/audio/drv_sound.c b/bsp/lpc54114-lite/drivers/audio/drv_sound.c index 409403facb..4e49a619ad 100644 --- a/bsp/lpc54114-lite/drivers/audio/drv_sound.c +++ b/bsp/lpc54114-lite/drivers/audio/drv_sound.c @@ -297,7 +297,7 @@ static rt_err_t lpc_audio_configure(struct rt_audio_device *audio, struct rt_aud return result; } -static rt_size_t lpc_audio_transmit(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size) +static rt_ssize_t lpc_audio_transmit(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size) { RT_ASSERT(audio != RT_NULL); i2s_transfer_t transfer; diff --git a/bsp/lpc54114-lite/drivers/drv_i2c.c b/bsp/lpc54114-lite/drivers/drv_i2c.c index cba87c8aec..4d66217898 100644 --- a/bsp/lpc54114-lite/drivers/drv_i2c.c +++ b/bsp/lpc54114-lite/drivers/drv_i2c.c @@ -33,7 +33,7 @@ static uint32_t get_i2c_freq(I2C_Type *base) return freq; } -static rt_size_t master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { rt_size_t ret = (0); @@ -82,7 +82,7 @@ static rt_size_t master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg ms return ret; } -static rt_size_t slave_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t slave_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { return 0; } diff --git a/bsp/lpc54608-LPCXpresso/drivers/drv_emac.c b/bsp/lpc54608-LPCXpresso/drivers/drv_emac.c index 394ad22cca..6556d24125 100644 --- a/bsp/lpc54608-LPCXpresso/drivers/drv_emac.c +++ b/bsp/lpc54608-LPCXpresso/drivers/drv_emac.c @@ -383,13 +383,13 @@ static rt_err_t lpc_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t lpc_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t lpc_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t lpc_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t lpc_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c b/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c index 1a6b5ff3b8..75807e2b96 100644 --- a/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c +++ b/bsp/lpc54608-LPCXpresso/drivers/drv_i2c.c @@ -143,7 +143,7 @@ struct lpc_i2c_bus I2C_Type *I2C; }; -static rt_size_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; diff --git a/bsp/lpc54608-LPCXpresso/drivers/drv_sd.c b/bsp/lpc54608-LPCXpresso/drivers/drv_sd.c index 879e0d1c9c..5b288e616c 100644 --- a/bsp/lpc54608-LPCXpresso/drivers/drv_sd.c +++ b/bsp/lpc54608-LPCXpresso/drivers/drv_sd.c @@ -34,7 +34,7 @@ static rt_err_t rt_mci_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_mci_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_mci_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint8_t status = kStatus_Success; struct mci_device *mci = (struct mci_device *)dev; @@ -67,7 +67,7 @@ static rt_size_t rt_mci_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz return 0; } -static rt_size_t rt_mci_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_mci_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_uint8_t status = kStatus_Success; struct mci_device *mci = (struct mci_device *)dev; diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_i2c.c b/bsp/lpc55sxx/Libraries/drivers/drv_i2c.c index 522b4b712f..bf83c41143 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_i2c.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_i2c.c @@ -66,7 +66,7 @@ static void i2c_mst_dma_callback(I2C_Type *base, i2c_master_dma_handle_t *handle rt_sem_release(lpc_i2c->sem); } -static rt_size_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t lpc_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_led.c b/bsp/lpc55sxx/Libraries/drivers/drv_led.c index 8e3e59eeea..9410d5fa00 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_led.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_led.c @@ -62,7 +62,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, +static rt_ssize_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -87,7 +87,7 @@ static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, return index; } -static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c b/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c index 65d34bbb4e..2a627bb986 100644 --- a/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c +++ b/bsp/lpc55sxx/Libraries/drivers/drv_rtc.c @@ -87,12 +87,12 @@ static rt_err_t lpc_rtc_close(rt_device_t dev) return RT_EOK; } -static rt_size_t lpc_rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t lpc_rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { return 0; } -static rt_size_t lpc_rtc_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t lpc_rtc_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { return 0; } diff --git a/bsp/lpc824/drivers/usart.c b/bsp/lpc824/drivers/usart.c index 54a56501c9..6aa912c081 100644 --- a/bsp/lpc824/drivers/usart.c +++ b/bsp/lpc824/drivers/usart.c @@ -183,7 +183,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { /* interrupt receive */ rt_base_t level; @@ -205,7 +205,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return length; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { char *ptr = (char*) buffer; struct lpc8xx_uart* uart; diff --git a/bsp/m16c62p/drivers/uart.c b/bsp/m16c62p/drivers/uart.c index 67f56b98a3..c543b023ad 100644 --- a/bsp/m16c62p/drivers/uart.c +++ b/bsp/m16c62p/drivers/uart.c @@ -164,7 +164,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t *ptr; struct rt_uart_m16c *uart = (struct rt_uart_m16c *)dev; @@ -211,7 +211,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { char *ptr; ptr = (char *)buffer; diff --git a/bsp/maxim/libraries/HAL_Drivers/drv_i2c.c b/bsp/maxim/libraries/HAL_Drivers/drv_i2c.c index ddacdf0a12..4ae3a06319 100644 --- a/bsp/maxim/libraries/HAL_Drivers/drv_i2c.c +++ b/bsp/maxim/libraries/HAL_Drivers/drv_i2c.c @@ -66,7 +66,7 @@ static struct mxc_i2c_config i2c_config[] = static struct mxc_i2c i2c_obj[sizeof(i2c_config) / sizeof(i2c_config[0])] = {0}; -static rt_size_t mxc_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t mxc_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/microchip/common/board/sam_gmac.c b/bsp/microchip/common/board/sam_gmac.c index 953c3430f4..b8f8d7a91c 100644 --- a/bsp/microchip/common/board/sam_gmac.c +++ b/bsp/microchip/common/board/sam_gmac.c @@ -111,14 +111,14 @@ static rt_err_t rt_sam_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sam_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_sam_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("gmac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_sam_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_sam_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("gmac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/microchip/common/board/sam_i2c.c b/bsp/microchip/common/board/sam_i2c.c index 7196e0c87d..ea23058487 100644 --- a/bsp/microchip/common/board/sam_i2c.c +++ b/bsp/microchip/common/board/sam_i2c.c @@ -30,10 +30,10 @@ static struct sam_i2c_bus sam_i2c0 = .device_name = I2CBUS_NAME, }; -static rt_size_t sam_i2c_master_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t sam_i2c_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); -static rt_size_t sam_i2c_slave_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t sam_i2c_slave_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t sam_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -62,7 +62,7 @@ static inline void sam_i2c_update_control(struct rt_i2c_msg *src, dest->flags |= I2C_M_SEVEN; } -static rt_size_t sam_i2c_master_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t sam_i2c_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -82,7 +82,7 @@ static rt_size_t sam_i2c_master_xfer(struct rt_i2c_bus_device *bus, return i; } -static rt_size_t sam_i2c_slave_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t sam_i2c_slave_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/mini2440/drivers/dm9000.c b/bsp/mini2440/drivers/dm9000.c index 2bdbd43a12..c3acda2c67 100644 --- a/bsp/mini2440/drivers/dm9000.c +++ b/bsp/mini2440/drivers/dm9000.c @@ -335,13 +335,13 @@ static rt_err_t rt_dm9000_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_dm9000_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_dm9000_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_dm9000_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_dm9000_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/mini2440/drivers/key.c b/bsp/mini2440/drivers/key.c index 459ebf2b07..dd6a81d246 100644 --- a/bsp/mini2440/drivers/key.c +++ b/bsp/mini2440/drivers/key.c @@ -157,7 +157,7 @@ static rt_err_t rt_key_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_key_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_key_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; diff --git a/bsp/mini4020/drivers/dm9161.c b/bsp/mini4020/drivers/dm9161.c index a5100f501b..2e15c70ba5 100644 --- a/bsp/mini4020/drivers/dm9161.c +++ b/bsp/mini4020/drivers/dm9161.c @@ -508,18 +508,14 @@ static rt_err_t rt_dm9161_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_dm9161_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_dm9161_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - - return 0; + return -RT_ENOSYS; } -static rt_size_t rt_dm9161_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_dm9161_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { - rt_set_errno(-RT_ENOSYS); - - return 0; + return -RT_ENOSYS; } static rt_err_t rt_dm9161_control(rt_device_t dev, int cmd, void *args) diff --git a/bsp/mini4020/drivers/sdcard.c b/bsp/mini4020/drivers/sdcard.c index bf2192382f..4e497ed5f0 100644 --- a/bsp/mini4020/drivers/sdcard.c +++ b/bsp/mini4020/drivers/sdcard.c @@ -524,7 +524,7 @@ static rt_err_t rt_sdcard_control(rt_device_t dev, int cmd, void *args) * * @param hook the hook function */ -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint32_t retry = 3; rt_uint8_t status; @@ -582,7 +582,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_ * * @param hook the hook function */ -static rt_size_t rt_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { int i; rt_uint8_t status; diff --git a/bsp/n32/libraries/n32_drivers/drv_i2c.c b/bsp/n32/libraries/n32_drivers/drv_i2c.c index a5c8f62050..d64f9288fd 100644 --- a/bsp/n32/libraries/n32_drivers/drv_i2c.c +++ b/bsp/n32/libraries/n32_drivers/drv_i2c.c @@ -336,7 +336,7 @@ static int rt_i2c_write(rt_uint32_t i2c_periph, uint16_t slave_address, uint8_t* -static rt_size_t rt_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t rt_i2c_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/nios_ii/uart.c b/bsp/nios_ii/uart.c index 79c2dcc586..abc4aed0a0 100644 --- a/bsp/nios_ii/uart.c +++ b/bsp/nios_ii/uart.c @@ -51,7 +51,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { if( rx_get_index ) { @@ -62,7 +62,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { const char * write_point = buffer; while(size--) diff --git a/bsp/nrf5x/libraries/drivers/drv_i2c.c b/bsp/nrf5x/libraries/drivers/drv_i2c.c index e86c86507d..d66b74a83f 100644 --- a/bsp/nrf5x/libraries/drivers/drv_i2c.c +++ b/bsp/nrf5x/libraries/drivers/drv_i2c.c @@ -89,7 +89,7 @@ static int twi_master_init(struct rt_i2c_bus_device *bus) return 0; } -static rt_size_t _master_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t _master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_i2c.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_i2c.c index 94aa0e234c..f7d3f85192 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_i2c.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_i2c.c @@ -119,7 +119,7 @@ static void gd32_i2c_configure(struct gd32_i2c_config *i2c_cfg) } -static rt_size_t gd32_i2c_xfer(struct rt_i2c_bus_device *device, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t gd32_i2c_xfer(struct rt_i2c_bus_device *device, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; rt_uint32_t i; diff --git a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c index 1d1c5ced78..1bda274950 100644 --- a/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c +++ b/bsp/nuclei/libraries/gd32vf103/HAL_Drivers/drv_rtc.c @@ -98,12 +98,12 @@ static rt_err_t gd32_rtc_close(rt_device_t dev) return RT_EOK; } -static rt_size_t gd32_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t gd32_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { return RT_EOK; } -static rt_size_t gd32_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t gd32_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { return RT_EOK; } diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c index 7487414dec..24aaddd04d 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_i2c.c @@ -69,7 +69,7 @@ static nu_i2c_bus_t nu_i2c1 = /* Private functions ------------------------------------------------------------*/ #if (defined(BSP_USING_I2C0) || defined(BSP_USING_I2C1)) -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -162,7 +162,7 @@ static rt_err_t nu_i2c_send_address(nu_i2c_bus_t *nu_i2c, return RT_EOK; } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c index de6dba3bc5..492c35ba5f 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_pdma.c @@ -66,7 +66,7 @@ static void nu_pdma_channel_disable(int i32ChannID); static void nu_pdma_channel_reset(int i32ChannID); static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us); static void nu_pdma_periph_ctrl_fill(int i32ChannID, int i32CtlPoolIdx); -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int count, nu_pdma_memctrl_t eMemCtl); +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int count, nu_pdma_memctrl_t eMemCtl); static void nu_pdma_memfun_cb(void *pvUserData, uint32_t u32Events); static void nu_pdma_memfun_actor_init(void); static int nu_pdma_memfun_employ(void); @@ -910,7 +910,7 @@ static int nu_pdma_memfun_employ(void) return idx; } -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) { nu_pdma_memfun_actor_t psMemFunActor = NULL; int idx; diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_rtc.c index e280b1c3b8..7005a3149f 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_rtc.c @@ -53,8 +53,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -153,7 +153,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -165,7 +165,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c index 21f9f2fb61..6e5e38b20b 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_spi.c @@ -55,7 +55,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, struct rt_spi static void nu_pdma_spi_rx_cb(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_spi_rx_config(struct nu_spi *spi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_spi_tx_config(struct nu_spi *spi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); #endif /* Public functions -------------------------------------------------------------*/ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int length, uint8_t bytes_per_word); @@ -300,7 +300,7 @@ exit_nu_pdma_spi_tx_config: /** * SPI PDMA transfer */ -static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; rt_uint32_t u32Offset = 0; diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c index 58e0ffc4db..c5943fd490 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uart.c @@ -85,7 +85,7 @@ static int nu_uart_receive(struct rt_serial_device *serial); static void nu_uart_isr(nu_uart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -624,7 +624,7 @@ static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events) /** * Uart DMA transfer */ -static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uart_t psNuUart = (nu_uart_t)serial; diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_ui2c.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_ui2c.c index 4f4d143784..a59446210c 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_ui2c.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_ui2c.c @@ -37,7 +37,7 @@ typedef struct nu_ui2c_bus } nu_ui2c_bus_t; /* Private functions ------------------------------------------------------------*/ -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *ui2c_dev, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *ui2c_dev, struct rt_i2c_msg msgs[], rt_uint32_t num); @@ -188,7 +188,7 @@ static rt_err_t nu_ui2c_send_address(nu_ui2c_bus_t *nu_ui2c, return RT_EOK; } -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_usbd.c index 9cbb7dba12..b672880c0a 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_usbd.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_usbd.c @@ -191,7 +191,7 @@ static rt_err_t _ep_disable(uep_t ep) return RT_EOK; } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; rt_uint8_t *buf; @@ -207,7 +207,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -216,7 +216,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c index a3296a9163..a402013754 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uspi.c @@ -78,7 +78,7 @@ static void nu_uspi_drain_rxfifo(USPI_T *uspi_base); static void nu_pdma_uspi_rx_cb(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_uspi_rx_config(struct nu_uspi *uspi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_uspi_tx_config(struct nu_uspi *uspi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); static rt_err_t nu_hw_uspi_pdma_allocate(struct nu_uspi *uspi_bus); #endif /* Public functions -------------------------------------------------------------*/ @@ -341,7 +341,7 @@ exit_nu_pdma_uspi_tx_config: /** * USPI PDMA transfer **/ -static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; rt_uint32_t u32Offset = 0; diff --git a/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c index 49f4750a5f..6277c8054d 100644 --- a/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m031/rtt_port/drv_uuart.c @@ -64,7 +64,7 @@ static int nu_uuart_receive(struct rt_serial_device *serial); static void nu_uuart_isr(nu_uuart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uuart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -406,7 +406,7 @@ static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events) /** * UUart DMA transfer */ -static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c index 30bffc49bf..d9faf7f137 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c @@ -78,7 +78,7 @@ static nu_i2c_bus_t nu_i2c2 = /* Private functions ------------------------------------------------------------*/ #if (defined(BSP_USING_I2C0) || defined(BSP_USING_I2C1) || defined(BSP_USING_I2C2)) -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -226,7 +226,7 @@ static rt_err_t nu_i2c_send_address(nu_i2c_bus_t *nu_i2c, return RT_EOK; } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c index 5028c1a267..35398a42ab 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.c @@ -69,7 +69,7 @@ static void nu_pdma_channel_disable(int i32ChannID); static void nu_pdma_channel_reset(int i32ChannID); static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us); static void nu_pdma_periph_ctrl_fill(int i32ChannID, int i32CtlPoolIdx); -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int count, nu_pdma_memctrl_t eMemCtl); +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int count, nu_pdma_memctrl_t eMemCtl); static void nu_pdma_memfun_cb(void *pvUserData, uint32_t u32Events); static void nu_pdma_memfun_actor_init(void); static int nu_pdma_memfun_employ(void); @@ -948,7 +948,7 @@ static int nu_pdma_memfun_employ(void) return idx; } -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) { nu_pdma_memfun_actor_t psMemFunActor = NULL; int idx; diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c index e2badc01b4..1e279f538e 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c @@ -53,8 +53,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) - static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -156,7 +156,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -168,7 +168,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c index 62b599c6af..fa1b36b09d 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c @@ -105,7 +105,7 @@ static void nu_sdh_isr(nu_sdh_t sdh); static rt_err_t nu_sdh_init(rt_device_t dev); static rt_err_t nu_sdh_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_sdh_close(rt_device_t dev); -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); static rt_err_t nu_sdh_control(rt_device_t dev, int cmd, void *args); static int rt_hw_sdh_init(void); @@ -234,7 +234,7 @@ static rt_err_t nu_sdh_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) { rt_uint32_t ret = 0; nu_sdh_t sdh = (nu_sdh_t)dev; @@ -296,7 +296,7 @@ exit_nu_sdh_read: return 0; } -static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) { rt_uint32_t ret = 0; nu_sdh_t sdh = (nu_sdh_t)dev; diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c index d9c17295b0..c298c2c9a6 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c @@ -102,7 +102,7 @@ static rt_err_t nu_slcd_close(struct rt_device *dev) return RT_EOK; } -static rt_size_t nu_slcd_write(struct rt_device *dev, +static rt_ssize_t nu_slcd_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c index fcbbf62935..2353effc5d 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.c @@ -64,7 +64,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, struct rt_spi static void nu_pdma_spi_rx_cb(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_spi_rx_config(struct nu_spi *spi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_spi_tx_config(struct nu_spi *spi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); #endif /* Public functions -------------------------------------------------------------*/ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int length, uint8_t bytes_per_word); @@ -360,7 +360,7 @@ exit_nu_pdma_spi_tx_config: /** * SPI PDMA transfer */ -static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; rt_uint32_t u32Offset = 0; diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c index fa2bd491f3..6c27efb396 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c @@ -79,7 +79,7 @@ static int nu_uart_receive(struct rt_serial_device *serial); static void nu_uart_isr(nu_uart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -579,7 +579,7 @@ static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events) /** * Uart DMA transfer */ -static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uart_t psNuUart = (nu_uart_t)serial; diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c index a2f2648f1a..db664bdddd 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c @@ -37,7 +37,7 @@ typedef struct nu_ui2c_bus } nu_ui2c_bus_t; /* Private functions ------------------------------------------------------------*/ -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *ui2c_dev, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *ui2c_dev, struct rt_i2c_msg msgs[], rt_uint32_t num); @@ -188,7 +188,7 @@ static rt_err_t nu_ui2c_send_address(nu_ui2c_bus_t *nu_ui2c, return RT_EOK; } -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbd.c index ce601c4253..bd4fb0092a 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbd.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbd.c @@ -229,7 +229,7 @@ static rt_err_t _ep_disable(uep_t ep) return RT_EOK; } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; rt_uint8_t *buf; @@ -245,7 +245,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -254,7 +254,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c index a49784dde1..4b86edae22 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c @@ -78,7 +78,7 @@ static void nu_uspi_drain_rxfifo(USPI_T *uspi_base); static void nu_pdma_uspi_rx_cb(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_uspi_rx_config(struct nu_uspi *uspi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_uspi_tx_config(struct nu_uspi *uspi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); static rt_err_t nu_hw_uspi_pdma_allocate(struct nu_uspi *uspi_bus); #endif /* Public functions -------------------------------------------------------------*/ @@ -341,7 +341,7 @@ exit_nu_pdma_uspi_tx_config: /** * USPI PDMA transfer **/ -static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; rt_uint32_t u32Offset = 0; diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c index 04019f3463..0317956b86 100644 --- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c @@ -64,7 +64,7 @@ static int nu_uuart_receive(struct rt_serial_device *serial); static void nu_uuart_isr(nu_uuart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uuart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -415,7 +415,7 @@ static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events) /** * UUart DMA transfer */ -static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_hsusbd.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_hsusbd.c index a242d21690..7fe61988c6 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_hsusbd.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_hsusbd.c @@ -404,7 +404,7 @@ __STATIC_INLINE void nu_buffer_cpy(rt_uint8_t address, void *buffer, rt_size_t s } } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; @@ -432,7 +432,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -464,7 +464,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_i2c.c index 9aeda3c3f7..c051fdfba1 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_i2c.c @@ -90,7 +90,7 @@ static struct nu_i2c_bus nu_i2c_arr [ ] = }; /* Private functions ------------------------------------------------------------*/ #if defined(BSP_USING_I2C) -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -238,7 +238,7 @@ static rt_err_t nu_i2c_send_address(nu_i2c_bus_t nu_i2c, return RT_EOK; } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c index 3ee2c2f85e..f0a931a9a4 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_pdma.c @@ -84,7 +84,7 @@ static void nu_pdma_channel_disable(int i32ChannID); static void nu_pdma_channel_reset(int i32ChannID); static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us); static void nu_pdma_periph_ctrl_fill(int i32ChannID, int i32CtlPoolIdx); -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl); +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl); static void nu_pdma_memfun_cb(void *pvUserData, uint32_t u32Events); static void nu_pdma_memfun_actor_init(void); static int nu_pdma_memfun_employ(void); @@ -1174,7 +1174,7 @@ static int nu_pdma_memfun_employ(void) return idx; } -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) { nu_pdma_memfun_actor_t psMemFunActor = NULL; struct nu_pdma_chn_cb sChnCB; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_rtc.c index 6cb129ad07..31d71a5b87 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_rtc.c @@ -53,8 +53,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) - static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -155,7 +155,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -167,7 +167,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_sdh.c index 55a1f404e6..897784e60d 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_sdh.c @@ -117,7 +117,7 @@ static void nu_sdh_isr(nu_sdh_t sdh); static rt_err_t nu_sdh_init(rt_device_t dev); static rt_err_t nu_sdh_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_sdh_close(rt_device_t dev); -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); static rt_err_t nu_sdh_control(rt_device_t dev, int cmd, void *args); static int rt_hw_sdh_init(void); @@ -272,7 +272,7 @@ static rt_err_t nu_sdh_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) { rt_uint32_t ret = 0; nu_sdh_t sdh = (nu_sdh_t)dev; @@ -334,7 +334,7 @@ exit_nu_sdh_read: return 0; } -static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) { rt_uint32_t ret = 0; nu_sdh_t sdh = (nu_sdh_t)dev; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c index 8c83869dc4..940578dd34 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_spi.c @@ -85,7 +85,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, struct rt_spi static void nu_pdma_spi_rx_cb_event(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_spi_rx_config(struct nu_spi *spi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_spi_tx_config(struct nu_spi *spi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); #endif /* Public functions -------------------------------------------------------------*/ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int length, uint8_t bytes_per_word); @@ -550,7 +550,7 @@ exit_nu_pdma_spi_tx_config: /** * SPI PDMA transfer */ -static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c index 426f0bf483..153e8abee6 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uart.c @@ -87,7 +87,7 @@ static int nu_uart_receive(struct rt_serial_device *serial); static void nu_uart_isr(nu_uart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -784,7 +784,7 @@ static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events) /** * Uart DMA transfer */ -static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uart_t psNuUart = (nu_uart_t)serial; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_ui2c.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_ui2c.c index d6fab24375..85783a53d3 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_ui2c.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_ui2c.c @@ -56,7 +56,7 @@ static struct nu_ui2c_bus nu_ui2c_arr [ ] = #endif }; /* Private functions ------------------------------------------------------------*/ -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); @@ -208,7 +208,7 @@ static rt_err_t nu_ui2c_send_address(nu_ui2c_bus_t nu_ui2c, return RT_EOK; } -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_usbd.c index 0011cacb22..afcd3b3fcf 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_usbd.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_usbd.c @@ -276,7 +276,7 @@ static rt_err_t _ep_disable(uep_t ep) return RT_EOK; } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; rt_uint8_t *buf; @@ -292,7 +292,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -301,7 +301,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c index 21a0402c06..36eaffeead 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uspi.c @@ -75,7 +75,7 @@ static void nu_uspi_drain_rxfifo(USPI_T *uspi_base); static void nu_pdma_uspi_rx_cb_event(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_uspi_rx_config(struct nu_uspi *uspi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_uspi_tx_config(struct nu_uspi *uspi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); static rt_err_t nu_hw_uspi_pdma_allocate(struct nu_uspi *uspi_bus); #endif /* Public functions -------------------------------------------------------------*/ @@ -362,7 +362,7 @@ exit_nu_pdma_uspi_tx_config: /** * USPI PDMA transfer **/ -static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c index 16dd5b2c8b..a0a138a019 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/drv_uuart.c @@ -63,7 +63,7 @@ static int nu_uuart_receive(struct rt_serial_device *serial); static void nu_uuart_isr(nu_uuart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uuart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -401,7 +401,7 @@ static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events) /** * UUart DMA transfer */ -static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uuart_t psNuUUart = (nu_uuart_t)serial; diff --git a/bsp/nuvoton/libraries/m460/rtt_port/emac/drv_emac.c b/bsp/nuvoton/libraries/m460/rtt_port/emac/drv_emac.c index 7d7465b1d0..1268cef74f 100644 --- a/bsp/nuvoton/libraries/m460/rtt_port/emac/drv_emac.c +++ b/bsp/nuvoton/libraries/m460/rtt_port/emac/drv_emac.c @@ -488,13 +488,13 @@ static rt_err_t nu_gmac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_gmac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_gmac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t nu_gmac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_gmac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c index 6168e3f94e..766b341e69 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c @@ -71,8 +71,8 @@ static rt_err_t nu_emac_init(rt_device_t dev); static rt_err_t nu_emac_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_emac_close(rt_device_t dev); -static rt_size_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); static rt_err_t nu_emac_control(rt_device_t dev, int cmd, void *args); static rt_err_t nu_emac_tx(rt_device_t dev, struct pbuf *p); static struct pbuf *nu_emac_rx(rt_device_t dev); @@ -281,13 +281,13 @@ static rt_err_t nu_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_hsusbd.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_hsusbd.c index 47329cc294..6b1b120c2e 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_hsusbd.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_hsusbd.c @@ -403,7 +403,7 @@ __STATIC_INLINE void nu_buffer_cpy(rt_uint8_t address, void *buffer, rt_size_t s } } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; @@ -431,7 +431,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -466,7 +466,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c index b7082d1ae4..bd060964ae 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c @@ -78,7 +78,7 @@ static nu_i2c_bus_t nu_i2c2 = /* Private functions ------------------------------------------------------------*/ #if (defined(BSP_USING_I2C0) || defined(BSP_USING_I2C1) || defined(BSP_USING_I2C2)) -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -226,7 +226,7 @@ static rt_err_t nu_i2c_send_address(nu_i2c_bus_t *nu_i2c, return RT_EOK; } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c index a0eaa3379e..8fb4cca738 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.c @@ -66,7 +66,7 @@ static void nu_pdma_channel_disable(int i32ChannID); static void nu_pdma_channel_reset(int i32ChannID); static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us); static void nu_pdma_periph_ctrl_fill(int i32ChannID, int i32CtlPoolIdx); -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int count, nu_pdma_memctrl_t eMemCtl); +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int count, nu_pdma_memctrl_t eMemCtl); static void nu_pdma_memfun_cb(void *pvUserData, uint32_t u32Events); static void nu_pdma_memfun_actor_init(void); static int nu_pdma_memfun_employ(void); @@ -940,7 +940,7 @@ static int nu_pdma_memfun_employ(void) return idx; } -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) { nu_pdma_memfun_actor_t psMemFunActor = NULL; int idx; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c index 49a0bc2a47..57046bd813 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c @@ -53,8 +53,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) - static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -155,7 +155,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -167,7 +167,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c index 55a1f404e6..897784e60d 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c @@ -117,7 +117,7 @@ static void nu_sdh_isr(nu_sdh_t sdh); static rt_err_t nu_sdh_init(rt_device_t dev); static rt_err_t nu_sdh_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_sdh_close(rt_device_t dev); -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); static rt_err_t nu_sdh_control(rt_device_t dev, int cmd, void *args); static int rt_hw_sdh_init(void); @@ -272,7 +272,7 @@ static rt_err_t nu_sdh_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) { rt_uint32_t ret = 0; nu_sdh_t sdh = (nu_sdh_t)dev; @@ -334,7 +334,7 @@ exit_nu_sdh_read: return 0; } -static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) { rt_uint32_t ret = 0; nu_sdh_t sdh = (nu_sdh_t)dev; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c index 7dfed36faf..246559393b 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.c @@ -64,7 +64,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, struct rt_spi static void nu_pdma_spi_rx_cb(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_spi_rx_config(struct nu_spi *spi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_spi_tx_config(struct nu_spi *spi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); #endif /* Public functions -------------------------------------------------------------*/ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int length, uint8_t bytes_per_word); @@ -360,7 +360,7 @@ exit_nu_pdma_spi_tx_config: /** * SPI PDMA transfer */ -static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; rt_uint32_t u32Offset = 0; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c index 609c30afeb..64b7f1dac0 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c @@ -85,7 +85,7 @@ static int nu_uart_receive(struct rt_serial_device *serial); static void nu_uart_isr(nu_uart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -656,7 +656,7 @@ static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events) /** * Uart DMA transfer */ -static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uart_t psNuUart = (nu_uart_t)serial; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c index 2c46f637a4..f5bc4b0e70 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c @@ -37,7 +37,7 @@ typedef struct nu_ui2c_bus } nu_ui2c_bus_t; /* Private functions ------------------------------------------------------------*/ -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *ui2c_dev, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *ui2c_dev, struct rt_i2c_msg msgs[], rt_uint32_t num); @@ -188,7 +188,7 @@ static rt_err_t nu_ui2c_send_address(nu_ui2c_bus_t *nu_ui2c, return RT_EOK; } -static rt_size_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_ui2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_usbd.c index 2df21ac8d4..728c336fc6 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_usbd.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_usbd.c @@ -210,7 +210,7 @@ static rt_err_t _ep_disable(uep_t ep) return RT_EOK; } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; rt_uint8_t *buf; @@ -226,7 +226,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -235,7 +235,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c index ee47936b03..21e133b3e4 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c @@ -78,7 +78,7 @@ static void nu_uspi_drain_rxfifo(USPI_T *uspi_base); static void nu_pdma_uspi_rx_cb(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_uspi_rx_config(struct nu_uspi *uspi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_uspi_tx_config(struct nu_uspi *uspi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); static rt_err_t nu_hw_uspi_pdma_allocate(struct nu_uspi *uspi_bus); #endif /* Public functions -------------------------------------------------------------*/ @@ -341,7 +341,7 @@ exit_nu_pdma_uspi_tx_config: /** * USPI PDMA transfer **/ -static rt_size_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_uspi_pdma_transmit(struct nu_uspi *uspi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; rt_uint32_t u32Offset = 0; diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c index 1cd9e5a717..925b86ffad 100644 --- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c +++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c @@ -64,7 +64,7 @@ static int nu_uuart_receive(struct rt_serial_device *serial); static void nu_uuart_isr(nu_uuart_t serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uuart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -415,7 +415,7 @@ static void nu_pdma_uuart_tx_cb(void *pvOwner, uint32_t u32Events) /** * UUart DMA transfer */ -static rt_size_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uuart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_i2c.c index c4f9781681..e6fdb4675a 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_i2c.c @@ -99,7 +99,7 @@ static nu_i2c_bus_t nu_i2c_arr [ ] = /* Private functions ------------------------------------------------------------*/ #if defined(BSP_USING_I2C) -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -247,7 +247,7 @@ static rt_err_t nu_i2c_send_address(nu_i2c_bus_t *nu_i2c, return RT_EOK; } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c index a46cf355bf..2304107cd3 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_pdma.c @@ -100,7 +100,7 @@ static void nu_pdma_channel_disable(int i32ChannID); static void nu_pdma_channel_reset(int i32ChannID); static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us); static void nu_pdma_periph_ctrl_fill(int i32ChannID, int i32CtlPoolIdx); -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl); +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl); static void nu_pdma_memfun_cb(void *pvUserData, uint32_t u32Events); static void nu_pdma_memfun_actor_init(void); static int nu_pdma_memfun_employ(void); @@ -1175,7 +1175,7 @@ static int nu_pdma_memfun_employ(void) return idx; } -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) { nu_pdma_memfun_actor_t psMemFunActor = NULL; struct nu_pdma_chn_cb sChnCB; diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_rtc.c index e960ae63b2..31aeed0ed3 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_rtc.c @@ -55,8 +55,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) - static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -169,7 +169,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -181,7 +181,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c index e8d2a69c9d..92482cc657 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_spi.c @@ -64,7 +64,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, struct rt_spi static void nu_pdma_spi_rx_cb_event(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_spi_rx_config(struct nu_spi *spi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_spi_tx_config(struct nu_spi *spi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); #endif /* Public functions -------------------------------------------------------------*/ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int length, uint8_t bytes_per_word); @@ -393,7 +393,7 @@ exit_nu_pdma_spi_tx_config: /** * SPI PDMA transfer */ -static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c index 9d10050a24..8c388b09ac 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_uart.c @@ -130,7 +130,7 @@ static int nu_uart_send(struct rt_serial_device *serial, char c); static int nu_uart_receive(struct rt_serial_device *serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events); static uint32_t nu_uart_flush(nu_uart_t psNuUart, uint32_t pdma_new_rxsize); @@ -953,7 +953,7 @@ static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events) /** * Uart DMA transfer */ -static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uart_t psNuUart = (nu_uart_t)serial; diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/drv_whc.c b/bsp/nuvoton/libraries/ma35/rtt_port/drv_whc.c index b8b5899f8e..0e0baeb602 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/drv_whc.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/drv_whc.c @@ -162,7 +162,7 @@ rt_err_t nu_whc_close(rt_device_t dev) return RT_EOK; } -rt_size_t nu_whc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +rt_ssize_t nu_whc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { nu_whc_t psWhc = (nu_whc_t)dev; nu_whc_priv_t psWhcPriv = psWhc->psPriv; @@ -180,7 +180,7 @@ exit_nu_whc_read: return 0; } -rt_size_t nu_whc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +rt_ssize_t nu_whc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { nu_whc_t psWhc = (nu_whc_t)dev; nu_whc_priv_t psWhcPriv = psWhc->psPriv; diff --git a/bsp/nuvoton/libraries/ma35/rtt_port/gmac/drv_gmac.c b/bsp/nuvoton/libraries/ma35/rtt_port/gmac/drv_gmac.c index 9a7ee9ed8a..0670a8a33b 100644 --- a/bsp/nuvoton/libraries/ma35/rtt_port/gmac/drv_gmac.c +++ b/bsp/nuvoton/libraries/ma35/rtt_port/gmac/drv_gmac.c @@ -515,13 +515,13 @@ static rt_err_t nu_gmac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_gmac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_gmac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t nu_gmac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_gmac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_emac.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_emac.c index f208bb87c7..8280c81bc1 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_emac.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_emac.c @@ -81,8 +81,8 @@ static rt_err_t nu_emac_init(rt_device_t dev); static rt_err_t nu_emac_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_emac_close(rt_device_t dev); -static rt_size_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); static rt_err_t nu_emac_control(rt_device_t dev, int cmd, void *args); static rt_err_t nu_emac_tx(rt_device_t dev, struct pbuf *p); static struct pbuf *nu_emac_rx(rt_device_t dev); @@ -350,13 +350,13 @@ static rt_err_t nu_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c index 987f8b3fd5..9196a6f550 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_i2c.c @@ -459,7 +459,7 @@ static int32_t nu_i2c_ioctl(nu_i2c_dev_t psNuI2cDev, uint32_t cmd, uint32_t arg0 return (0); } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_rtc.c index dde3b75ebf..35cb9aae83 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_rtc.c @@ -54,8 +54,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) - static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -174,7 +174,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -186,7 +186,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c index 2ead28d452..1cbfbfb3ba 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_sdh.c @@ -131,7 +131,7 @@ typedef struct nu_sdh *nu_sdh_t; static rt_err_t nu_sdh_init(rt_device_t dev); static rt_err_t nu_sdh_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_sdh_close(rt_device_t dev); -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); static rt_err_t nu_sdh_control(rt_device_t dev, int cmd, void *args); static int rt_hw_sdh_init(void); @@ -344,7 +344,7 @@ static rt_err_t nu_sdh_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) { rt_err_t result = RT_ERROR; rt_uint32_t ret = 0; @@ -426,7 +426,7 @@ exit_nu_sdh_read: return 0; } -static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) { rt_err_t result = RT_ERROR; rt_uint32_t ret = 0; diff --git a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbd.c index 876c6d96c2..870e9bb9f0 100644 --- a/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbd.c +++ b/bsp/nuvoton/libraries/n9h30/rtt_port/drv_usbd.c @@ -436,7 +436,7 @@ __STATIC_INLINE void nu_buffer_cpy(rt_uint8_t address, void *buffer, rt_size_t s } } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; @@ -464,7 +464,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -496,7 +496,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/nuvoton/libraries/nu_packages/ADC_TOUCH/adc_touch.c b/bsp/nuvoton/libraries/nu_packages/ADC_TOUCH/adc_touch.c index 5d9951e968..6a687144ca 100644 --- a/bsp/nuvoton/libraries/nu_packages/ADC_TOUCH/adc_touch.c +++ b/bsp/nuvoton/libraries/nu_packages/ADC_TOUCH/adc_touch.c @@ -162,7 +162,7 @@ static void nu_adc_touch_cal(int32_t *sumx, int32_t *sumy) g_sCalMat.e * ytemp) / g_sCalMat.div; } -static rt_size_t nu_adc_touch_readpoint(struct rt_touch_device *device, void *buf, rt_size_t read_num) +static rt_ssize_t nu_adc_touch_readpoint(struct rt_touch_device *device, void *buf, rt_size_t read_num) { static uint32_t last_report_x = 0, last_report_y = 0; struct rt_touch_data *pPoint = (struct rt_touch_data *)buf; diff --git a/bsp/nuvoton/libraries/nu_packages/ILI_TPC/ili.c b/bsp/nuvoton/libraries/nu_packages/ILI_TPC/ili.c index 434f07bad5..e8b48bf2e6 100644 --- a/bsp/nuvoton/libraries/nu_packages/ILI_TPC/ili.c +++ b/bsp/nuvoton/libraries/nu_packages/ILI_TPC/ili.c @@ -381,7 +381,7 @@ static void ili_touch_down(void *buf, int8_t id, int16_t x, int16_t y, int16_t w pre_w[id] = w; } -static rt_size_t ili_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t ili_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) diff --git a/bsp/nuvoton/libraries/nu_packages/TPC/ft5446.c b/bsp/nuvoton/libraries/nu_packages/TPC/ft5446.c index e65e412a74..82a760dcb7 100644 --- a/bsp/nuvoton/libraries/nu_packages/TPC/ft5446.c +++ b/bsp/nuvoton/libraries/nu_packages/TPC/ft5446.c @@ -132,7 +132,7 @@ static int8_t pre_id[FT_MAX_TOUCH]; static S_FT_REGMAP sFtRegMap; static rt_uint8_t pre_touch = 0; -static rt_size_t ft5446_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t ft5446_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { int i; diff --git a/bsp/nuvoton/libraries/nu_packages/TPC/gt911.c b/bsp/nuvoton/libraries/nu_packages/TPC/gt911.c index 4958d1713a..e3afd090da 100644 --- a/bsp/nuvoton/libraries/nu_packages/TPC/gt911.c +++ b/bsp/nuvoton/libraries/nu_packages/TPC/gt911.c @@ -200,7 +200,7 @@ static void gt911_touch_down(void *buf, rt_int8_t id, rt_int16_t x, rt_int16_t y static rt_int8_t pre_id[GT911_MAX_TOUCH]; static rt_uint8_t pre_touch = 0; -static rt_size_t gt911_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t gt911_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { rt_uint8_t point_status = 0; rt_uint8_t touch_num = 0; diff --git a/bsp/nuvoton/libraries/nu_packages/TPC/ili.c b/bsp/nuvoton/libraries/nu_packages/TPC/ili.c index af2d0ca12c..71d444212a 100644 --- a/bsp/nuvoton/libraries/nu_packages/TPC/ili.c +++ b/bsp/nuvoton/libraries/nu_packages/TPC/ili.c @@ -383,7 +383,7 @@ static void ili_touch_down(void *buf, int8_t id, int16_t x, int16_t y, int16_t w static int8_t pre_id[ILI_MAX_TOUCH]; static rt_uint8_t pre_touch = 0; -static rt_size_t ili_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t ili_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) diff --git a/bsp/nuvoton/libraries/nu_packages/TPC/st1663i.c b/bsp/nuvoton/libraries/nu_packages/TPC/st1663i.c index a2349e8f52..33f999b5de 100644 --- a/bsp/nuvoton/libraries/nu_packages/TPC/st1663i.c +++ b/bsp/nuvoton/libraries/nu_packages/TPC/st1663i.c @@ -132,7 +132,7 @@ static int8_t pre_id[ST_MAX_TOUCH]; static S_ST_REGMAP sStRegMap; static rt_uint8_t pre_touch = 0; -static rt_size_t st1663i_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t st1663i_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { int i; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c index b18a84d225..da322fa8cb 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c @@ -93,8 +93,8 @@ static rt_err_t nu_emac_init(rt_device_t dev); static rt_err_t nu_emac_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_emac_close(rt_device_t dev); -static rt_size_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); static rt_err_t nu_emac_control(rt_device_t dev, int cmd, void *args); static rt_err_t nu_emac_tx(rt_device_t dev, struct pbuf *p); static struct pbuf *nu_emac_rx(rt_device_t dev); @@ -372,13 +372,13 @@ static rt_err_t nu_emac_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_emac_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_emac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c index 89e80b662f..79249bedfc 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c @@ -97,7 +97,7 @@ static nu_i2c_bus_t nu_i2c_arr [ ] = /* Private functions ------------------------------------------------------------*/ #if defined(BSP_USING_I2C) -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t nu_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -245,7 +245,7 @@ static rt_err_t nu_i2c_send_address(nu_i2c_bus_t *nu_i2c, return RT_EOK; } -static rt_size_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t nu_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c index 6452752b1a..4468a6744b 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.c @@ -75,7 +75,7 @@ static void nu_pdma_channel_disable(int i32ChannID); static void nu_pdma_channel_reset(int i32ChannID); static rt_err_t nu_pdma_timeout_set(int i32ChannID, int i32Timeout_us); static void nu_pdma_periph_ctrl_fill(int i32ChannID, int i32CtlPoolIdx); -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl); +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl); static void nu_pdma_memfun_cb(void *pvUserData, uint32_t u32Events); static void nu_pdma_memfun_actor_init(void); static int nu_pdma_memfun_employ(void); @@ -1028,7 +1028,7 @@ static int nu_pdma_memfun_employ(void) return idx; } -static rt_size_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) +static rt_ssize_t nu_pdma_memfun(void *dest, void *src, uint32_t u32DataWidth, unsigned int u32TransferCnt, nu_pdma_memctrl_t eMemCtl) { nu_pdma_memfun_actor_t psMemFunActor = NULL; struct nu_pdma_chn_cb sChnCB; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c index fc0a2dc7bb..326cdffaf4 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c @@ -54,8 +54,8 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args); #if defined (NU_RTC_SUPPORT_IO_RW) - static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); #endif static rt_err_t nu_rtc_is_date_valid(const time_t t); @@ -156,7 +156,7 @@ INIT_BOARD_EXPORT(rt_hw_rtc_init); #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.read() entry. */ -static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); @@ -168,7 +168,7 @@ static rt_size_t nu_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz #if defined (NU_RTC_SUPPORT_IO_RW) /* Register rt-thread device.write() entry. */ -static rt_size_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t nu_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { (void) pos; nu_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c index bc3b23fd0d..6e6aeca4d5 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c @@ -117,7 +117,7 @@ typedef struct nu_sdh *nu_sdh_t; static rt_err_t nu_sdh_init(rt_device_t dev); static rt_err_t nu_sdh_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t nu_sdh_close(rt_device_t dev); -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb); static rt_err_t nu_sdh_control(rt_device_t dev, int cmd, void *args); static int rt_hw_sdh_init(void); @@ -251,7 +251,7 @@ static rt_err_t nu_sdh_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t blk_nb) { rt_err_t result = RT_ERROR; rt_uint32_t ret = 0; @@ -317,7 +317,7 @@ exit_nu_sdh_read: return 0; } -static rt_size_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) +static rt_ssize_t nu_sdh_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t blk_nb) { rt_err_t result = RT_ERROR; rt_uint32_t ret = 0; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c index e4d69798a3..6f4dd0e2fb 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.c @@ -63,7 +63,7 @@ static rt_err_t nu_spi_bus_configure(struct rt_spi_device *device, struct rt_spi static void nu_pdma_spi_rx_cb_event(void *pvUserData, uint32_t u32EventFilter); static rt_err_t nu_pdma_spi_rx_config(struct nu_spi *spi_bus, uint8_t *pu8Buf, int32_t i32RcvLen, uint8_t bytes_per_word); static rt_err_t nu_pdma_spi_tx_config(struct nu_spi *spi_bus, const uint8_t *pu8Buf, int32_t i32SndLen, uint8_t bytes_per_word); - static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); + static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word); #endif /* Public functions -------------------------------------------------------------*/ void nu_spi_transfer(struct nu_spi *spi_bus, uint8_t *tx, uint8_t *rx, int length, uint8_t bytes_per_word); @@ -363,7 +363,7 @@ exit_nu_pdma_spi_tx_config: /** * SPI PDMA transfer */ -static rt_size_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) +static rt_ssize_t nu_spi_pdma_transmit(struct nu_spi *spi_bus, const uint8_t *send_addr, uint8_t *recv_addr, int length, uint8_t bytes_per_word) { rt_err_t result = RT_EOK; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c index b6677ab453..afb1c75f7c 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c @@ -95,7 +95,7 @@ static int nu_uart_send(struct rt_serial_device *serial, char c); static int nu_uart_receive(struct rt_serial_device *serial); #if defined(RT_SERIAL_USING_DMA) - static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void nu_pdma_uart_rx_cb(void *pvOwner, uint32_t u32Events); static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events); #endif @@ -673,7 +673,7 @@ static void nu_pdma_uart_tx_cb(void *pvOwner, uint32_t u32Events) /** * Uart DMA transfer */ -static rt_size_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t nu_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { rt_err_t result = RT_EOK; nu_uart_t psNuUart = (nu_uart_t)serial; diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c index ae563d1a1e..d12fac21fa 100644 --- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c +++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c @@ -437,7 +437,7 @@ __STATIC_INLINE void nu_buffer_cpy(rt_uint8_t address, void *buffer, rt_size_t s } } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; @@ -465,7 +465,7 @@ static rt_size_t _ep_read(rt_uint8_t address, void *buffer) return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT(!(address & USB_DIR_IN)); @@ -497,7 +497,7 @@ static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { RT_ASSERT((address & USB_DIR_IN)); diff --git a/bsp/pic32ethernet/uart.c b/bsp/pic32ethernet/uart.c index 05337aa5eb..1980426a74 100644 --- a/bsp/pic32ethernet/uart.c +++ b/bsp/pic32ethernet/uart.c @@ -56,7 +56,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_uart_pic32 *uart_device = (struct rt_uart_pic32*)dev; @@ -103,7 +103,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct rt_uart_pic32 *uart_device = (struct rt_uart_pic32*)dev; char *ptr; diff --git a/bsp/qemu-vexpress-a9/drivers/audio/drv_sound.c b/bsp/qemu-vexpress-a9/drivers/audio/drv_sound.c index 226a2cdb51..59661d0ca8 100644 --- a/bsp/qemu-vexpress-a9/drivers/audio/drv_sound.c +++ b/bsp/qemu-vexpress-a9/drivers/audio/drv_sound.c @@ -290,7 +290,7 @@ static void sound_buffer_info(struct rt_audio_device *audio, struct rt_audio_buf info->block_count = 2; } -static rt_size_t sound_transmit(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size) +static rt_ssize_t sound_transmit(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size) { RT_ASSERT(audio != RT_NULL); diff --git a/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c b/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c index d33533a10b..2b26429dcf 100644 --- a/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c +++ b/bsp/qemu-virt64-aarch64/drivers/drv_rtc.c @@ -78,13 +78,13 @@ static rt_err_t pl031_rtc_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t pl031_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t pl031_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { pl031_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); return size; } -static rt_size_t pl031_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t pl031_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { pl031_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); return size; diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c b/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c index c7867969a1..3cf4cd2402 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_i2c.c @@ -103,10 +103,10 @@ struct raspi_i2c_hw_config #if (defined(BSP_USING_I2C0) || defined(BSP_USING_I2C1)) -static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); -static rt_size_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t raspi_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -114,7 +114,7 @@ static rt_err_t raspi_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t); static rt_uint32_t i2c_byte_wait_us = 0; -static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -141,7 +141,7 @@ static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, return (reason == 0)? i : 0; } -static rt_size_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c index 139f6f3abd..0b465b5763 100644 --- a/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c +++ b/bsp/raspberry-pi/raspi3-32/driver/drv_rtc.c @@ -249,13 +249,13 @@ static rt_err_t raspi_rtc_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t raspi_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t raspi_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { raspi_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); return size; } -static rt_size_t raspi_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t raspi_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { raspi_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); return size; diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c b/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c index 1f19a3bc2a..07ea8087e6 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_i2c.c @@ -108,10 +108,10 @@ struct raspi_i2c_hw_config #if (defined(BSP_USING_I2C0) || defined(BSP_USING_I2C1)) -static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); -static rt_size_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t raspi_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -119,7 +119,7 @@ static rt_err_t raspi_i2c_bus_control(struct rt_i2c_bus_device *bus, rt_uint32_t); static rt_uint32_t i2c_byte_wait_us = 0; -static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -146,7 +146,7 @@ static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, return (reason == 0)? i : 0; } -static rt_size_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c index 55848c22bc..d772614971 100644 --- a/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c +++ b/bsp/raspberry-pi/raspi3-64/driver/drv_rtc.c @@ -93,13 +93,13 @@ static rt_err_t raspi_rtc_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t raspi_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t raspi_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { raspi_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); return size; } -static rt_size_t raspi_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t raspi_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { raspi_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); return size; diff --git a/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c b/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c index 3a7503a04d..0a9b93b99f 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c +++ b/bsp/raspberry-pi/raspi4-32/driver/drv_i2c.c @@ -131,7 +131,7 @@ rt_uint8_t i2c_read_or_write(volatile rt_uint32_t base, rt_uint8_t* buf, rt_uint return reason; } -static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -154,7 +154,7 @@ static rt_size_t raspi_i2c_mst_xfer(struct rt_i2c_bus_device *bus, return (reason == 0)? i : 0; } -static rt_size_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t raspi_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c index 3f9dbb83ad..66e10f867b 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c +++ b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_dsi_touch.c @@ -77,7 +77,7 @@ static void dsi_touch_thread_entry(void *param) } } -static rt_size_t dsi_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t dsi_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { rt_uint16_t* touchxy = (rt_uint16_t *)buf; if((read_num != 0) && (touch_state == 1)) diff --git a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c index 5911b5b6e3..84d72c0242 100644 --- a/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c +++ b/bsp/raspberry-pi/raspi4-32/driver/touch/drv_xpt2046.c @@ -191,7 +191,7 @@ static void touch_readly(void *args) } } -static rt_size_t xpt2046_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) +static rt_ssize_t xpt2046_read_point(struct rt_touch_device *touch, void *buf, rt_size_t read_num) { rt_uint16_t* touchxy = (rt_uint16_t *)buf; if((read_num != 0) && (touch_flag == 1)) diff --git a/bsp/renesas/libraries/HAL_Drivers/drv_i2c.c b/bsp/renesas/libraries/HAL_Drivers/drv_i2c.c index 375083c6f3..585f6d04ad 100644 --- a/bsp/renesas/libraries/HAL_Drivers/drv_i2c.c +++ b/bsp/renesas/libraries/HAL_Drivers/drv_i2c.c @@ -69,7 +69,7 @@ static fsp_err_t validate_i2c_event(void) return FSP_ERR_TRANSFER_ABORTED; } -static rt_size_t ra_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t ra_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/renesas/libraries/HAL_Drivers/drv_usart_v2.c b/bsp/renesas/libraries/HAL_Drivers/drv_usart_v2.c index 63e7716985..e36cf90491 100644 --- a/bsp/renesas/libraries/HAL_Drivers/drv_usart_v2.c +++ b/bsp/renesas/libraries/HAL_Drivers/drv_usart_v2.c @@ -244,7 +244,7 @@ static int ra_uart_getc(struct rt_serial_device *serial) return RT_EOK; } -static rt_size_t ra_uart_transmit(struct rt_serial_device *serial, +static rt_ssize_t ra_uart_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) diff --git a/bsp/rv32m1_vega/ri5cy/driver/drv_sdcard.c b/bsp/rv32m1_vega/ri5cy/driver/drv_sdcard.c index dda334ad18..f8217cb796 100644 --- a/bsp/rv32m1_vega/ri5cy/driver/drv_sdcard.c +++ b/bsp/rv32m1_vega/ri5cy/driver/drv_sdcard.c @@ -35,7 +35,7 @@ static rt_err_t vega_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t vega_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t vega_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { status_t status; @@ -47,7 +47,7 @@ static rt_size_t vega_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, r return 0; } -static rt_size_t vega_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t vega_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { status_t status; diff --git a/bsp/rv32m1_vega/ri5cy/driver/drv_uart.c b/bsp/rv32m1_vega/ri5cy/driver/drv_uart.c index 9375c3547e..db526556e0 100644 --- a/bsp/rv32m1_vega/ri5cy/driver/drv_uart.c +++ b/bsp/rv32m1_vega/ri5cy/driver/drv_uart.c @@ -31,7 +31,7 @@ static rt_err_t uart_configure(struct rt_serial_device *serial, struct serial_c static rt_err_t uart_control(struct rt_serial_device *serial, int cmd, void *arg); static int uart_putc(struct rt_serial_device *serial, char c); static int uart_getc(struct rt_serial_device *serial); -static rt_size_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); +static rt_ssize_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); static void uart_irq_handler(int irqno, void *param); @@ -228,7 +228,7 @@ static int uart_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return (0); } diff --git a/bsp/sam7x/drivers/sd.c b/bsp/sam7x/drivers/sd.c index f024f017ab..2b5cec0d32 100644 --- a/bsp/sam7x/drivers/sd.c +++ b/bsp/sam7x/drivers/sd.c @@ -451,7 +451,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t count; @@ -500,7 +500,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return size / 512; } -static rt_size_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t count; diff --git a/bsp/sam7x/drivers/serial.c b/bsp/sam7x/drivers/serial.c index 48fe49fed8..896e00ac22 100644 --- a/bsp/sam7x/drivers/serial.c +++ b/bsp/sam7x/drivers/serial.c @@ -218,7 +218,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_at91serial *serial = (struct rt_at91serial*)dev; @@ -287,7 +287,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return 0; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_at91serial *serial = (struct rt_at91serial*)dev; diff --git a/bsp/simulator/drivers/dfs_win32.c b/bsp/simulator/drivers/dfs_win32.c index 5edb2b211c..6d144fe6e5 100644 --- a/bsp/simulator/drivers/dfs_win32.c +++ b/bsp/simulator/drivers/dfs_win32.c @@ -537,7 +537,7 @@ static rt_err_t nop_close(rt_device_t dev) return RT_EOK; } -static rt_size_t nop_read(rt_device_t dev, +static rt_ssize_t nop_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -545,7 +545,7 @@ static rt_size_t nop_read(rt_device_t dev, return size; } -static rt_size_t nop_write(rt_device_t dev, +static rt_ssize_t nop_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/bsp/simulator/drivers/sd_sim.c b/bsp/simulator/drivers/sd_sim.c index 86ed57aea8..6079f23e3c 100755 --- a/bsp/simulator/drivers/sd_sim.c +++ b/bsp/simulator/drivers/sd_sim.c @@ -52,7 +52,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) * buffer: * size : how many blocks */ -static rt_size_t rt_sdcard_read(rt_device_t device, rt_off_t position, void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t device, rt_off_t position, void *buffer, rt_size_t size) { struct sdcard_device *sd; int result = 0; @@ -80,7 +80,7 @@ _err: * buffer: * size : how many blocks */ -static rt_size_t rt_sdcard_write(rt_device_t device, rt_off_t position, const void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write(rt_device_t device, rt_off_t position, const void *buffer, rt_size_t size) { struct sdcard_device *sd; int result = 0; diff --git a/bsp/simulator/pcap/pcap_netif.c b/bsp/simulator/pcap/pcap_netif.c index 0aef477185..0ac00e4b1e 100644 --- a/bsp/simulator/pcap/pcap_netif.c +++ b/bsp/simulator/pcap/pcap_netif.c @@ -160,13 +160,13 @@ static rt_err_t pcap_netif_close(rt_device_t dev) return RT_EOK; } -static rt_size_t pcap_netif_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t pcap_netif_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t pcap_netif_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t pcap_netif_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_eth.c b/bsp/stm32/libraries/HAL_Drivers/drv_eth.c index 3dcfe389a1..b6f71fae8c 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_eth.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_eth.c @@ -152,14 +152,14 @@ static rt_err_t rt_stm32_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("emac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("emac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_nand.c b/bsp/stm32/libraries/HAL_Drivers/drv_nand.c index 3cb293a932..66280e9496 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_nand.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_nand.c @@ -120,7 +120,7 @@ rt_err_t rt_nand_control(rt_device_t dev, int cmd, void *args) } /*pos: sector offset size: page count*/ -rt_size_t rt_nand_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +rt_ssize_t rt_nand_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { uint32_t page_cnt = size; NAND_AddressTypeDef ReadAddr; @@ -131,7 +131,7 @@ rt_size_t rt_nand_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t si return RT_EOK; } -rt_size_t rt_nand_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +rt_ssize_t rt_nand_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { uint32_t page_cnt = size; NAND_AddressTypeDef WriteAddr; diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_usart.c b/bsp/stm32/libraries/HAL_Drivers/drv_usart.c index cb023a7e03..6569872ef8 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_usart.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_usart.c @@ -341,7 +341,7 @@ static int stm32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t stm32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t stm32_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { struct stm32_uart *uart; RT_ASSERT(serial != RT_NULL); diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c b/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c index 2225d02572..486a338545 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c @@ -369,7 +369,7 @@ static int stm32_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t stm32_transmit(struct rt_serial_device *serial, +static rt_ssize_t stm32_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, rt_uint32_t tx_flag) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_usbd.c b/bsp/stm32/libraries/HAL_Drivers/drv_usbd.c index bf577aa943..6acfad2099 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_usbd.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_usbd.c @@ -166,20 +166,20 @@ static rt_err_t _ep_disable(uep_t ep) return RT_EOK; } -static rt_size_t _ep_read(rt_uint8_t address, void *buffer) +static rt_ssize_t _ep_read(rt_uint8_t address, void *buffer) { rt_size_t size = 0; RT_ASSERT(buffer != RT_NULL); return size; } -static rt_size_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_read_prepare(rt_uint8_t address, void *buffer, rt_size_t size) { HAL_PCD_EP_Receive(&_stm_pcd, address, buffer, size); return size; } -static rt_size_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t _ep_write(rt_uint8_t address, void *buffer, rt_size_t size) { HAL_PCD_EP_Transmit(&_stm_pcd, address, buffer, size); return size; diff --git a/bsp/stm32/stm32f407-atk-explorer/board/ports/touch/drv_touch_xpt.c b/bsp/stm32/stm32f407-atk-explorer/board/ports/touch/drv_touch_xpt.c index ee33ee4873..204f393038 100644 --- a/bsp/stm32/stm32f407-atk-explorer/board/ports/touch/drv_touch_xpt.c +++ b/bsp/stm32/stm32f407-atk-explorer/board/ports/touch/drv_touch_xpt.c @@ -151,7 +151,7 @@ rt_err_t xpt2046_calibration(const char *lcd_name,const char *touch_name) return RT_EOK; } -static rt_size_t xpt2046_touch_readpoint(struct rt_touch_device *touch, void *buf, rt_size_t touch_num) +static rt_ssize_t xpt2046_touch_readpoint(struct rt_touch_device *touch, void *buf, rt_size_t touch_num) { if (touch_num != 0) { diff --git a/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_dcmi.c b/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_dcmi.c index cc170ff945..f4d31a43df 100644 --- a/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_dcmi.c +++ b/bsp/stm32/stm32h743-atk-apollo/board/ports/drv_dcmi.c @@ -187,14 +187,14 @@ static rt_err_t rt_dcmi_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_dcmi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_dcmi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); return RT_EOK; } -static rt_size_t rt_dcmi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_dcmi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); diff --git a/bsp/stm32/stm32h743-openmv-h7plus/board/ports/drv_dcmi.c b/bsp/stm32/stm32h743-openmv-h7plus/board/ports/drv_dcmi.c index 5a115326de..1c8a328f1f 100644 --- a/bsp/stm32/stm32h743-openmv-h7plus/board/ports/drv_dcmi.c +++ b/bsp/stm32/stm32h743-openmv-h7plus/board/ports/drv_dcmi.c @@ -166,14 +166,14 @@ static rt_err_t rt_dcmi_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_dcmi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_dcmi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); return RT_EOK; } -static rt_size_t rt_dcmi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_dcmi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); diff --git a/bsp/stm32/stm32h750-artpi/board/port/drv_eth.c b/bsp/stm32/stm32h750-artpi/board/port/drv_eth.c index 8abe9ad0b3..3029aaaa4a 100644 --- a/bsp/stm32/stm32h750-artpi/board/port/drv_eth.c +++ b/bsp/stm32/stm32h750-artpi/board/port/drv_eth.c @@ -234,14 +234,14 @@ static rt_err_t rt_stm32_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("emac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("emac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/stm32/stm32mp157a-st-discovery/board/ports/OpenAMP/drv_openamp.c b/bsp/stm32/stm32mp157a-st-discovery/board/ports/OpenAMP/drv_openamp.c index 1d5cc5c455..9997206f01 100644 --- a/bsp/stm32/stm32mp157a-st-discovery/board/ports/OpenAMP/drv_openamp.c +++ b/bsp/stm32/stm32mp157a-st-discovery/board/ports/OpenAMP/drv_openamp.c @@ -115,7 +115,7 @@ static rt_err_t _init(struct rt_device *dev) return RT_EOK; } -static rt_size_t _read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_size_t count, rbsize, offset; rt_uint8_t *buf = RT_NULL; @@ -162,7 +162,7 @@ static rt_size_t _read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_siz return count; } -static rt_size_t _write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_err_t result = VIRT_UART_OK; diff --git a/bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c b/bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c index 9818aca2e6..5702af3ad2 100644 --- a/bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c +++ b/bsp/stm32/stm32mp157a-st-discovery/board/ports/drv_eth.c @@ -504,14 +504,14 @@ static rt_err_t rt_stm32_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("emac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("emac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/OpenAMP/drv_openamp.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/OpenAMP/drv_openamp.c index 216a181e97..6f185bd8ac 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/OpenAMP/drv_openamp.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/OpenAMP/drv_openamp.c @@ -115,7 +115,7 @@ static rt_err_t _init(struct rt_device *dev) return RT_EOK; } -static rt_size_t _read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_size_t count, rbsize, offset; rt_uint8_t *buf = RT_NULL; @@ -162,7 +162,7 @@ static rt_size_t _read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_siz return count; } -static rt_size_t _write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_err_t result = VIRT_UART_OK; diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dcmi.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dcmi.c index 1accaced7c..c8ff829455 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dcmi.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dcmi.c @@ -167,14 +167,14 @@ static rt_err_t rt_dcmi_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_dcmi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_dcmi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); return RT_EOK; } -static rt_size_t rt_dcmi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_dcmi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dfsdm.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dfsdm.c index 990537241e..d85a6ac22d 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dfsdm.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_dfsdm.c @@ -246,7 +246,7 @@ static rt_err_t _close(rt_device_t dev) return RT_EOK; } -static rt_size_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); rt_uint32_t i = 0; @@ -273,7 +273,7 @@ static rt_size_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t si return size; } -static rt_size_t _write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_fdcan.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_fdcan.c index 494d8e399f..a070593536 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_fdcan.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_fdcan.c @@ -124,7 +124,7 @@ static rt_err_t rt_fdcan_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_fdcan_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_fdcan_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); struct stm32_fdcan *device = (struct stm32_fdcan *)dev; @@ -155,7 +155,7 @@ static rt_size_t rt_fdcan_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_s return 0; } -static rt_size_t rt_fdcan_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_fdcan_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); struct stm32_fdcan *device = (struct stm32_fdcan *)dev; diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sdcard.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sdcard.c index b8f524e59a..145dd200fe 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sdcard.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_sdcard.c @@ -203,7 +203,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) * @retval DRESULT: Operation result */ -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t sector, void *buffer, rt_size_t count) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t sector, void *buffer, rt_size_t count) { RT_ASSERT(dev != RT_NULL); struct stm32_sd *sd = (struct stm32_sd *)dev; @@ -269,7 +269,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t sector, void *buffer, * @param count Number of SD blocks to write * @retval BSP status */ -static rt_size_t rt_sdcard_write(rt_device_t dev, rt_off_t sector, const void *buffer, rt_size_t count) +static rt_ssize_t rt_sdcard_write(rt_device_t dev, rt_off_t sector, const void *buffer, rt_size_t count) { RT_ASSERT(dev != RT_NULL); struct stm32_sd *sd = (struct stm32_sd *)dev; diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_spdifrx.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_spdifrx.c index 7d0e665f64..06dfa1af24 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_spdifrx.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_spdifrx.c @@ -134,7 +134,7 @@ static rt_err_t _close(rt_device_t dev) return RT_EOK; } -static rt_size_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint32_t tickstart = 0; @@ -167,7 +167,7 @@ static rt_size_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t si return size; } -static rt_size_t _write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_wm8994.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_wm8994.c index cea18205fd..cdce4ac05e 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_wm8994.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/drv_wm8994.c @@ -697,14 +697,14 @@ static rt_err_t rt_wm8994_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_wm8994_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_wm8994_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); return RT_EOK; } -static rt_size_t rt_wm8994_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_wm8994_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); diff --git a/bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c b/bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c index 6a29942e5b..613376d14c 100644 --- a/bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c +++ b/bsp/stm32/stm32mp157a-st-ev1/board/ports/eth/drv_eth.c @@ -494,14 +494,14 @@ static rt_err_t rt_stm32_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("emac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_stm32_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("emac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/synwit/swm320/drivers/drv_nor_flash.c b/bsp/synwit/swm320/drivers/drv_nor_flash.c index 5f1b0c31c7..36e747d86d 100644 --- a/bsp/synwit/swm320/drivers/drv_nor_flash.c +++ b/bsp/synwit/swm320/drivers/drv_nor_flash.c @@ -30,7 +30,7 @@ static long swm_norflash_read_id(struct rt_mtd_nor_device *device) return 0xdeadbeef; } -static rt_size_t swm_norflash_read(struct rt_mtd_nor_device *device, +static rt_ssize_t swm_norflash_read(struct rt_mtd_nor_device *device, rt_off_t position, rt_uint8_t *data, rt_uint32_t size) @@ -41,7 +41,7 @@ static rt_size_t swm_norflash_read(struct rt_mtd_nor_device *device, return size; } -static rt_size_t swm_norflash_write(struct rt_mtd_nor_device *device, +static rt_ssize_t swm_norflash_write(struct rt_mtd_nor_device *device, rt_off_t position, const rt_uint8_t *data, rt_uint32_t size) diff --git a/bsp/tm4c123bsp/libraries/Drivers/drv_uart.c b/bsp/tm4c123bsp/libraries/Drivers/drv_uart.c index 41b133fd6e..32d2fae866 100644 --- a/bsp/tm4c123bsp/libraries/Drivers/drv_uart.c +++ b/bsp/tm4c123bsp/libraries/Drivers/drv_uart.c @@ -142,7 +142,7 @@ static int tm4c123_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t tm4c123_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t tm4c123_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { /* this is an interface for uart dma, reserved for uptate. */ return 0; diff --git a/bsp/tm4c129x/drivers/drv_eth.c b/bsp/tm4c129x/drivers/drv_eth.c index 11b96a10a5..84523a7271 100644 --- a/bsp/tm4c129x/drivers/drv_eth.c +++ b/bsp/tm4c129x/drivers/drv_eth.c @@ -1425,14 +1425,14 @@ static rt_err_t eth_dev_close(rt_device_t dev) } /* Read */ -static rt_size_t eth_dev_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t eth_dev_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } /* Write */ -static rt_size_t eth_dev_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t eth_dev_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/upd70f3454/drivers/uart.c b/bsp/upd70f3454/drivers/uart.c index d452092497..ba465cfbd3 100644 --- a/bsp/upd70f3454/drivers/uart.c +++ b/bsp/upd70f3454/drivers/uart.c @@ -124,7 +124,7 @@ static rt_err_t rt_uart_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint8_t *ptr; struct rt_uart_v850 *uart = (struct rt_uart_v850 *)dev; @@ -171,7 +171,7 @@ static rt_size_t rt_uart_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_si return 0; } -static rt_size_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_uart_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { char *ptr; ptr = (char*)buffer; diff --git a/bsp/w60x/drivers/drv_i2c.c b/bsp/w60x/drivers/drv_i2c.c index 29632bc815..ed137c73c5 100644 --- a/bsp/w60x/drivers/drv_i2c.c +++ b/bsp/w60x/drivers/drv_i2c.c @@ -30,10 +30,10 @@ struct wm_i2c_bus static struct wm_i2c_bus wm_i2c; -static rt_size_t wm_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t wm_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); -static rt_size_t wm_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t wm_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); static rt_err_t wm_i2c_bus_control(struct rt_i2c_bus_device *bus, @@ -75,7 +75,7 @@ static rt_err_t wm_i2c_send_address(struct rt_i2c_bus_device *bus, return RT_EOK; } -static rt_size_t wm_i2c_mst_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t wm_i2c_mst_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { @@ -125,7 +125,7 @@ static rt_size_t wm_i2c_mst_xfer(struct rt_i2c_bus_device *bus, return i; } -static rt_size_t wm_i2c_slv_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t wm_i2c_slv_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/bsp/w60x/drivers/drv_rtc.c b/bsp/w60x/drivers/drv_rtc.c index 552f4fb46f..500201b68d 100644 --- a/bsp/w60x/drivers/drv_rtc.c +++ b/bsp/w60x/drivers/drv_rtc.c @@ -159,13 +159,13 @@ static rt_err_t wm_rtc_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t wm_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t wm_rtc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { wm_rtc_control(dev, RT_DEVICE_CTRL_RTC_GET_TIME, buffer); return size; } -static rt_size_t wm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t wm_rtc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { wm_rtc_control(dev, RT_DEVICE_CTRL_RTC_SET_TIME, (void *)buffer); return size; diff --git a/bsp/w60x/drivers/drv_uart.c b/bsp/w60x/drivers/drv_uart.c index e2c0f0d192..d1d2a10181 100644 --- a/bsp/w60x/drivers/drv_uart.c +++ b/bsp/w60x/drivers/drv_uart.c @@ -228,7 +228,7 @@ static rt_err_t drv_uart_configure(struct rt_serial_device *serial, struct seri static rt_err_t drv_uart_control(struct rt_serial_device *serial, int cmd, void *arg); static int drv_uart_putc(struct rt_serial_device *serial, char c); static int drv_uart_getc(struct rt_serial_device *serial); -static rt_size_t drv_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); +static rt_ssize_t drv_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); const struct rt_uart_ops _uart_ops = { @@ -390,7 +390,7 @@ static int drv_uart_getc(struct rt_serial_device *serial) return ch; } -static rt_size_t drv_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t drv_uart_dma_transmit(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { return (0); } diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f10x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f10x.c index e4118dff92..23ee2be882 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f10x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f10x.c @@ -291,7 +291,7 @@ static int ch32f1_i2c_write(I2C_TypeDef *i2c_periph, return 0; } -static rt_size_t ch32f1_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t ch32f1_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; struct i2c_bus_device *i2c_bus_dev; diff --git a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f20x.c b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f20x.c index 5e0236c47d..17a398907d 100644 --- a/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f20x.c +++ b/bsp/wch/arm/Libraries/ch32_drivers/drv_hwi2c_ch32f20x.c @@ -291,7 +291,7 @@ static int ch32f2_i2c_write(I2C_TypeDef *i2c_periph, return 0; } -static rt_size_t ch32f2_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) +static rt_ssize_t ch32f2_master_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { struct rt_i2c_msg *msg; struct i2c_bus_device *i2c_bus_dev; diff --git a/bsp/wch/arm/ch579m/board/drv_eth.c b/bsp/wch/arm/ch579m/board/drv_eth.c index 176c6c2fbf..bdbeff06bb 100644 --- a/bsp/wch/arm/ch579m/board/drv_eth.c +++ b/bsp/wch/arm/ch579m/board/drv_eth.c @@ -42,13 +42,13 @@ static rt_err_t eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/bsp/wch/risc-v/Libraries/ch56x_drivers/ch56x_usbd.c b/bsp/wch/risc-v/Libraries/ch56x_drivers/ch56x_usbd.c index 44ac67f475..512c190616 100644 --- a/bsp/wch/risc-v/Libraries/ch56x_drivers/ch56x_usbd.c +++ b/bsp/wch/risc-v/Libraries/ch56x_drivers/ch56x_usbd.c @@ -159,7 +159,7 @@ static rt_err_t udc_ep_disable(struct uendpoint *ep) return RT_EOK; } -static rt_size_t udc_ep_read_prepare(uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t udc_ep_read_prepare(uint8_t address, void *buffer, rt_size_t size) { volatile struct usbhs_registers *usbhs = (void *)USBHS_REG_BASE; @@ -206,7 +206,7 @@ static rt_size_t udc_ep_read_prepare(uint8_t address, void *buffer, rt_size_t si return size; } -static rt_size_t udc_ep_read(uint8_t address, void *buffer) +static rt_ssize_t udc_ep_read(uint8_t address, void *buffer) { volatile struct usbhs_registers *usbhs = (void *)USBHS_REG_BASE; @@ -236,7 +236,7 @@ static rt_size_t udc_ep_read(uint8_t address, void *buffer) return size; } -static rt_size_t udc_ep_write(uint8_t address, void *buffer, rt_size_t size) +static rt_ssize_t udc_ep_write(uint8_t address, void *buffer, rt_size_t size) { volatile struct usbhs_registers *usbhs = (void *)USBHS_REG_BASE; diff --git a/bsp/x86/drivers/console.c b/bsp/x86/drivers/console.c index 4fe1daeeed..f6dd8734bb 100644 --- a/bsp/x86/drivers/console.c +++ b/bsp/x86/drivers/console.c @@ -155,7 +155,7 @@ static rt_err_t rt_console_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_console_write(rt_device_t dev, rt_off_t pos, const void * buffer, rt_size_t size) +static rt_ssize_t rt_console_write(rt_device_t dev, rt_off_t pos, const void * buffer, rt_size_t size) { rt_size_t i = size; const char* str = buffer; @@ -168,7 +168,7 @@ static rt_size_t rt_console_write(rt_device_t dev, rt_off_t pos, const void * bu return size; } -static rt_size_t rt_console_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_console_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr = buffer; rt_err_t err_code = RT_EOK; diff --git a/bsp/x86/drivers/floppy.c b/bsp/x86/drivers/floppy.c index 077ce40e4d..7f3837fcfd 100644 --- a/bsp/x86/drivers/floppy.c +++ b/bsp/x86/drivers/floppy.c @@ -264,7 +264,7 @@ static rt_err_t rt_floppy_close(rt_device_t dev) * buffer: * size : how many blocks */ -static rt_size_t rt_floppy_read(rt_device_t device, rt_off_t position, void *buffer, rt_size_t size) +static rt_ssize_t rt_floppy_read(rt_device_t device, rt_off_t position, void *buffer, rt_size_t size) { rt_size_t doSize = size; @@ -300,7 +300,7 @@ static rt_size_t rt_floppy_read(rt_device_t device, rt_off_t position, void *buf * buffer: * size : how many blocks */ -static rt_size_t rt_floppy_write(rt_device_t device, rt_off_t position, const void *buffer, rt_size_t size) +static rt_ssize_t rt_floppy_write(rt_device_t device, rt_off_t position, const void *buffer, rt_size_t size) { rt_mutex_take(&lock, RT_WAITING_FOREVER); panic("FIXME:I don't know how!\n"); diff --git a/bsp/xplorer4330/drivers/drv_led.c b/bsp/xplorer4330/drivers/drv_led.c index 48cbd089b0..b97d32c6b3 100644 --- a/bsp/xplorer4330/drivers/drv_led.c +++ b/bsp/xplorer4330/drivers/drv_led.c @@ -69,7 +69,7 @@ static rt_err_t rt_led_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, +static rt_ssize_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_ubase_t index = 0; @@ -94,7 +94,7 @@ static rt_size_t rt_led_read(rt_device_t dev, rt_off_t pos, void *buffer, return index; } -static rt_size_t rt_led_write(rt_device_t dev, rt_off_t pos, +static rt_ssize_t rt_led_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_ubase_t index = 0; diff --git a/bsp/zynqmp-r5-axu4ev/drivers/drv_eth.c b/bsp/zynqmp-r5-axu4ev/drivers/drv_eth.c index b7b9a22a1d..9bcf708593 100644 --- a/bsp/zynqmp-r5-axu4ev/drivers/drv_eth.c +++ b/bsp/zynqmp-r5-axu4ev/drivers/drv_eth.c @@ -216,14 +216,14 @@ static rt_err_t rt_zynqmp_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_zynqmp_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_zynqmp_eth_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { LOG_D("emac read"); rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_zynqmp_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_zynqmp_eth_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { LOG_D("emac write"); rt_set_errno(-RT_ENOSYS); diff --git a/bsp/zynqmp-r5-axu4ev/drivers/drv_sdcard.c b/bsp/zynqmp-r5-axu4ev/drivers/drv_sdcard.c index 155b7da552..3ce161b0d4 100644 --- a/bsp/zynqmp-r5-axu4ev/drivers/drv_sdcard.c +++ b/bsp/zynqmp-r5-axu4ev/drivers/drv_sdcard.c @@ -359,7 +359,7 @@ static rt_err_t rt_sdcard_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(((rt_uint32_t)buffer % 4) == 0); DRESULT status; @@ -376,7 +376,7 @@ static rt_size_t rt_sdcard_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_ return 0; } -static rt_size_t rt_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_sdcard_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(((rt_uint32_t)buffer % 4) == 0); DRESULT status; diff --git a/components/drivers/audio/audio.c b/components/drivers/audio/audio.c index edef7d0eeb..2907b10ba0 100644 --- a/components/drivers/audio/audio.c +++ b/components/drivers/audio/audio.c @@ -357,7 +357,7 @@ static rt_err_t _audio_dev_close(struct rt_device *dev) return RT_EOK; } -static rt_size_t _audio_dev_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _audio_dev_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) { struct rt_audio_device *audio; RT_ASSERT(dev != RT_NULL); @@ -369,7 +369,7 @@ static rt_size_t _audio_dev_read(struct rt_device *dev, rt_off_t pos, void *buff return rt_device_read(RT_DEVICE(&audio->record->pipe), pos, buffer, size); } -static rt_size_t _audio_dev_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _audio_dev_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct rt_audio_device *audio; diff --git a/components/drivers/audio/audio_pipe.c b/components/drivers/audio/audio_pipe.c index 35a3faf73f..4c8aa288b1 100644 --- a/components/drivers/audio/audio_pipe.c +++ b/components/drivers/audio/audio_pipe.c @@ -32,7 +32,7 @@ static void _rt_pipe_resume_writer(struct rt_audio_pipe *pipe) } } -static rt_size_t rt_pipe_read(rt_device_t dev, +static rt_ssize_t rt_pipe_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -114,7 +114,7 @@ static void _rt_pipe_resume_reader(struct rt_audio_pipe *pipe) } } -static rt_size_t rt_pipe_write(rt_device_t dev, +static rt_ssize_t rt_pipe_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/can/can.c b/components/drivers/can/can.c index a3d81f6081..53bc2ba45a 100644 --- a/components/drivers/can/can.c +++ b/components/drivers/can/can.c @@ -438,7 +438,7 @@ static rt_err_t rt_can_close(struct rt_device *dev) return RT_EOK; } -static rt_size_t rt_can_read(struct rt_device *dev, +static rt_ssize_t rt_can_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -458,7 +458,7 @@ static rt_size_t rt_can_read(struct rt_device *dev, return 0; } -static rt_size_t rt_can_write(struct rt_device *dev, +static rt_ssize_t rt_can_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/hwtimer/hwtimer.c b/components/drivers/hwtimer/hwtimer.c index 189ef7df49..f8e1a35275 100644 --- a/components/drivers/hwtimer/hwtimer.c +++ b/components/drivers/hwtimer/hwtimer.c @@ -143,7 +143,7 @@ static rt_err_t rt_hwtimer_close(struct rt_device *dev) return result; } -static rt_size_t rt_hwtimer_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_hwtimer_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_hwtimer_t *timer; rt_hwtimerval_t tv; @@ -175,7 +175,7 @@ static rt_size_t rt_hwtimer_read(struct rt_device *dev, rt_off_t pos, void *buff return size; } -static rt_size_t rt_hwtimer_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_hwtimer_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_base_t level; rt_uint32_t t; diff --git a/components/drivers/i2c/i2c-bit-ops.c b/components/drivers/i2c/i2c-bit-ops.c index ee6acd886d..5446184558 100644 --- a/components/drivers/i2c/i2c-bit-ops.c +++ b/components/drivers/i2c/i2c-bit-ops.c @@ -186,7 +186,7 @@ static rt_int32_t i2c_readb(struct rt_i2c_bus_device *bus) return data; } -static rt_size_t i2c_send_bytes(struct rt_i2c_bus_device *bus, +static rt_ssize_t i2c_send_bytes(struct rt_i2c_bus_device *bus, struct rt_i2c_msg *msg) { rt_int32_t ret; @@ -240,7 +240,7 @@ static rt_err_t i2c_send_ack_or_nack(struct rt_i2c_bus_device *bus, int ack) return RT_EOK; } -static rt_size_t i2c_recv_bytes(struct rt_i2c_bus_device *bus, +static rt_ssize_t i2c_recv_bytes(struct rt_i2c_bus_device *bus, struct rt_i2c_msg *msg) { rt_int32_t val; @@ -366,7 +366,7 @@ static rt_err_t i2c_bit_send_address(struct rt_i2c_bus_device *bus, return RT_EOK; } -static rt_size_t i2c_bit_xfer(struct rt_i2c_bus_device *bus, +static rt_ssize_t i2c_bit_xfer(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num) { diff --git a/components/drivers/i2c/i2c_dev.c b/components/drivers/i2c/i2c_dev.c index 4e2ca8924f..ffd24f95b5 100644 --- a/components/drivers/i2c/i2c_dev.c +++ b/components/drivers/i2c/i2c_dev.c @@ -20,7 +20,7 @@ #endif #include -static rt_size_t i2c_bus_device_read(rt_device_t dev, +static rt_ssize_t i2c_bus_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t count) @@ -40,7 +40,7 @@ static rt_size_t i2c_bus_device_read(rt_device_t dev, return rt_i2c_master_recv(bus, addr, flags, (rt_uint8_t *)buffer, count); } -static rt_size_t i2c_bus_device_write(rt_device_t dev, +static rt_ssize_t i2c_bus_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t count) diff --git a/components/drivers/include/drivers/audio.h b/components/drivers/include/drivers/audio.h index d9a7388678..79856a37a8 100644 --- a/components/drivers/include/drivers/audio.h +++ b/components/drivers/include/drivers/audio.h @@ -105,7 +105,7 @@ struct rt_audio_ops rt_err_t (*init)(struct rt_audio_device *audio); rt_err_t (*start)(struct rt_audio_device *audio, int stream); rt_err_t (*stop)(struct rt_audio_device *audio, int stream); - rt_size_t (*transmit)(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size); + rt_ssize_t (*transmit)(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size); /* get page size of codec or private buffer's info */ void (*buffer_info)(struct rt_audio_device *audio, struct rt_audio_buf_info *info); }; diff --git a/components/drivers/include/drivers/i2c.h b/components/drivers/include/drivers/i2c.h index 308c344294..3186f13414 100644 --- a/components/drivers/include/drivers/i2c.h +++ b/components/drivers/include/drivers/i2c.h @@ -38,10 +38,10 @@ struct rt_i2c_bus_device; struct rt_i2c_bus_device_ops { - rt_size_t (*master_xfer)(struct rt_i2c_bus_device *bus, + rt_ssize_t (*master_xfer)(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); - rt_size_t (*slave_xfer)(struct rt_i2c_bus_device *bus, + rt_ssize_t (*slave_xfer)(struct rt_i2c_bus_device *bus, struct rt_i2c_msg msgs[], rt_uint32_t num); rt_err_t (*i2c_bus_control)(struct rt_i2c_bus_device *bus, diff --git a/components/drivers/include/drivers/serial.h b/components/drivers/include/drivers/serial.h index b4c6fb4a7a..e7432b1e1d 100644 --- a/components/drivers/include/drivers/serial.h +++ b/components/drivers/include/drivers/serial.h @@ -167,7 +167,7 @@ struct rt_uart_ops int (*putc)(struct rt_serial_device *serial, char c); int (*getc)(struct rt_serial_device *serial); - rt_size_t (*dma_transmit)(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); + rt_ssize_t (*dma_transmit)(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction); }; void rt_hw_serial_isr(struct rt_serial_device *serial, int event); diff --git a/components/drivers/ipc/pipe.c b/components/drivers/ipc/pipe.c index 7567a73482..ccb953bc23 100644 --- a/components/drivers/ipc/pipe.c +++ b/components/drivers/ipc/pipe.c @@ -462,7 +462,7 @@ rt_err_t rt_pipe_close(rt_device_t device) * @return Return the length of data read. * When the return value is 0, it means the pipe device handle is empty or the count is 0. */ -rt_size_t rt_pipe_read(rt_device_t device, rt_off_t pos, void *buffer, rt_size_t count) +rt_ssize_t rt_pipe_read(rt_device_t device, rt_off_t pos, void *buffer, rt_size_t count) { uint8_t *pbuf; rt_size_t read_bytes = 0; @@ -510,7 +510,7 @@ rt_size_t rt_pipe_read(rt_device_t device, rt_off_t pos, void *buffer, rt_size_t * @return Return the length of data written. * When the return value is 0, it means the pipe device handle is empty or the count is 0. */ -rt_size_t rt_pipe_write(rt_device_t device, rt_off_t pos, const void *buffer, rt_size_t count) +rt_ssize_t rt_pipe_write(rt_device_t device, rt_off_t pos, const void *buffer, rt_size_t count) { uint8_t *pbuf; rt_size_t write_bytes = 0; diff --git a/components/drivers/misc/adc.c b/components/drivers/misc/adc.c index a85be09fe9..29dbb86f96 100644 --- a/components/drivers/misc/adc.c +++ b/components/drivers/misc/adc.c @@ -20,7 +20,7 @@ #define DBG_LVL DBG_INFO #include -static rt_size_t _adc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _adc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_err_t result = RT_EOK; rt_size_t i; diff --git a/components/drivers/misc/dac.c b/components/drivers/misc/dac.c index c1176cc36c..788eac851b 100644 --- a/components/drivers/misc/dac.c +++ b/components/drivers/misc/dac.c @@ -17,7 +17,7 @@ #define DBG_LVL DBG_INFO #include -static rt_size_t _dac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _dac_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_err_t result = RT_EOK; rt_size_t i; diff --git a/components/drivers/misc/pin.c b/components/drivers/misc/pin.c index 91913dccfd..a5a5addafe 100644 --- a/components/drivers/misc/pin.c +++ b/components/drivers/misc/pin.c @@ -13,7 +13,7 @@ #include static struct rt_device_pin _hw_pin; -static rt_size_t _pin_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _pin_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { struct rt_device_pin_status *status; struct rt_device_pin *pin = (struct rt_device_pin *)dev; @@ -29,7 +29,7 @@ static rt_size_t _pin_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_ return size; } -static rt_size_t _pin_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _pin_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct rt_device_pin_status *status; struct rt_device_pin *pin = (struct rt_device_pin *)dev; diff --git a/components/drivers/misc/pulse_encoder.c b/components/drivers/misc/pulse_encoder.c index d5efcef8e7..39bf3de2f3 100644 --- a/components/drivers/misc/pulse_encoder.c +++ b/components/drivers/misc/pulse_encoder.c @@ -55,7 +55,7 @@ static rt_err_t rt_pulse_encoder_close(struct rt_device *dev) } } -static rt_size_t rt_pulse_encoder_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_pulse_encoder_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) { struct rt_pulse_encoder_device *pulse_encoder; diff --git a/components/drivers/misc/rt_drv_pwm.c b/components/drivers/misc/rt_drv_pwm.c index 7cc01e4e1a..25b45f9d43 100644 --- a/components/drivers/misc/rt_drv_pwm.c +++ b/components/drivers/misc/rt_drv_pwm.c @@ -43,7 +43,7 @@ pos: channel void *buffer: rt_uint32_t pulse[size] size : number of pulse, only set to sizeof(rt_uint32_t). */ -static rt_size_t _pwm_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _pwm_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_err_t result = RT_EOK; struct rt_device_pwm *pwm = (struct rt_device_pwm *)dev; @@ -71,7 +71,7 @@ pos: channel void *buffer: rt_uint32_t pulse[size] size : number of pulse, only set to sizeof(rt_uint32_t). */ -static rt_size_t _pwm_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _pwm_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_err_t result = RT_EOK; struct rt_device_pwm *pwm = (struct rt_device_pwm *)dev; diff --git a/components/drivers/misc/rt_inputcapture.c b/components/drivers/misc/rt_inputcapture.c index c7a9edaaf6..067aeef2df 100644 --- a/components/drivers/misc/rt_inputcapture.c +++ b/components/drivers/misc/rt_inputcapture.c @@ -81,7 +81,7 @@ static rt_err_t rt_inputcapture_close(struct rt_device *dev) return ret; } -static rt_size_t rt_inputcapture_read(struct rt_device *dev, +static rt_ssize_t rt_inputcapture_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) diff --git a/components/drivers/misc/rt_null.c b/components/drivers/misc/rt_null.c index 3e4cf6f3da..bc329ab50e 100644 --- a/components/drivers/misc/rt_null.c +++ b/components/drivers/misc/rt_null.c @@ -12,12 +12,12 @@ static struct rt_device null_dev; -static rt_size_t null_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t null_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { return 0; } -static rt_size_t null_write (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t null_write (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { return size; } diff --git a/components/drivers/misc/rt_random.c b/components/drivers/misc/rt_random.c index 1ea0480b7c..9b52918ae9 100644 --- a/components/drivers/misc/rt_random.c +++ b/components/drivers/misc/rt_random.c @@ -19,7 +19,7 @@ static rt_uint16_t calc_random(void) return (seed >> 16) & 0x7FFF; /* return bits 16~30 */ } -static rt_size_t random_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t random_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint16_t rand = calc_random(); ssize_t ret = sizeof(rand); @@ -27,7 +27,7 @@ static rt_size_t random_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_siz return ret; } -static rt_size_t random_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t random_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { ssize_t ret = sizeof(seed); rt_memcpy(&seed, buffer, ret); @@ -93,7 +93,7 @@ static rt_uint16_t calc_urandom(void) return (useed >> 16) & 0x7FFF; /* return bits 16~30 */ } -static rt_size_t random_uread(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t random_uread(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_uint16_t rand = calc_urandom(); ssize_t ret = sizeof(rand); @@ -101,7 +101,7 @@ static rt_size_t random_uread(rt_device_t dev, rt_off_t pos, void *buffer, rt_si return ret; } -static rt_size_t random_uwrite(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t random_uwrite(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { ssize_t ret = sizeof(useed); rt_memcpy(&useed, buffer, ret); diff --git a/components/drivers/misc/rt_zero.c b/components/drivers/misc/rt_zero.c index f2657a2360..08df5cb3aa 100644 --- a/components/drivers/misc/rt_zero.c +++ b/components/drivers/misc/rt_zero.c @@ -12,13 +12,13 @@ static struct rt_device zero_dev; -static rt_size_t zero_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t zero_read (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_memset(buffer, 0, size); return size; } -static rt_size_t zero_write (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t zero_write (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { return size; } diff --git a/components/drivers/mtd/mtd_nand.c b/components/drivers/mtd/mtd_nand.c index 6ca56f9a6d..9c3397dfdd 100644 --- a/components/drivers/mtd/mtd_nand.c +++ b/components/drivers/mtd/mtd_nand.c @@ -34,7 +34,7 @@ static rt_err_t _mtd_close(rt_device_t dev) return RT_EOK; } -static rt_size_t _mtd_read(rt_device_t dev, +static rt_ssize_t _mtd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -42,7 +42,7 @@ static rt_size_t _mtd_read(rt_device_t dev, return size; } -static rt_size_t _mtd_write(rt_device_t dev, +static rt_ssize_t _mtd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/mtd/mtd_nor.c b/components/drivers/mtd/mtd_nor.c index af3b50e42f..6824190475 100644 --- a/components/drivers/mtd/mtd_nor.c +++ b/components/drivers/mtd/mtd_nor.c @@ -30,7 +30,7 @@ static rt_err_t _mtd_close(rt_device_t dev) return RT_EOK; } -static rt_size_t _mtd_read(rt_device_t dev, +static rt_ssize_t _mtd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -38,7 +38,7 @@ static rt_size_t _mtd_read(rt_device_t dev, return size; } -static rt_size_t _mtd_write(rt_device_t dev, +static rt_ssize_t _mtd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/phy/phy.c b/components/drivers/phy/phy.c index ef47a91d7c..317b24ebfc 100644 --- a/components/drivers/phy/phy.c +++ b/components/drivers/phy/phy.c @@ -18,13 +18,13 @@ #include -static rt_size_t phy_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t count) +static rt_ssize_t phy_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t count) { struct rt_phy_device *phy = (struct rt_phy_device *)dev->user_data; struct rt_phy_msg *msg = (struct rt_phy_msg *)buffer; return phy->bus->ops->read(phy->bus, phy->addr, msg->reg, &(msg->value), 4); } -static rt_size_t phy_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t count) +static rt_ssize_t phy_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t count) { struct rt_phy_device *phy = (struct rt_phy_device *)dev->user_data; struct rt_phy_msg *msg = (struct rt_phy_msg *)buffer; diff --git a/components/drivers/pm/pm.c b/components/drivers/pm/pm.c index 0c6dcf065d..f70333090c 100644 --- a/components/drivers/pm/pm.c +++ b/components/drivers/pm/pm.c @@ -845,7 +845,7 @@ void rt_pm_default_set(rt_uint8_t sleep_mode) /** * RT-Thread device interface for PM device */ -static rt_size_t _rt_pm_device_read(rt_device_t dev, +static rt_ssize_t _rt_pm_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -868,7 +868,7 @@ static rt_size_t _rt_pm_device_read(rt_device_t dev, return length; } -static rt_size_t _rt_pm_device_write(rt_device_t dev, +static rt_ssize_t _rt_pm_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index 59eb56cdcd..0025e7f08a 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -280,7 +280,7 @@ static rt_err_t rt_mmcsd_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_mmcsd_read(rt_device_t dev, +static rt_ssize_t rt_mmcsd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -321,7 +321,7 @@ static rt_size_t rt_mmcsd_read(rt_device_t dev, return size - remain_size; } -static rt_size_t rt_mmcsd_write(rt_device_t dev, +static rt_ssize_t rt_mmcsd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/sensor/sensor.c b/components/drivers/sensor/sensor.c index 40e4b46037..8835c10bac 100644 --- a/components/drivers/sensor/sensor.c +++ b/components/drivers/sensor/sensor.c @@ -284,7 +284,7 @@ __exit: return RT_EOK; } -static rt_size_t _sensor_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t len) +static rt_ssize_t _sensor_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t len) { rt_sensor_t sensor = (rt_sensor_t)dev; rt_size_t result = 0; diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index d667d70efd..06b519166c 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -381,7 +381,7 @@ static void _serial_check_buffer_size(void) } #if defined(RT_USING_POSIX_STDIO) || defined(RT_SERIAL_USING_DMA) -static rt_size_t _serial_fifo_calc_recved_len(struct rt_serial_device *serial) +static rt_ssize_t _serial_fifo_calc_recved_len(struct rt_serial_device *serial) { struct rt_serial_rx_fifo *rx_fifo = (struct rt_serial_rx_fifo *) serial->serial_rx; @@ -413,7 +413,7 @@ static rt_size_t _serial_fifo_calc_recved_len(struct rt_serial_device *serial) * * @return length */ -static rt_size_t rt_dma_calc_recved_len(struct rt_serial_device *serial) +static rt_ssize_t rt_dma_calc_recved_len(struct rt_serial_device *serial) { return _serial_fifo_calc_recved_len(serial); } @@ -850,7 +850,7 @@ static rt_err_t rt_serial_close(struct rt_device *dev) return RT_EOK; } -static rt_size_t rt_serial_read(struct rt_device *dev, +static rt_ssize_t rt_serial_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -876,7 +876,7 @@ static rt_size_t rt_serial_read(struct rt_device *dev, return _serial_poll_rx(serial, (rt_uint8_t *)buffer, size); } -static rt_size_t rt_serial_write(struct rt_device *dev, +static rt_ssize_t rt_serial_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c index a6e4e22def..9e809048bd 100644 --- a/components/drivers/serial/serial_v2.c +++ b/components/drivers/serial/serial_v2.c @@ -194,7 +194,7 @@ const static struct dfs_file_ops _serial_fops = }; #endif /* RT_USING_POSIX_STDIO */ -static rt_size_t rt_serial_get_linear_buffer(struct rt_ringbuffer *rb, +static rt_ssize_t rt_serial_get_linear_buffer(struct rt_ringbuffer *rb, rt_uint8_t **ptr) { rt_size_t size; @@ -220,7 +220,7 @@ static rt_size_t rt_serial_get_linear_buffer(struct rt_ringbuffer *rb, return rb->buffer_size - rb->read_index; } -static rt_size_t rt_serial_update_read_index(struct rt_ringbuffer *rb, +static rt_ssize_t rt_serial_update_read_index(struct rt_ringbuffer *rb, rt_uint16_t read_index) { rt_size_t size; @@ -253,7 +253,7 @@ static rt_size_t rt_serial_update_read_index(struct rt_ringbuffer *rb, return read_index; } -static rt_size_t rt_serial_update_write_index(struct rt_ringbuffer *rb, +static rt_ssize_t rt_serial_update_write_index(struct rt_ringbuffer *rb, rt_uint16_t write_size) { rt_uint16_t size; @@ -386,7 +386,7 @@ rt_size_t _serial_poll_tx(struct rt_device *dev, * @param size Receive data buffer length. * @return Return the final length of data received. */ -static rt_size_t _serial_fifo_rx(struct rt_device *dev, +static rt_ssize_t _serial_fifo_rx(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -448,7 +448,7 @@ static rt_size_t _serial_fifo_rx(struct rt_device *dev, * @param size Transmit data buffer length. * @return Return the final length of data transmit. */ -static rt_size_t _serial_fifo_tx_blocking_nbuf(struct rt_device *dev, +static rt_ssize_t _serial_fifo_tx_blocking_nbuf(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) @@ -495,7 +495,7 @@ static rt_size_t _serial_fifo_tx_blocking_nbuf(struct rt_device *dev, * @param size Transmit data buffer length. * @return Return the final length of data transmit. */ -static rt_size_t _serial_fifo_tx_blocking_buf(struct rt_device *dev, +static rt_ssize_t _serial_fifo_tx_blocking_buf(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) @@ -555,7 +555,7 @@ static rt_size_t _serial_fifo_tx_blocking_buf(struct rt_device *dev, * @param size Transmit data buffer length. * @return Return the final length of data transmit. */ -static rt_size_t _serial_fifo_tx_nonblocking(struct rt_device *dev, +static rt_ssize_t _serial_fifo_tx_nonblocking(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) @@ -1372,7 +1372,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev, } #ifdef RT_USING_DEVICE_OPS -static rt_size_t rt_serial_read(struct rt_device *dev, +static rt_ssize_t rt_serial_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -1393,7 +1393,7 @@ static rt_size_t rt_serial_read(struct rt_device *dev, } -static rt_size_t rt_serial_write(struct rt_device *dev, +static rt_ssize_t rt_serial_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/spi/enc28j60.c b/components/drivers/spi/enc28j60.c index 361db776f6..f3c3ecb30b 100644 --- a/components/drivers/spi/enc28j60.c +++ b/components/drivers/spi/enc28j60.c @@ -381,14 +381,14 @@ static rt_err_t enc28j60_close(rt_device_t dev) } /* Read */ -static rt_size_t enc28j60_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t enc28j60_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return RT_EOK; } /* Write */ -static rt_size_t enc28j60_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t enc28j60_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/components/drivers/spi/spi_dev.c b/components/drivers/spi/spi_dev.c index 4b21466b0d..2d63fbcfbb 100644 --- a/components/drivers/spi/spi_dev.c +++ b/components/drivers/spi/spi_dev.c @@ -11,7 +11,7 @@ #include /* SPI bus device interface, compatible with RT-Thread 0.3.x/1.0.x */ -static rt_size_t _spi_bus_device_read(rt_device_t dev, +static rt_ssize_t _spi_bus_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -25,7 +25,7 @@ static rt_size_t _spi_bus_device_read(rt_device_t dev, return rt_spi_transfer(bus->owner, RT_NULL, buffer, size); } -static rt_size_t _spi_bus_device_write(rt_device_t dev, +static rt_ssize_t _spi_bus_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) @@ -77,7 +77,7 @@ rt_err_t rt_spi_bus_device_init(struct rt_spi_bus *bus, const char *name) } /* SPI Dev device interface, compatible with RT-Thread 0.3.x/1.0.x */ -static rt_size_t _spidev_device_read(rt_device_t dev, +static rt_ssize_t _spidev_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -91,7 +91,7 @@ static rt_size_t _spidev_device_read(rt_device_t dev, return rt_spi_transfer(device, RT_NULL, buffer, size); } -static rt_size_t _spidev_device_write(rt_device_t dev, +static rt_ssize_t _spidev_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/spi/spi_flash_sfud.c b/components/drivers/spi/spi_flash_sfud.c index 30bc77a57d..83f8537c72 100644 --- a/components/drivers/spi/spi_flash_sfud.c +++ b/components/drivers/spi/spi_flash_sfud.c @@ -86,7 +86,7 @@ static rt_err_t rt_sfud_control(rt_device_t dev, int cmd, void *args) { } -static rt_size_t rt_sfud_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { +static rt_ssize_t rt_sfud_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { struct spi_flash_device *rtt_dev = (struct spi_flash_device *) (dev->user_data); sfud_flash *sfud_dev = (sfud_flash *) (rtt_dev->user_data); @@ -104,7 +104,7 @@ static rt_size_t rt_sfud_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si } } -static rt_size_t rt_sfud_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { +static rt_ssize_t rt_sfud_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { struct spi_flash_device *rtt_dev = (struct spi_flash_device *) (dev->user_data); sfud_flash *sfud_dev = (sfud_flash *) (rtt_dev->user_data); diff --git a/components/drivers/spi/spi_msd.c b/components/drivers/spi/spi_msd.c index 6bd0501694..dce2a7c8b0 100644 --- a/components/drivers/spi/spi_msd.c +++ b/components/drivers/spi/spi_msd.c @@ -43,10 +43,10 @@ static rt_err_t _wait_ready(struct rt_spi_device *device); static rt_err_t rt_msd_init(rt_device_t dev); static rt_err_t rt_msd_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t rt_msd_close(rt_device_t dev); -static rt_size_t rt_msd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); -static rt_size_t rt_msd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t rt_msd_sdhc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t rt_msd_sdhc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t rt_msd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t rt_msd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t rt_msd_sdhc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t rt_msd_sdhc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); static rt_err_t rt_msd_control(rt_device_t dev, int cmd, void *args); static rt_err_t MSD_take_owner(struct rt_spi_device *spi_device) @@ -1209,7 +1209,7 @@ static rt_err_t rt_msd_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_msd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_msd_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { struct msd_device *msd = (struct msd_device *)dev; uint8_t response[MSD_RESPONSE_MAX_LEN]; @@ -1285,7 +1285,7 @@ _exit: return size; } -static rt_size_t rt_msd_sdhc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rt_msd_sdhc_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { struct msd_device *msd = (struct msd_device *)dev; uint8_t response[MSD_RESPONSE_MAX_LEN]; @@ -1361,7 +1361,7 @@ _exit: return size; } -static rt_size_t rt_msd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_msd_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct msd_device *msd = (struct msd_device *)dev; uint8_t response[MSD_RESPONSE_MAX_LEN]; @@ -1481,7 +1481,7 @@ _exit: return size; } -static rt_size_t rt_msd_sdhc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rt_msd_sdhc_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct msd_device *msd = (struct msd_device *)dev; uint8_t response[MSD_RESPONSE_MAX_LEN]; diff --git a/components/drivers/spi/spi_wifi_rw009.c b/components/drivers/spi/spi_wifi_rw009.c index 39388f10c4..6cbe8dbaa9 100644 --- a/components/drivers/spi/spi_wifi_rw009.c +++ b/components/drivers/spi/spi_wifi_rw009.c @@ -504,13 +504,13 @@ static rt_err_t rw009_wifi_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rw009_wifi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t rw009_wifi_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rw009_wifi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t rw009_wifi_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/components/drivers/touch/touch.c b/components/drivers/touch/touch.c index 6f5b73a7cb..e15ebf5b05 100644 --- a/components/drivers/touch/touch.c +++ b/components/drivers/touch/touch.c @@ -122,7 +122,7 @@ static rt_err_t rt_touch_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_touch_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t len) +static rt_ssize_t rt_touch_read(rt_device_t dev, rt_off_t pos, void *buf, rt_size_t len) { rt_touch_t touch; rt_size_t result = 0; diff --git a/components/drivers/tty/console.c b/components/drivers/tty/console.c index dfab484f2e..01349635b4 100644 --- a/components/drivers/tty/console.c +++ b/components/drivers/tty/console.c @@ -197,7 +197,7 @@ static rt_err_t rt_console_close(struct rt_device *dev) return result; } -static rt_size_t rt_console_read(struct rt_device *dev, +static rt_ssize_t rt_console_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -206,7 +206,7 @@ static rt_size_t rt_console_read(struct rt_device *dev, return len; } -static rt_size_t rt_console_write(struct rt_device *dev, +static rt_ssize_t rt_console_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/tty/pty.c b/components/drivers/tty/pty.c index 34b366f399..46a241a715 100644 --- a/components/drivers/tty/pty.c +++ b/components/drivers/tty/pty.c @@ -123,7 +123,7 @@ static rt_err_t pty_device_close(struct rt_device *dev) return result; } -static rt_size_t pty_device_read(struct rt_device *dev, +static rt_ssize_t pty_device_read(struct rt_device *dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -133,7 +133,7 @@ static rt_size_t pty_device_read(struct rt_device *dev, return len; } -static rt_size_t pty_device_write(struct rt_device *dev, +static rt_ssize_t pty_device_write(struct rt_device *dev, rt_off_t pos, const void *buffer, rt_size_t size) diff --git a/components/drivers/usb/usbdevice/class/cdc_vcom.c b/components/drivers/usb/usbdevice/class/cdc_vcom.c index 89d03caf88..29d3e25174 100644 --- a/components/drivers/usb/usbdevice/class/cdc_vcom.c +++ b/components/drivers/usb/usbdevice/class/cdc_vcom.c @@ -721,7 +721,7 @@ static int _vcom_getc(struct rt_serial_device *serial) return result; } -static rt_size_t _vcom_rb_block_put(struct vcom *data, const rt_uint8_t *buf, rt_size_t size) +static rt_ssize_t _vcom_rb_block_put(struct vcom *data, const rt_uint8_t *buf, rt_size_t size) { rt_base_t level; rt_size_t put_len = 0; @@ -751,7 +751,7 @@ static rt_size_t _vcom_rb_block_put(struct vcom *data, const rt_uint8_t *buf, rt return size; } -static rt_size_t _vcom_tx(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) +static rt_ssize_t _vcom_tx(struct rt_serial_device *serial, rt_uint8_t *buf, rt_size_t size, int direction) { struct ufunction *func; struct vcom *data; diff --git a/components/drivers/usb/usbdevice/class/ecm.c b/components/drivers/usb/usbdevice/class/ecm.c index 4f41c00531..f821a9969e 100644 --- a/components/drivers/usb/usbdevice/class/ecm.c +++ b/components/drivers/usb/usbdevice/class/ecm.c @@ -324,13 +324,13 @@ static rt_err_t rt_ecm_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_ecm_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_ecm_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_ecm_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_ecm_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/components/drivers/usb/usbdevice/class/hid.c b/components/drivers/usb/usbdevice/class/hid.c index a95e1d82e5..d2bb05ed24 100644 --- a/components/drivers/usb/usbdevice/class/hid.c +++ b/components/drivers/usb/usbdevice/class/hid.c @@ -594,7 +594,7 @@ static rt_err_t _hid_descriptor_config(uhid_comm_desc_t hid, rt_uint8_t cintf_nr return RT_EOK; } -static rt_size_t _hid_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _hid_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct hid_s *hiddev = (struct hid_s *)dev; struct hid_report report; diff --git a/components/drivers/usb/usbdevice/class/mstorage.c b/components/drivers/usb/usbdevice/class/mstorage.c index b8f21a29df..96a1299890 100644 --- a/components/drivers/usb/usbdevice/class/mstorage.c +++ b/components/drivers/usb/usbdevice/class/mstorage.c @@ -44,7 +44,7 @@ typedef enum DIR_NONE, }CB_DIR; -typedef rt_size_t (*cbw_handler)(ufunction_t func, ustorage_cbw_t cbw); +typedef rt_ssize_t (*cbw_handler)(ufunction_t func, ustorage_cbw_t cbw); struct scsi_cmd { @@ -168,17 +168,17 @@ const static char* _ustring[] = "Interface", }; -static rt_size_t _test_unit_ready(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _request_sense(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _start_stop(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw); -static rt_size_t _verify_10(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _test_unit_ready(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _request_sense(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _start_stop(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _read_10(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _write_10(ufunction_t func, ustorage_cbw_t cbw); +static rt_ssize_t _verify_10(ufunction_t func, ustorage_cbw_t cbw); rt_align(4) static struct scsi_cmd cmd_data[] = @@ -212,7 +212,7 @@ static void _send_status(ufunction_t func) data->status = STAT_CSW; } -static rt_size_t _test_unit_ready(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _test_unit_ready(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; @@ -227,7 +227,7 @@ static rt_size_t _test_unit_ready(ufunction_t func, ustorage_cbw_t cbw) return 0; } -static rt_size_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; @@ -251,7 +251,7 @@ static rt_size_t _allow_removal(ufunction_t func, ustorage_cbw_t cbw) * @return RT_EOK on successful. */ -static rt_size_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; rt_uint8_t *buf; @@ -290,7 +290,7 @@ static rt_size_t _inquiry_cmd(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _request_sense(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _request_sense(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; struct request_sense_data *buf; @@ -333,7 +333,7 @@ static rt_size_t _request_sense(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; rt_uint8_t *buf; @@ -369,7 +369,7 @@ static rt_size_t _mode_sense_6(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; rt_uint8_t *buf; @@ -414,7 +414,7 @@ static rt_size_t _read_capacities(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; @@ -459,7 +459,7 @@ static rt_size_t _read_capacity(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _read_10(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; rt_size_t size; @@ -499,7 +499,7 @@ static rt_size_t _read_10(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _write_10(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; @@ -536,7 +536,7 @@ static rt_size_t _write_10(ufunction_t func, ustorage_cbw_t cbw) * * @return RT_EOK on successful. */ -static rt_size_t _verify_10(ufunction_t func, ustorage_cbw_t cbw) +static rt_ssize_t _verify_10(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; @@ -551,7 +551,7 @@ static rt_size_t _verify_10(ufunction_t func, ustorage_cbw_t cbw) return 0; } -static rt_size_t _start_stop(ufunction_t func, +static rt_ssize_t _start_stop(ufunction_t func, ustorage_cbw_t cbw) { struct mstorage *data; @@ -795,7 +795,7 @@ static rt_bool_t _cbw_verify(ufunction_t func, struct scsi_cmd* cmd, return RT_TRUE; } -static rt_size_t _cbw_handler(ufunction_t func, struct scsi_cmd* cmd, +static rt_ssize_t _cbw_handler(ufunction_t func, struct scsi_cmd* cmd, ustorage_cbw_t cbw) { struct mstorage *data; diff --git a/components/drivers/usb/usbdevice/class/rndis.c b/components/drivers/usb/usbdevice/class/rndis.c index 425ff62ee1..449957db2e 100644 --- a/components/drivers/usb/usbdevice/class/rndis.c +++ b/components/drivers/usb/usbdevice/class/rndis.c @@ -1083,13 +1083,13 @@ static rt_err_t rt_rndis_eth_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_rndis_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_rndis_eth_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; } -static rt_size_t rt_rndis_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_rndis_eth_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_set_errno(-RT_ENOSYS); return 0; diff --git a/components/drivers/usb/usbdevice/class/winusb.c b/components/drivers/usb/usbdevice/class/winusb.c index 4e534399be..cf72ce8d84 100644 --- a/components/drivers/usb/usbdevice/class/winusb.c +++ b/components/drivers/usb/usbdevice/class/winusb.c @@ -227,7 +227,7 @@ static rt_err_t _winusb_descriptor_config(winusb_desc_t winusb, rt_uint8_t cintf return RT_EOK; } -static rt_size_t win_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t win_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { if(((ufunction_t)dev->user_data)->device->state != USB_STATE_CONFIGURED) { @@ -241,7 +241,7 @@ static rt_size_t win_usb_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_si rt_usbd_io_request(((ufunction_t)dev->user_data)->device,winusb_device->ep_out,&winusb_device->ep_out->request); return size; } -static rt_size_t win_usb_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t win_usb_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { if(((ufunction_t)dev->user_data)->device->state != USB_STATE_CONFIGURED) { diff --git a/components/drivers/usb/usbdevice/core/usbdevice_core.c b/components/drivers/usb/usbdevice/core/usbdevice_core.c index 58d7170012..03f231dcef 100644 --- a/components/drivers/usb/usbdevice/core/usbdevice_core.c +++ b/components/drivers/usb/usbdevice/core/usbdevice_core.c @@ -19,8 +19,8 @@ static rt_list_t device_list; -static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size); -static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size); +static rt_ssize_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size); +static rt_ssize_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size); static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep); rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep); @@ -962,7 +962,7 @@ static rt_err_t _stop_notify(udevice_t device) return RT_EOK; } -static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size) +static rt_ssize_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size) { rt_uint16_t maxpacket; @@ -988,7 +988,7 @@ static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_s return size; } -static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size) +static rt_ssize_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size) { RT_ASSERT(device != RT_NULL); RT_ASSERT(device->dcd != RT_NULL); diff --git a/components/drivers/usb/usbhost/class/adk.c b/components/drivers/usb/usbhost/class/adk.c index 492a2f9bb7..3475214789 100644 --- a/components/drivers/usb/usbhost/class/adk.c +++ b/components/drivers/usb/usbhost/class/adk.c @@ -149,7 +149,7 @@ static rt_err_t rt_usbh_adk_start(struct uintf* intf) * * @return the error code, RT_EOK on successfully. */ -static rt_size_t rt_usbh_adk_read(rt_device_t device, rt_off_t pos, void* buffer, +static rt_ssize_t rt_usbh_adk_read(rt_device_t device, rt_off_t pos, void* buffer, rt_size_t size) { uadk_t adk; @@ -177,7 +177,7 @@ static rt_size_t rt_usbh_adk_read(rt_device_t device, rt_off_t pos, void* buffer * * @return the error code, RT_EOK on successfully. */ -static rt_size_t rt_usbh_adk_write (rt_device_t device, rt_off_t pos, const void* buffer, +static rt_ssize_t rt_usbh_adk_write (rt_device_t device, rt_off_t pos, const void* buffer, rt_size_t size) { uadk_t adk; diff --git a/components/drivers/usb/usbhost/class/udisk.c b/components/drivers/usb/usbhost/class/udisk.c index 8be311e657..ee0129b487 100644 --- a/components/drivers/usb/usbhost/class/udisk.c +++ b/components/drivers/usb/usbhost/class/udisk.c @@ -64,7 +64,7 @@ static rt_err_t rt_udisk_init(rt_device_t dev) * * @return the actually read size on successful, otherwise negative returned. */ -static rt_size_t rt_udisk_read(rt_device_t dev, rt_off_t pos, void* buffer, +static rt_ssize_t rt_udisk_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_err_t ret; @@ -102,7 +102,7 @@ static rt_size_t rt_udisk_read(rt_device_t dev, rt_off_t pos, void* buffer, * * @return the actually written size on successful, otherwise negative returned. */ -static rt_size_t rt_udisk_write (rt_device_t dev, rt_off_t pos, const void* buffer, +static rt_ssize_t rt_udisk_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_err_t ret; diff --git a/components/drivers/virtio/virtio_blk.c b/components/drivers/virtio/virtio_blk.c index a568a7008a..41e03e39d4 100644 --- a/components/drivers/virtio/virtio_blk.c +++ b/components/drivers/virtio/virtio_blk.c @@ -82,14 +82,14 @@ static void virtio_blk_rw(struct virtio_blk_device *virtio_blk_dev, rt_off_t pos #endif } -static rt_size_t virtio_blk_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t count) +static rt_ssize_t virtio_blk_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t count) { virtio_blk_rw((struct virtio_blk_device *)dev, pos, buffer, count, VIRTIO_BLK_T_IN); return count; } -static rt_size_t virtio_blk_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t count) +static rt_ssize_t virtio_blk_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t count) { virtio_blk_rw((struct virtio_blk_device *)dev, pos, (void *)buffer, count, VIRTIO_BLK_T_OUT); diff --git a/components/drivers/virtio/virtio_console.c b/components/drivers/virtio/virtio_console.c index 7f1a9b8af5..ac6c821853 100644 --- a/components/drivers/virtio/virtio_console.c +++ b/components/drivers/virtio/virtio_console.c @@ -78,8 +78,8 @@ static void virtio_console_send_ctrl(struct virtio_console_device *virtio_consol static rt_err_t virtio_console_port_init(rt_device_t dev); static rt_err_t virtio_console_port_open(rt_device_t dev, rt_uint16_t oflag); static rt_err_t virtio_console_port_close(rt_device_t dev); -static rt_size_t virtio_console_port_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -static rt_size_t virtio_console_port_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); +static rt_ssize_t virtio_console_port_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); +static rt_ssize_t virtio_console_port_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); static rt_err_t virtio_console_port_control(rt_device_t dev, int cmd, void *args); #ifdef RT_USING_DEVICE_OPS @@ -295,7 +295,7 @@ static rt_err_t virtio_console_port_close(rt_device_t dev) return RT_EOK; } -static rt_size_t virtio_console_port_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t virtio_console_port_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_off_t i = 0; rt_uint16_t id; @@ -346,7 +346,7 @@ static rt_size_t virtio_console_port_read(rt_device_t dev, rt_off_t pos, void *b return size; } -static rt_size_t virtio_console_port_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t virtio_console_port_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { char ch = 0; rt_off_t i = 0; diff --git a/components/drivers/virtio/virtio_gpu.c b/components/drivers/virtio/virtio_gpu.c index 67ce28a876..a9836d9b7a 100644 --- a/components/drivers/virtio/virtio_gpu.c +++ b/components/drivers/virtio/virtio_gpu.c @@ -448,7 +448,7 @@ static rt_err_t virtio_gpu_init(rt_device_t dev) return status; } -static rt_size_t virtio_gpu_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t virtio_gpu_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { struct virtio_gpu_device *virtio_gpu_dev = (struct virtio_gpu_device *)dev; @@ -466,7 +466,7 @@ static rt_size_t virtio_gpu_read(rt_device_t dev, rt_off_t pos, void *buffer, rt return size; } -static rt_size_t virtio_gpu_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t virtio_gpu_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct virtio_gpu_device *virtio_gpu_dev = (struct virtio_gpu_device *)dev; diff --git a/components/drivers/virtio/virtio_input.c b/components/drivers/virtio/virtio_input.c index 8de3d9c83f..41ecd6bb83 100644 --- a/components/drivers/virtio/virtio_input.c +++ b/components/drivers/virtio/virtio_input.c @@ -24,7 +24,7 @@ static void _set_bit(rt_uint32_t nr, volatile rt_ubase_t *addr) *p |= mask; } -static rt_size_t virtio_input_cfg_select(struct virtio_input_device *virtio_input_dev, +static rt_ssize_t virtio_input_cfg_select(struct virtio_input_device *virtio_input_dev, rt_uint8_t select, rt_uint8_t subsel) { struct virtio_input_config *config = virtio_input_dev->config; @@ -139,7 +139,7 @@ static rt_err_t virtio_input_init(rt_device_t dev) return RT_EOK; } -static rt_size_t virtio_input_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t virtio_input_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { struct virtio_input_device *virtio_input_dev = (struct virtio_input_device *)dev; @@ -157,7 +157,7 @@ static rt_size_t virtio_input_read(rt_device_t dev, rt_off_t pos, void *buffer, return size; } -static rt_size_t virtio_input_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t virtio_input_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { struct virtio_input_device *virtio_input_dev = (struct virtio_input_device *)dev; diff --git a/components/fal/src/fal_rtt.c b/components/fal/src/fal_rtt.c index 3473bc233a..a40832f31c 100644 --- a/components/fal/src/fal_rtt.c +++ b/components/fal/src/fal_rtt.c @@ -75,7 +75,7 @@ static rt_err_t blk_dev_control(rt_device_t dev, rt_uint8_t cmd, void *args) return RT_EOK; } -static rt_size_t blk_dev_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t blk_dev_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { int ret = 0; struct fal_blk_device *part = (struct fal_blk_device*) dev; @@ -96,7 +96,7 @@ static rt_size_t blk_dev_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_si return ret; } -static rt_size_t blk_dev_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t blk_dev_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { int ret = 0; struct fal_blk_device *part; @@ -212,7 +212,7 @@ struct fal_mtd_nor_device const struct fal_partition *fal_part; }; -static rt_size_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_uint32_t length) +static rt_ssize_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_uint32_t length) { int ret = 0; struct fal_mtd_nor_device *part = (struct fal_mtd_nor_device*) device; @@ -233,7 +233,7 @@ static rt_size_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t off return ret; } -static rt_size_t mtd_nor_dev_write(struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length) +static rt_ssize_t mtd_nor_dev_write(struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length) { int ret = 0; struct fal_mtd_nor_device *part; @@ -343,7 +343,7 @@ struct fal_char_device }; /* RT-Thread device interface */ -static rt_size_t char_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t char_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { int ret = 0; struct fal_char_device *part = (struct fal_char_device *) dev; @@ -361,7 +361,7 @@ static rt_size_t char_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_s return ret; } -static rt_size_t char_dev_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t char_dev_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { int ret = 0; struct fal_char_device *part; diff --git a/components/lwp/lwp_syscall.c b/components/lwp/lwp_syscall.c index 85e641e395..5a2d0d4263 100644 --- a/components/lwp/lwp_syscall.c +++ b/components/lwp/lwp_syscall.c @@ -2675,12 +2675,12 @@ rt_err_t sys_device_close(rt_device_t dev) return rt_device_close(dev); } -rt_size_t sys_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +rt_ssize_t sys_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { return rt_device_read(dev, pos, buffer, size); } -rt_size_t sys_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +rt_ssize_t sys_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { return rt_device_write(dev, pos, buffer, size); } diff --git a/components/utilities/rt-link/src/rtlink.c b/components/utilities/rt-link/src/rtlink.c index e4aa08824d..48d91fc94b 100644 --- a/components/utilities/rt-link/src/rtlink.c +++ b/components/utilities/rt-link/src/rtlink.c @@ -208,7 +208,7 @@ static void rt_link_service_send_finish(rt_link_err_e err) } } -static rt_size_t frame_send(struct rt_link_frame *frame) +static rt_ssize_t frame_send(struct rt_link_frame *frame) { rt_size_t length = 0; rt_uint8_t *data = RT_NULL; diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c index f15294fc4d..24c45585ea 100644 --- a/components/utilities/rt-link/src/rtlink_dev.c +++ b/components/utilities/rt-link/src/rtlink_dev.c @@ -265,7 +265,7 @@ rt_err_t rt_link_dev_close(rt_device_t dev) return rt_link_service_detach(&rtlink->service); } -rt_size_t rt_link_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +rt_ssize_t rt_link_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); RT_ASSERT(buffer != RT_NULL); @@ -305,7 +305,7 @@ rt_size_t rt_link_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_ return read_len; } -rt_size_t rt_link_dev_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +rt_ssize_t rt_link_dev_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { RT_ASSERT(dev != RT_NULL); RT_ASSERT(buffer != RT_NULL); diff --git a/components/utilities/rt-link/src/rtlink_hw.c b/components/utilities/rt-link/src/rtlink_hw.c index 4a56ea4893..847100912e 100644 --- a/components/utilities/rt-link/src/rtlink_hw.c +++ b/components/utilities/rt-link/src/rtlink_hw.c @@ -45,7 +45,7 @@ struct rt_link_receive_buffer *rt_link_hw_buffer_init(void *parameter) return rx_buffer; } -static rt_size_t rt_link_hw_buffer_write(void *data, rt_size_t count) +static rt_ssize_t rt_link_hw_buffer_write(void *data, rt_size_t count) { rt_size_t surplus = 0; if (rx_buffer == RT_NULL) diff --git a/components/utilities/ymodem/ymodem.c b/components/utilities/ymodem/ymodem.c index efbb70defd..f554d81f98 100644 --- a/components/utilities/ymodem/ymodem.c +++ b/components/utilities/ymodem/ymodem.c @@ -121,7 +121,7 @@ static enum rym_code _rym_read_code( } /* the caller should at least alloc _RYM_STX_PKG_SZ buffer */ -static rt_size_t _rym_read_data( +static rt_ssize_t _rym_read_data( struct rym_ctx *ctx, rt_size_t len) { @@ -180,13 +180,13 @@ static rt_err_t _rym_send_packet( return RT_EOK; } -static rt_size_t _rym_putchar(struct rym_ctx *ctx, rt_uint8_t code) +static rt_ssize_t _rym_putchar(struct rym_ctx *ctx, rt_uint8_t code) { rt_device_write(ctx->dev, 0, &code, sizeof(code)); return 1; } -static rt_size_t _rym_getchar(struct rym_ctx *ctx) +static rt_ssize_t _rym_getchar(struct rym_ctx *ctx) { rt_uint8_t getc_ack; diff --git a/components/vbus/vbus_chnx.c b/components/vbus/vbus_chnx.c index 1014369cc2..d9bb3e4d46 100644 --- a/components/vbus/vbus_chnx.c +++ b/components/vbus/vbus_chnx.c @@ -62,7 +62,7 @@ static rt_err_t _close(rt_device_t dev) return RT_EOK; } -static rt_size_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) +static rt_ssize_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) { rt_size_t outsz = 0; struct rt_vbus_dev *vdev = dev->user_data; @@ -126,7 +126,7 @@ static rt_size_t _read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t si } } -static rt_size_t _write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) +static rt_ssize_t _write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) { rt_err_t err; struct rt_vbus_dev *vdev = dev->user_data; diff --git a/documentation/device/device.md b/documentation/device/device.md index 33887d3fe6..2f24f61304 100644 --- a/documentation/device/device.md +++ b/documentation/device/device.md @@ -120,8 +120,8 @@ struct rt_device_ops rt_err_t (*init) (rt_device_t dev); rt_err_t (*open) (rt_device_t dev, rt_uint16_t oflag); rt_err_t (*close) (rt_device_t dev); - rt_size_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - rt_size_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + rt_ssize_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + rt_ssize_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_err_t (*control)(rt_device_t dev, int cmd, void *args); }; diff --git a/include/rtdef.h b/include/rtdef.h index 31341759bf..4a65c27842 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -1217,8 +1217,8 @@ struct rt_device_ops rt_err_t (*init) (rt_device_t dev); rt_err_t (*open) (rt_device_t dev, rt_uint16_t oflag); rt_err_t (*close) (rt_device_t dev); - rt_size_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - rt_size_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + rt_ssize_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + rt_ssize_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_err_t (*control)(rt_device_t dev, int cmd, void *args); }; #endif /* RT_USING_DEVICE_OPS */ @@ -1261,8 +1261,8 @@ struct rt_device rt_err_t (*init) (rt_device_t dev); rt_err_t (*open) (rt_device_t dev, rt_uint16_t oflag); rt_err_t (*close) (rt_device_t dev); - rt_size_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - rt_size_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + rt_ssize_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + rt_ssize_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_err_t (*control)(rt_device_t dev, int cmd, void *args); #endif /* RT_USING_DEVICE_OPS */ @@ -1290,8 +1290,8 @@ struct rt_driver rt_err_t (*init) (rt_device_t dev); rt_err_t (*open) (rt_device_t dev, rt_uint16_t oflag); rt_err_t (*close) (rt_device_t dev); - rt_size_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); - rt_size_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); + rt_ssize_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); + rt_ssize_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); rt_err_t (*control)(rt_device_t dev, int cmd, void *args); #endif const struct filesystem_ops *fops; diff --git a/include/rtthread.h b/include/rtthread.h index 7538a3c032..5cfa3c26b1 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -560,11 +560,11 @@ rt_device_set_tx_complete(rt_device_t dev, rt_err_t rt_device_init (rt_device_t dev); rt_err_t rt_device_open (rt_device_t dev, rt_uint16_t oflag); rt_err_t rt_device_close(rt_device_t dev); -rt_size_t rt_device_read (rt_device_t dev, +rt_ssize_t rt_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); -rt_size_t rt_device_write(rt_device_t dev, +rt_ssize_t rt_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); diff --git a/libcpu/arm/AT91SAM7S/serial.c b/libcpu/arm/AT91SAM7S/serial.c index 583443f4cb..92ed2bac3d 100644 --- a/libcpu/arm/AT91SAM7S/serial.c +++ b/libcpu/arm/AT91SAM7S/serial.c @@ -215,7 +215,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_at91serial *serial = (struct rt_at91serial*)dev; @@ -283,7 +283,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return 0; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_at91serial *serial = (struct rt_at91serial*)dev; diff --git a/libcpu/arm/s3c24x0/rtc.c b/libcpu/arm/s3c24x0/rtc.c index b7bbba9a55..ba2c45d443 100644 --- a/libcpu/arm/s3c24x0/rtc.c +++ b/libcpu/arm/s3c24x0/rtc.c @@ -119,7 +119,7 @@ static rt_err_t rtc_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rtc_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { return RT_EOK; } diff --git a/libcpu/arm/sep4020/serial.c b/libcpu/arm/sep4020/serial.c index 9bf1546c08..964403b1e3 100644 --- a/libcpu/arm/sep4020/serial.c +++ b/libcpu/arm/sep4020/serial.c @@ -86,7 +86,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; @@ -144,7 +144,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; diff --git a/libcpu/avr32/uc3/serial.c b/libcpu/avr32/uc3/serial.c index 5228d3e734..aa63ae846f 100644 --- a/libcpu/avr32/uc3/serial.c +++ b/libcpu/avr32/uc3/serial.c @@ -59,7 +59,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; @@ -122,7 +122,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; diff --git a/libcpu/blackfin/bf53x/serial.c b/libcpu/blackfin/bf53x/serial.c index 4a6484a647..f30ce4f203 100644 --- a/libcpu/blackfin/bf53x/serial.c +++ b/libcpu/blackfin/bf53x/serial.c @@ -93,7 +93,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; @@ -151,7 +151,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; diff --git a/libcpu/ppc/ppc405/serial.c b/libcpu/ppc/ppc405/serial.c index 1fc9039769..3112a1823b 100644 --- a/libcpu/ppc/ppc405/serial.c +++ b/libcpu/ppc/ppc405/serial.c @@ -99,7 +99,7 @@ static rt_err_t rt_serial_control(rt_device_t dev, int cmd, void *args) return RT_EOK; } -static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_ppc405_serial* device; @@ -156,7 +156,7 @@ static rt_size_t rt_serial_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_ return (rt_size_t)ptr - (rt_size_t)buffer; } -static rt_size_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { char *ptr; struct rt_ppc405_serial* device; diff --git a/libcpu/unicore32/sep6200/serial.c b/libcpu/unicore32/sep6200/serial.c index f91834b6a7..d732716619 100644 --- a/libcpu/unicore32/sep6200/serial.c +++ b/libcpu/unicore32/sep6200/serial.c @@ -84,7 +84,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; @@ -142,7 +142,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return (rt_uint32_t)ptr - (rt_uint32_t)buffer; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; rt_err_t err_code; diff --git a/libcpu/xilinx/microblaze/serial.c b/libcpu/xilinx/microblaze/serial.c index 1902f11710..ea0070fb23 100755 --- a/libcpu/xilinx/microblaze/serial.c +++ b/libcpu/xilinx/microblaze/serial.c @@ -144,7 +144,7 @@ static rt_err_t rt_serial_close(rt_device_t dev) return RT_EOK; } -static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_mb_uart_lite *serial = (struct rt_mb_uart_lite*)dev; @@ -212,7 +212,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt return 0; } -static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) +static rt_ssize_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size) { rt_uint8_t* ptr; struct rt_mb_uart_lite *serial = (struct rt_mb_uart_lite*)dev; diff --git a/src/device.c b/src/device.c index beba062952..9665788c77 100644 --- a/src/device.c +++ b/src/device.c @@ -311,7 +311,7 @@ RTM_EXPORT(rt_device_close); * * @note the unit of size/pos is a block for block device. */ -rt_size_t rt_device_read(rt_device_t dev, +rt_ssize_t rt_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size) @@ -354,7 +354,7 @@ RTM_EXPORT(rt_device_read); * * @note the unit of size/pos is a block for block device. */ -rt_size_t rt_device_write(rt_device_t dev, +rt_ssize_t rt_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)