Remove FAR from arm/risc-v/xtensa/sim/x86

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-05-14 16:01:52 +08:00
committed by Petro Karashchenko
parent f905563cc9
commit 51cf7ba05a
36 changed files with 136 additions and 147 deletions
+42 -42
View File
@@ -406,14 +406,14 @@ static bool g_apb1h_init = false;
/* Common TX logic */ /* Common TX logic */
static bool fdcan_txringfull(FAR struct fdcan_driver_s *priv); static bool fdcan_txringfull(struct fdcan_driver_s *priv);
static int fdcan_transmit(FAR struct fdcan_driver_s *priv); static int fdcan_transmit(struct fdcan_driver_s *priv);
static int fdcan_txpoll(struct net_driver_s *dev); static int fdcan_txpoll(struct net_driver_s *dev);
/* Helper functions */ /* Helper functions */
#ifdef CONFIG_STM32H7_FDCAN_REGDEBUG #ifdef CONFIG_STM32H7_FDCAN_REGDEBUG
static void fdcan_dumpregs(FAR struct fdcan_driver_s *priv); static void fdcan_dumpregs(struct fdcan_driver_s *priv);
#endif #endif
int32_t fdcan_bittiming(struct fdcan_bitseg *timing); int32_t fdcan_bittiming(struct fdcan_bitseg *timing);
@@ -431,20 +431,20 @@ static void fdcan_disable_interrupts(struct fdcan_driver_s *priv);
/* Interrupt handling */ /* Interrupt handling */
static void fdcan_receive(FAR struct fdcan_driver_s *priv); static void fdcan_receive(struct fdcan_driver_s *priv);
static void fdcan_receive_work(FAR void *arg); static void fdcan_receive_work(void *arg);
static void fdcan_txdone(FAR struct fdcan_driver_s *priv); static void fdcan_txdone(struct fdcan_driver_s *priv);
static void fdcan_txdone_work(FAR void *arg); static void fdcan_txdone_work(void *arg);
static int fdcan_interrupt(int irq, FAR void *context, static int fdcan_interrupt(int irq, void *context,
FAR void *arg); void *arg);
static void fdcan_check_errors(FAR struct fdcan_driver_s *priv); static void fdcan_check_errors(struct fdcan_driver_s *priv);
/* Watchdog timer expirations */ /* Watchdog timer expirations */
#ifdef TX_TIMEOUT_WQ #ifdef TX_TIMEOUT_WQ
static void fdcan_txtimeout_work(FAR void *arg); static void fdcan_txtimeout_work(void *arg);
static void fdcan_txtimeout_expiry(wdparm_t arg); static void fdcan_txtimeout_expiry(wdparm_t arg);
#endif #endif
@@ -453,7 +453,7 @@ static void fdcan_txtimeout_expiry(wdparm_t arg);
static int fdcan_ifup(struct net_driver_s *dev); static int fdcan_ifup(struct net_driver_s *dev);
static int fdcan_ifdown(struct net_driver_s *dev); static int fdcan_ifdown(struct net_driver_s *dev);
static void fdcan_txavail_work(FAR void *arg); static void fdcan_txavail_work(void *arg);
static int fdcan_txavail(struct net_driver_s *dev); static int fdcan_txavail(struct net_driver_s *dev);
#ifdef CONFIG_NETDEV_IOCTL #ifdef CONFIG_NETDEV_IOCTL
@@ -477,7 +477,7 @@ static void fdcan_reset(struct fdcan_driver_s *priv);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_STM32H7_FDCAN_REGDEBUG #ifdef CONFIG_STM32H7_FDCAN_REGDEBUG
static void fdcan_dumpregs(FAR struct fdcan_driver_s *priv) static void fdcan_dumpregs(struct fdcan_driver_s *priv)
{ {
printf("-------------- FDCAN Reg Dump ----------------\n"); printf("-------------- FDCAN Reg Dump ----------------\n");
printf("CAN%d Base: 0x%lx\n", priv->iface_idx, priv->base); printf("CAN%d Base: 0x%lx\n", priv->iface_idx, priv->base);
@@ -679,7 +679,7 @@ int32_t fdcan_bittiming(struct fdcan_bitseg *timing)
* *
****************************************************************************/ ****************************************************************************/
static bool fdcan_txringfull(FAR struct fdcan_driver_s *priv) static bool fdcan_txringfull(struct fdcan_driver_s *priv)
{ {
/* TODO: Decide if this needs to be checked every time, or just during init /* TODO: Decide if this needs to be checked every time, or just during init
* Check that we even _have_ a Tx FIFO allocated * Check that we even _have_ a Tx FIFO allocated
@@ -723,7 +723,7 @@ static bool fdcan_txringfull(FAR struct fdcan_driver_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static int fdcan_transmit(FAR struct fdcan_driver_s *priv) static int fdcan_transmit(struct fdcan_driver_s *priv)
{ {
irqstate_t flags = enter_critical_section(); irqstate_t flags = enter_critical_section();
@@ -925,8 +925,8 @@ static int fdcan_transmit(FAR struct fdcan_driver_s *priv)
static int fdcan_txpoll(struct net_driver_s *dev) static int fdcan_txpoll(struct net_driver_s *dev)
{ {
FAR struct fdcan_driver_s *priv = struct fdcan_driver_s *priv =
(FAR struct fdcan_driver_s *)dev->d_private; (struct fdcan_driver_s *)dev->d_private;
/* If the polling resulted in data that should be sent out on the network, /* If the polling resulted in data that should be sent out on the network,
* the field d_len is set to a value > 0. * the field d_len is set to a value > 0.
@@ -970,7 +970,7 @@ static int fdcan_txpoll(struct net_driver_s *dev)
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_receive(FAR struct fdcan_driver_s *priv) static void fdcan_receive(struct fdcan_driver_s *priv)
{ {
/* Check the interrupt value to determine which FIFO to read */ /* Check the interrupt value to determine which FIFO to read */
@@ -1025,11 +1025,11 @@ static void fdcan_receive(FAR struct fdcan_driver_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_receive_work(FAR void *arg) static void fdcan_receive_work(void *arg)
{ {
irqstate_t flags = enter_critical_section(); irqstate_t flags = enter_critical_section();
FAR struct fdcan_driver_s *priv = (FAR struct fdcan_driver_s *)arg; struct fdcan_driver_s *priv = (struct fdcan_driver_s *)arg;
/* Check which FIFO triggered this work */ /* Check which FIFO triggered this work */
@@ -1234,7 +1234,7 @@ static void fdcan_receive_work(FAR void *arg)
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_txdone(FAR struct fdcan_driver_s *priv) static void fdcan_txdone(struct fdcan_driver_s *priv)
{ {
/* Read and reset the interrupt flag */ /* Read and reset the interrupt flag */
@@ -1272,11 +1272,11 @@ static void fdcan_txdone(FAR struct fdcan_driver_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_txdone_work(FAR void *arg) static void fdcan_txdone_work(void *arg)
{ {
irqstate_t flags = enter_critical_section(); irqstate_t flags = enter_critical_section();
FAR struct fdcan_driver_s *priv = (FAR struct fdcan_driver_s *)arg; struct fdcan_driver_s *priv = (struct fdcan_driver_s *)arg;
/* Update counters for successful transmissions */ /* Update counters for successful transmissions */
@@ -1340,8 +1340,8 @@ static void fdcan_txdone_work(FAR void *arg)
* *
****************************************************************************/ ****************************************************************************/
static int fdcan_interrupt(int irq, FAR void *context, static int fdcan_interrupt(int irq, void *context,
FAR void *arg) void *arg)
{ {
switch (irq) switch (irq)
{ {
@@ -1399,7 +1399,7 @@ static int fdcan_interrupt(int irq, FAR void *context,
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_check_errors(FAR struct fdcan_driver_s *priv) static void fdcan_check_errors(struct fdcan_driver_s *priv)
{ {
/* Read CAN Error Logging counter (This also resets the error counter) */ /* Read CAN Error Logging counter (This also resets the error counter) */
@@ -1460,9 +1460,9 @@ static void fdcan_check_errors(FAR struct fdcan_driver_s *priv)
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_txtimeout_work(FAR void *arg) static void fdcan_txtimeout_work(void *arg)
{ {
FAR struct fdcan_driver_s *priv = (FAR struct fdcan_driver_s *)arg; struct fdcan_driver_s *priv = (struct fdcan_driver_s *)arg;
struct timespec ts; struct timespec ts;
struct timeval *now = (struct timeval *)&ts; struct timeval *now = (struct timeval *)&ts;
@@ -1503,7 +1503,7 @@ static void fdcan_txtimeout_work(FAR void *arg)
static void fdcan_txtimeout_expiry(wdparm_t arg) static void fdcan_txtimeout_expiry(wdparm_t arg)
{ {
FAR struct fdcan_driver_s *priv = (FAR struct fdcan_driver_s *)arg; struct fdcan_driver_s *priv = (struct fdcan_driver_s *)arg;
/* Schedule to perform the TX timeout processing on the worker thread */ /* Schedule to perform the TX timeout processing on the worker thread */
@@ -1725,8 +1725,8 @@ static void fdcan_disable_interrupts(struct fdcan_driver_s *priv)
static int fdcan_ifup(struct net_driver_s *dev) static int fdcan_ifup(struct net_driver_s *dev)
{ {
FAR struct fdcan_driver_s *priv = struct fdcan_driver_s *priv =
(FAR struct fdcan_driver_s *)dev->d_private; (struct fdcan_driver_s *)dev->d_private;
/* Wake up the device and perform all initialization */ /* Wake up the device and perform all initialization */
@@ -1774,8 +1774,8 @@ static int fdcan_ifup(struct net_driver_s *dev)
static int fdcan_ifdown(struct net_driver_s *dev) static int fdcan_ifdown(struct net_driver_s *dev)
{ {
FAR struct fdcan_driver_s *priv = struct fdcan_driver_s *priv =
(FAR struct fdcan_driver_s *)dev->d_private; (struct fdcan_driver_s *)dev->d_private;
fdcan_reset(priv); fdcan_reset(priv);
@@ -1801,9 +1801,9 @@ static int fdcan_ifdown(struct net_driver_s *dev)
* *
****************************************************************************/ ****************************************************************************/
static void fdcan_txavail_work(FAR void *arg) static void fdcan_txavail_work(void *arg)
{ {
FAR struct fdcan_driver_s *priv = (FAR struct fdcan_driver_s *)arg; struct fdcan_driver_s *priv = (struct fdcan_driver_s *)arg;
/* Ignore the notification if the interface is not yet up */ /* Ignore the notification if the interface is not yet up */
@@ -1848,8 +1848,8 @@ static void fdcan_txavail_work(FAR void *arg)
static int fdcan_txavail(struct net_driver_s *dev) static int fdcan_txavail(struct net_driver_s *dev)
{ {
FAR struct fdcan_driver_s *priv = struct fdcan_driver_s *priv =
(FAR struct fdcan_driver_s *)dev->d_private; (struct fdcan_driver_s *)dev->d_private;
/* Is our single work structure available? It may not be if there are /* Is our single work structure available? It may not be if there are
* pending interrupt actions and we will have to ignore the Tx * pending interrupt actions and we will have to ignore the Tx
@@ -1888,7 +1888,7 @@ static int fdcan_txavail(struct net_driver_s *dev)
static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd, static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd,
unsigned long arg) unsigned long arg)
{ {
FAR struct fdcan_driver_s *priv = dev->d_private; struct fdcan_driver_s *priv = dev->d_private;
int ret; int ret;
@@ -1936,7 +1936,7 @@ static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd,
{ {
/* TODO: Add hardware-level filter... */ /* TODO: Add hardware-level filter... */
stm32_addextfilter(priv, (FAR struct canioc_extfilter_s *)arg); stm32_addextfilter(priv, (struct canioc_extfilter_s *)arg);
} }
break; break;
@@ -1944,7 +1944,7 @@ static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd,
{ {
/* TODO: Delete hardware-level filter... */ /* TODO: Delete hardware-level filter... */
stm32_delextfilter(priv, (FAR struct canioc_extfilter_s *)arg); stm32_delextfilter(priv, (struct canioc_extfilter_s *)arg);
} }
break; break;
@@ -1952,7 +1952,7 @@ static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd,
{ {
/* TODO: Add hardware-level filter... */ /* TODO: Add hardware-level filter... */
stm32_addstdfilter(priv, (FAR struct canioc_stdfilter_s *)arg); stm32_addstdfilter(priv, (struct canioc_stdfilter_s *)arg);
} }
break; break;
@@ -1960,7 +1960,7 @@ static int fdcan_netdev_ioctl(struct net_driver_s *dev, int cmd,
{ {
/* TODO: Delete hardware-level filter... */ /* TODO: Delete hardware-level filter... */
stm32_delstdfilter(priv, (FAR struct canioc_stdfilter_s *)arg); stm32_delstdfilter(priv, (struct canioc_stdfilter_s *)arg);
} }
break; break;
#endif #endif
+2 -2
View File
@@ -64,9 +64,9 @@
* *
****************************************************************************/ ****************************************************************************/
void up_allocate_heap(FAR void **heap_start, size_t *heap_size) void up_allocate_heap(void **heap_start, size_t *heap_size)
{ {
board_autoled_on(LED_HEAPALLOCATE); board_autoled_on(LED_HEAPALLOCATE);
*heap_start = (FAR void *)g_idle_topstack; *heap_start = (void *)g_idle_topstack;
*heap_size = CONFIG_RAM_END - g_idle_topstack; *heap_size = CONFIG_RAM_END - g_idle_topstack;
} }
+3 -3
View File
@@ -95,7 +95,7 @@ static void x86_stackdump(uint32_t sp, uint32_t stack_top)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_USBDUMP #ifdef CONFIG_ARCH_USBDUMP
static int usbtrace_syslog(FAR const char *fmt, ...) static int usbtrace_syslog(const char *fmt, ...)
{ {
va_list ap; va_list ap;
@@ -107,7 +107,7 @@ static int usbtrace_syslog(FAR const char *fmt, ...)
return OK; return OK;
} }
static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg) static int assert_tracecallback(struct usbtrace_s *trace, void *arg)
{ {
usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value); usbtrace_trprintf(usbtrace_syslog, trace->event, trace->value);
return 0; return 0;
@@ -121,7 +121,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
#ifdef CONFIG_ARCH_STACKDUMP #ifdef CONFIG_ARCH_STACKDUMP
static void up_dumpstate(void) static void up_dumpstate(void)
{ {
FAR struct tcb_s *rtcb = running_task(); struct tcb_s *rtcb = running_task();
uint32_t sp = up_getsp(); uint32_t sp = up_getsp();
uint32_t ustackbase; uint32_t ustackbase;
uint32_t ustacksize; uint32_t ustacksize;
+2 -2
View File
@@ -61,9 +61,9 @@
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DUMP_ON_EXIT #ifdef CONFIG_DUMP_ON_EXIT
static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) static void _up_dumponexit(struct tcb_s *tcb, void *arg)
{ {
FAR struct filelist *filelist; struct filelist *filelist;
int i; int i;
int j; int j;
+1 -1
View File
@@ -88,7 +88,7 @@
* *
****************************************************************************/ ****************************************************************************/
int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
{ {
#ifdef CONFIG_TLS_ALIGNED #ifdef CONFIG_TLS_ALIGNED
/* The allocated stack size must not exceed the maximum possible for the /* The allocated stack size must not exceed the maximum possible for the
+1 -1
View File
@@ -75,7 +75,7 @@
* *
****************************************************************************/ ****************************************************************************/
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype) void up_release_stack(struct tcb_s *dtcb, uint8_t ttype)
{ {
/* Is there a stack allocated? */ /* Is there a stack allocated? */
+3 -3
View File
@@ -69,9 +69,9 @@
* *
****************************************************************************/ ****************************************************************************/
FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size) void *up_stack_frame(struct tcb_s *tcb, size_t frame_size)
{ {
FAR void *ret; void *ret;
/* Align the frame_size */ /* Align the frame_size */
@@ -89,7 +89,7 @@ FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
/* Save the adjusted stack values in the struct tcb_s */ /* Save the adjusted stack values in the struct tcb_s */
tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size; tcb->stack_base_ptr = (uint8_t *)tcb->stack_base_ptr + frame_size;
tcb->adj_stack_size -= frame_size; tcb->adj_stack_size -= frame_size;
/* And return the pointer to the allocated region */ /* And return the pointer to the allocated region */
+6 -6
View File
@@ -197,7 +197,7 @@ int i486_dumpgpio(uint16_t pinset, const char *msg);
* *
****************************************************************************/ ****************************************************************************/
FAR struct spi_dev_s *i486_spibus_initialize(int port); struct spi_dev_s *i486_spibus_initialize(int port);
/**************************************************************************** /****************************************************************************
* Name: i486_spi/ssp0/ssp1select, i486_spi/ssp0/ssp1status, and * Name: i486_spi/ssp0/ssp1select, i486_spi/ssp0/ssp1status, and
@@ -230,11 +230,11 @@ FAR struct spi_dev_s *i486_spibus_initialize(int port);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_I486_SPI #ifdef CONFIG_I486_SPI
void i486_spiselect(FAR struct spi_dev_s *dev, void i486_spiselect(struct spi_dev_s *dev,
uint32_t devid, bool selected); uint32_t devid, bool selected);
uint8_t i486_spistatus(FAR struct spi_dev_s *dev, uint32_t devid); uint8_t i486_spistatus(struct spi_dev_s *dev, uint32_t devid);
#ifdef CONFIG_SPI_CMDDATA #ifdef CONFIG_SPI_CMDDATA
int i486_spicmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd); int i486_spicmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd);
#endif #endif
#endif #endif
@@ -255,10 +255,10 @@ int i486_spicmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_I486_SPI #ifdef CONFIG_I486_SPI
void spi_flush(FAR struct spi_dev_s *dev); void spi_flush(struct spi_dev_s *dev);
#endif #endif
#if defined(CONFIG_I486_SSP0) || defined(CONFIG_I486_SSP1) #if defined(CONFIG_I486_SSP0) || defined(CONFIG_I486_SSP1)
void ssp_flush(FAR struct spi_dev_s *dev); void ssp_flush(struct spi_dev_s *dev);
#endif #endif
/**************************************************************************** /****************************************************************************
+2 -2
View File
@@ -203,7 +203,7 @@ typedef enum
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen); static ssize_t keypad_read(struct file *filep, char *buf, size_t buflen);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -267,7 +267,7 @@ static const struct file_operations g_keypadops =
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
static ssize_t keypad_read(struct file *filep, FAR char *buf, size_t buflen) static ssize_t keypad_read(struct file *filep, char *buf, size_t buflen)
{ {
uint_fast8_t keycode = 0; uint_fast8_t keycode = 0;
uint_fast8_t scancode = 0; uint_fast8_t scancode = 0;
+19 -19
View File
@@ -97,22 +97,22 @@
static int init_graph_vga(int width, int height, int chain4); static int init_graph_vga(int width, int height, int chain4);
static int vga_putrun(fb_coord_t row, static int vga_putrun(fb_coord_t row,
fb_coord_t col, FAR const uint8_t *buffer, fb_coord_t col, const uint8_t *buffer,
size_t npixels); size_t npixels);
static int vga_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, static int vga_getrun(fb_coord_t row, fb_coord_t col, uint8_t *buffer,
size_t npixels); size_t npixels);
static int vga_getvideoinfo(FAR struct lcd_dev_s *dev, static int vga_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo); struct fb_videoinfo_s *vinfo);
static int vga_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int vga_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo); struct lcd_planeinfo_s *pinfo);
static int vga_getpower(struct lcd_dev_s *dev); static int vga_getpower(struct lcd_dev_s *dev);
static int vga_setpower(struct lcd_dev_s *dev, int power); static int vga_setpower(struct lcd_dev_s *dev, int power);
static int vga_getcontrast(struct lcd_dev_s *dev); static int vga_getcontrast(struct lcd_dev_s *dev);
static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast); static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast);
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen); static ssize_t vga_read(struct file *filep, char *buf, size_t buflen);
static ssize_t vga_write(struct file *filep, FAR const char *buf, static ssize_t vga_write(struct file *filep, const char *buf,
size_t buflen); size_t buflen);
static off_t vga_seek(FAR struct file *filp, off_t offset, int whence); static off_t vga_seek(struct file *filp, off_t offset, int whence);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -415,22 +415,22 @@ static int init_graph_vga(int width, int height, int chain4)
} }
static int vga_putrun(fb_coord_t row, static int vga_putrun(fb_coord_t row,
fb_coord_t col, FAR const uint8_t *buffer, fb_coord_t col, const uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
memcpy(&g_pscreen[row*VGA_XRES + col], buffer, npixels); memcpy(&g_pscreen[row*VGA_XRES + col], buffer, npixels);
return OK; return OK;
} }
static int vga_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, static int vga_getrun(fb_coord_t row, fb_coord_t col, uint8_t *buffer,
size_t npixels) size_t npixels)
{ {
memcpy(buffer, &g_pscreen[row*VGA_XRES + col], npixels); memcpy(buffer, &g_pscreen[row*VGA_XRES + col], npixels);
return OK; return OK;
} }
static int vga_getvideoinfo(FAR struct lcd_dev_s *dev, static int vga_getvideoinfo(struct lcd_dev_s *dev,
FAR struct fb_videoinfo_s *vinfo) struct fb_videoinfo_s *vinfo)
{ {
vinfo->fmt = VGA_COLORFMT; vinfo->fmt = VGA_COLORFMT;
vinfo->xres = VGA_XRES; /* Horizontal resolution in pixel columns */ vinfo->xres = VGA_XRES; /* Horizontal resolution in pixel columns */
@@ -439,8 +439,8 @@ static int vga_getvideoinfo(FAR struct lcd_dev_s *dev,
return OK; return OK;
} }
static int vga_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, static int vga_getplaneinfo(struct lcd_dev_s *dev, unsigned int planeno,
FAR struct lcd_planeinfo_s *pinfo) struct lcd_planeinfo_s *pinfo)
{ {
pinfo->putrun = vga_putrun; /* Put a run into LCD memory */ pinfo->putrun = vga_putrun; /* Put a run into LCD memory */
pinfo->getrun = vga_getrun; /* Get a run from LCD memory */ pinfo->getrun = vga_getrun; /* Get a run from LCD memory */
@@ -470,7 +470,7 @@ static int vga_setcontrast(struct lcd_dev_s *dev, unsigned int contrast)
return -ENOSYS; return -ENOSYS;
} }
static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen) static ssize_t vga_read(struct file *filep, char *buf, size_t buflen)
{ {
if (buf == NULL || buflen < 1) if (buf == NULL || buflen < 1)
{ {
@@ -482,7 +482,7 @@ static ssize_t vga_read(struct file *filep, FAR char *buf, size_t buflen)
return buflen; return buflen;
} }
static ssize_t vga_write(struct file *filep, FAR const char *buf, static ssize_t vga_write(struct file *filep, const char *buf,
size_t buflen) size_t buflen)
{ {
int i; int i;
@@ -506,7 +506,7 @@ static ssize_t vga_write(struct file *filep, FAR const char *buf,
return buflen; return buflen;
} }
static off_t vga_seek(FAR struct file *filp, off_t offset, int whence) static off_t vga_seek(struct file *filp, off_t offset, int whence)
{ {
ssize_t newpos; ssize_t newpos;
@@ -559,7 +559,7 @@ static off_t vga_seek(FAR struct file *filp, off_t offset, int whence)
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *qemu_vga_initialize(void) struct lcd_dev_s *qemu_vga_initialize(void)
{ {
int ret = init_graph_vga(VGA_XRES, VGA_YRES, 1); int ret = init_graph_vga(VGA_XRES, VGA_YRES, 1);
if (ret < 0) if (ret < 0)
+1 -1
View File
@@ -51,7 +51,7 @@
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *qemu_vga_initialize(void); struct lcd_dev_s *qemu_vga_initialize(void);
void qemu_vga(void); void qemu_vga(void);
@@ -143,10 +143,10 @@
* *
****************************************************************************/ ****************************************************************************/
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) struct lcd_dev_s *board_graphics_setup(unsigned int devno)
{ {
FAR struct spi_dev_s *spi; struct spi_dev_s *spi;
FAR struct lcd_dev_s *dev; struct lcd_dev_s *dev;
/* Configure the OLED PORTs. This initial configuration is RESET low, /* Configure the OLED PORTs. This initial configuration is RESET low,
* putting the OLED into reset state. * putting the OLED into reset state.
@@ -51,7 +51,7 @@
* *
****************************************************************************/ ****************************************************************************/
void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) void stm32_usbsuspend(struct usbdev_s *dev, bool resume)
{ {
uinfo("resume: %d\n", resume); uinfo("resume: %d\n", resume);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void weak_function __aeabi_memclr(FAR void *s, size_t n) void weak_function __aeabi_memclr(void *s, size_t n)
{ {
memset(s, 0, n); memset(s, 0, n);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void weak_function __aeabi_memclr4(FAR void *s, size_t n) void weak_function __aeabi_memclr4(void *s, size_t n)
{ {
memset(s, 0, n); memset(s, 0, n);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void weak_function __aeabi_memclr8(FAR void *s, size_t n) void weak_function __aeabi_memclr8(void *s, size_t n)
{ {
memset(s, 0, n); memset(s, 0, n);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
void weak_function void weak_function
__aeabi_memcpy(FAR void *dest, FAR const void *src, size_t n) __aeabi_memcpy(void *dest, const void *src, size_t n)
{ {
memcpy(dest, src, n); memcpy(dest, src, n);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
void weak_function void weak_function
__aeabi_memcpy4(FAR void *dest, FAR const void *src, size_t n) __aeabi_memcpy4(void *dest, const void *src, size_t n)
{ {
memcpy(dest, src, n); memcpy(dest, src, n);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
void weak_function void weak_function
__aeabi_memcpy8(FAR void *dest, FAR const void *src, size_t n) __aeabi_memcpy8(void *dest, const void *src, size_t n)
{ {
memcpy(dest, src, n); memcpy(dest, src, n);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
void weak_function void weak_function
__aeabi_memmove(FAR void *dest, FAR const void *src, size_t n) __aeabi_memmove(void *dest, const void *src, size_t n)
{ {
memmove(dest, src, n); memmove(dest, src, n);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
void weak_function void weak_function
__aeabi_memmove4(FAR void *dest, FAR const void *src, size_t n) __aeabi_memmove4(void *dest, const void *src, size_t n)
{ {
memmove(dest, src, n); memmove(dest, src, n);
} }
+1 -1
View File
@@ -29,7 +29,7 @@
****************************************************************************/ ****************************************************************************/
void weak_function void weak_function
__aeabi_memmove8(FAR void *dest, FAR const void *src, size_t n) __aeabi_memmove8(void *dest, const void *src, size_t n)
{ {
memmove(dest, src, n); memmove(dest, src, n);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void weak_function __aeabi_memset(FAR void *s, size_t n, int c) void weak_function __aeabi_memset(void *s, size_t n, int c)
{ {
memset(s, c, n); memset(s, c, n);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void weak_function __aeabi_memset4(FAR void *s, size_t n, int c) void weak_function __aeabi_memset4(void *s, size_t n, int c)
{ {
memset(s, c, n); memset(s, c, n);
} }
+1 -1
View File
@@ -28,7 +28,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
void weak_function __aeabi_memset8(FAR void *s, size_t n, int c) void weak_function __aeabi_memset8(void *s, size_t n, int c)
{ {
memset(s, c, n); memset(s, c, n);
} }
+3 -4
View File
@@ -63,7 +63,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an ARM executable */ /* Make sure it's an ARM executable */
@@ -131,8 +131,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
int32_t offset; int32_t offset;
unsigned int relotype; unsigned int relotype;
@@ -265,7 +264,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: RELA relocation not supported\n"); berr("ERROR: RELA relocation not supported\n");
+3 -4
View File
@@ -63,7 +63,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an ARM executable */ /* Make sure it's an ARM executable */
@@ -122,8 +122,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
int32_t offset; int32_t offset;
uint32_t upper_insn; uint32_t upper_insn;
@@ -460,7 +459,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: RELA relocation not supported\n"); berr("ERROR: RELA relocation not supported\n");
+3 -4
View File
@@ -52,7 +52,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an ARM executable */ /* Make sure it's an ARM executable */
@@ -124,8 +124,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
int32_t offset; int32_t offset;
unsigned int relotype; unsigned int relotype;
@@ -475,7 +474,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: RELA relocation not supported\n"); berr("ERROR: RELA relocation not supported\n");
+3 -4
View File
@@ -52,7 +52,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an ARM executable */ /* Make sure it's an ARM executable */
@@ -111,8 +111,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
int32_t offset; int32_t offset;
uint32_t upper_insn; uint32_t upper_insn;
@@ -503,7 +502,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: RELA relocation not supported\n"); berr("ERROR: RELA relocation not supported\n");
+3 -4
View File
@@ -63,7 +63,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an ARM executable */ /* Make sure it's an ARM executable */
@@ -131,8 +131,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
int32_t offset; int32_t offset;
unsigned int relotype; unsigned int relotype;
@@ -258,7 +257,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: RELA relocation not supported\n"); berr("ERROR: RELA relocation not supported\n");
+3 -4
View File
@@ -52,7 +52,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an ARM executable */ /* Make sure it's an ARM executable */
@@ -111,8 +111,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
int32_t offset; int32_t offset;
uint32_t upper_insn; uint32_t upper_insn;
@@ -503,7 +502,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: RELA relocation not supported\n"); berr("ERROR: RELA relocation not supported\n");
+3 -4
View File
@@ -202,7 +202,7 @@ static void _calc_imm(long offset, long *imm_hi, long *imm_lo)
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf_Ehdr *ehdr) bool up_checkarch(const Elf_Ehdr *ehdr)
{ {
/* Make sure it's an RISCV executable */ /* Make sure it's an RISCV executable */
@@ -270,14 +270,13 @@ bool up_checkarch(FAR const Elf_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf_Rel *rel, FAR const Elf_Sym *sym, int up_relocate(const Elf_Rel *rel, const Elf_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
berr("Not implemented\n"); berr("Not implemented\n");
return -ENOSYS; return -ENOSYS;
} }
int up_relocateadd(FAR const Elf_Rela *rel, FAR const Elf_Sym *sym, int up_relocateadd(const Elf_Rela *rel, const Elf_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
long offset; long offset;
+4 -5
View File
@@ -60,7 +60,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *hdr) bool up_checkarch(const Elf32_Ehdr *hdr)
{ {
return hdr->e_machine == EM_386 || hdr->e_machine == EM_486; return hdr->e_machine == EM_386 || hdr->e_machine == EM_486;
} }
@@ -87,10 +87,9 @@ bool up_checkarch(FAR const Elf32_Ehdr *hdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
FAR uint32_t *ptr = (FAR uint32_t *)addr; uint32_t *ptr = (uint32_t *)addr;
/* All relocations depend upon having valid symbol information. */ /* All relocations depend upon having valid symbol information. */
@@ -119,7 +118,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
berr("ERROR: Not supported\n"); berr("ERROR: Not supported\n");
+3 -4
View File
@@ -81,7 +81,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf64_Ehdr *ehdr) bool up_checkarch(const Elf64_Ehdr *ehdr)
{ {
/* Make sure it's an x86_64 executable */ /* Make sure it's an x86_64 executable */
@@ -140,14 +140,13 @@ bool up_checkarch(FAR const Elf64_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf64_Rel *rel, FAR const Elf64_Sym *sym, int up_relocate(const Elf64_Rel *rel, const Elf64_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
berr("Not implemented\n"); berr("Not implemented\n");
return -ENOSYS; return -ENOSYS;
} }
int up_relocateadd(FAR const Elf64_Rela *rel, FAR const Elf64_Sym *sym, int up_relocateadd(const Elf64_Rela *rel, const Elf64_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
unsigned int relotype; unsigned int relotype;
+4 -5
View File
@@ -68,7 +68,7 @@
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *hdr) bool up_checkarch(const Elf32_Ehdr *hdr)
{ {
return hdr->e_machine == EM_386 || hdr->e_machine == EM_486; return hdr->e_machine == EM_386 || hdr->e_machine == EM_486;
} }
@@ -95,10 +95,9 @@ bool up_checkarch(FAR const Elf32_Ehdr *hdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
FAR uint32_t *ptr = (FAR uint32_t *)addr; uint32_t *ptr = (uint32_t *)addr;
/* All relocations depend upon having valid symbol information. */ /* All relocations depend upon having valid symbol information. */
@@ -126,7 +125,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
bwarn("WARNING: Not supported\n"); bwarn("WARNING: Not supported\n");
+6 -7
View File
@@ -44,7 +44,7 @@
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
static bool is_l32r(FAR const unsigned char *p) static bool is_l32r(const unsigned char *p)
{ {
return (p[0] & 0xf) == 1; return (p[0] & 0xf) == 1;
} }
@@ -69,7 +69,7 @@ static bool is_l32r(FAR const unsigned char *p)
* *
****************************************************************************/ ****************************************************************************/
bool up_checkarch(FAR const Elf32_Ehdr *ehdr) bool up_checkarch(const Elf32_Ehdr *ehdr)
{ {
/* Make sure it's an Xtensa executable */ /* Make sure it's an Xtensa executable */
@@ -127,8 +127,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
* *
****************************************************************************/ ****************************************************************************/
int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
uintptr_t addr)
{ {
unsigned int relotype; unsigned int relotype;
@@ -160,7 +159,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
return OK; return OK;
} }
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym, int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
uintptr_t addr) uintptr_t addr)
{ {
unsigned int relotype; unsigned int relotype;
@@ -192,7 +191,7 @@ int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
break; break;
case R_XTENSA_32: case R_XTENSA_32:
(*(FAR uint32_t *)addr) += value; (*(uint32_t *)addr) += value;
break; break;
case R_XTENSA_ASM_EXPAND: case R_XTENSA_ASM_EXPAND:
@@ -201,7 +200,7 @@ int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
break; break;
case R_XTENSA_SLOT0_OP: case R_XTENSA_SLOT0_OP:
p = (FAR unsigned char *)addr; p = (unsigned char *)addr;
if (is_l32r(p)) if (is_l32r(p))
{ {
/* Xtensa ISA: /* Xtensa ISA: