All function pointer types should be prefaced by the qualifier CODE (unless the callable function is known to reside in RAM, then it should be FAR).

This commit is contained in:
Gregory Nutt 2019-08-26 17:28:21 -06:00
parent 9bd850295e
commit dbd1bb1f1e
23 changed files with 44 additions and 40 deletions

View File

@ -254,8 +254,9 @@
* mode.
*/
typedef void (*addrenv_sigtramp_t)(_sa_sigaction_t sighand, int signo,
FAR siginfo_t *info, FAR void *ucontext);
typedef CODE void (*addrenv_sigtramp_t)(_sa_sigaction_t sighand, int signo,
FAR siginfo_t *info,
FAR void *ucontext);
/* This structure describes the format of the .bss/.data reserved area */

View File

@ -63,8 +63,8 @@
/* Type of the MCP2515 interrupt handling callback */
struct mcp2515_config_s; /* Forward reference */
typedef void (*mcp2515_handler_t)(FAR struct mcp2515_config_s *config,
FAR void *arg);
typedef CODE void (*mcp2515_handler_t)(FAR struct mcp2515_config_s *config,
FAR void *arg);
/* A reference to a structure of this type must be passed to the MCP2515
* driver when the driver is instantiated. This structure provides

View File

@ -62,10 +62,10 @@
* reload the read-ahead buffer, when appropriate.
*/
typedef ssize_t (*rwbreload_t)(FAR void *dev, FAR uint8_t *buffer,
off_t startblock, size_t nblocks);
typedef ssize_t (*rwbflush_t)(FAR void *dev, FAR const uint8_t *buffer,
off_t startblock, size_t nblocks);
typedef CODE ssize_t (*rwbreload_t)(FAR void *dev, FAR uint8_t *buffer,
off_t startblock, size_t nblocks);
typedef CODE ssize_t (*rwbflush_t)(FAR void *dev, FAR const uint8_t *buffer,
off_t startblock, size_t nblocks);
/* This structure holds the state of the buffers. In typical usage,
* an instance of this structure is declared within each block driver

View File

@ -54,7 +54,7 @@
/* Callback function used with env_foreach() */
typedef int (*env_foreach_t)(FAR void *arg, FAR const char *pair);
typedef CODE int (*env_foreach_t)(FAR void *arg, FAR const char *pair);
/****************************************************************************
* Public Function Prototypes

View File

@ -447,7 +447,7 @@
* handler but rather from the context of the worker thread with interrupts enabled.
*/
typedef void (*stmpe811_handler_t)(int pin);
typedef CODE void (*stmpe811_handler_t)(int pin);
/* A reference to a structure of this type must be passed to the STMPE811 driver when the
* driver is instantiated. This structure provides information about the configuration of the

View File

@ -312,8 +312,8 @@ typedef uint8_t ioe_pinset_t;
/* This type represents a pin interrupt callback function */
struct ioexpander_dev_s;
typedef int (*ioe_callback_t)(FAR struct ioexpander_dev_s *dev,
ioe_pinset_t pinset, FAR void *arg);
typedef CODE int (*ioe_callback_t)(FAR struct ioexpander_dev_s *dev,
ioe_pinset_t pinset, FAR void *arg);
#endif /* CONFIG_IOEXPANDER_INT_ENABLE */
/* I/O expander interface methods */

View File

@ -404,7 +404,7 @@ struct net_driver_s
void *d_private;
};
typedef int (*devif_poll_callback_t)(FAR struct net_driver_s *dev);
typedef CODE int (*devif_poll_callback_t)(FAR struct net_driver_s *dev);
/****************************************************************************
* Public Data

View File

@ -454,7 +454,7 @@ int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage);
#ifdef CONFIG_PAGING_BLOCKINGFILL
int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage);
#else
typedef void (*up_pgcallback_t)(FAR struct tcb_s *tcb, int result);
typedef CODE void (*up_pgcallback_t)(FAR struct tcb_s *tcb, int result);
int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage,
up_pgcallback_t pg_callback);
#endif

View File

@ -224,6 +224,7 @@ enum tstate_e
NUM_TASK_STATES /* Must be last */
};
typedef enum tstate_e tstate_t;
/* The following definitions are determined by tstate_t. Ordering of values
@ -250,6 +251,7 @@ union entry_u
pthread_startroutine_t pthread;
main_t main;
};
typedef union entry_u entry_t;
/* This is the type of the function called at task startup */
@ -785,7 +787,7 @@ struct pthread_tcb_s
/* This is the callback type used by sched_foreach() */
typedef void (*sched_foreach_t)(FAR struct tcb_s *tcb, FAR void *arg);
typedef CODE void (*sched_foreach_t)(FAR struct tcb_s *tcb, FAR void *arg);
#endif /* __ASSEMBLY__ */

View File

@ -279,7 +279,7 @@
* handler but rather from the context of the worker thread with interrupts enabled.
*/
typedef void (*adxl345_handler_t)(FAR struct adxl345_config_s *config, FAR void *arg);
typedef CODE void (*adxl345_handler_t)(FAR struct adxl345_config_s *config, FAR void *arg);
/* A reference to a structure of this type must be passed to the ADXL345 driver when the
* driver is instantiated. This structure provides information about the configuration of the

View File

@ -109,7 +109,7 @@
*/
struct xen1210_config_s;
typedef void (*xen1210_handler_t)(FAR struct xen1210_config_s *config, FAR void *arg);
typedef CODE void (*xen1210_handler_t)(FAR struct xen1210_config_s *config, FAR void *arg);
/* A reference to a structure of this type must be passed to the XEN1210 driver when the
* driver is instantiated. This structure provides information about the configuration of

View File

@ -495,7 +495,7 @@
/* The type of the media change callback function */
typedef void (*spi_mediachange_t)(FAR void *arg);
typedef CODE void (*spi_mediachange_t)(FAR void *arg);
/* If the board supports multiple SPI devices types, this enumeration
* identifies which is selected or de-selected.

View File

@ -93,7 +93,7 @@ struct spi_bitbang_ops_s
/* This is the type of the function that can exchange one bit */
typedef uint8_t (*bitexchange_t)(uint8_t dataout, uint32_t holdtime);
typedef CODE uint8_t (*bitexchange_t)(uint8_t dataout, uint32_t holdtime);
/* This structure provides the state of the SPI bit-bang driver */

View File

@ -51,11 +51,11 @@
/* These are the generic representations of a streams used by the NuttX */
struct lib_instream_s;
typedef int (*lib_getc_t)(FAR struct lib_instream_s *this);
typedef CODE int (*lib_getc_t)(FAR struct lib_instream_s *this);
struct lib_outstream_s;
typedef void (*lib_putc_t)(FAR struct lib_outstream_s *this, int ch);
typedef int (*lib_flush_t)(FAR struct lib_outstream_s *this);
typedef CODE void (*lib_putc_t)(FAR struct lib_outstream_s *this, int ch);
typedef CODE int (*lib_flush_t)(FAR struct lib_outstream_s *this);
struct lib_instream_s
{
@ -75,15 +75,15 @@ struct lib_outstream_s
/* Seek-able streams */
struct lib_sistream_s;
typedef int (*lib_sigetc_t)(FAR struct lib_sistream_s *this);
typedef off_t (*lib_siseek_t)(FAR struct lib_sistream_s *this, off_t offset,
int whence);
typedef CODE int (*lib_sigetc_t)(FAR struct lib_sistream_s *this);
typedef CODE off_t (*lib_siseek_t)(FAR struct lib_sistream_s *this,
off_t offset, int whence);
struct lib_sostream_s;
typedef void (*lib_soputc_t)(FAR struct lib_sostream_s *this, int ch);
typedef int (*lib_soflush_t)(FAR struct lib_sostream_s *this);
typedef off_t (*lib_soseek_t)(FAR struct lib_sostream_s *this, off_t offset,
int whence);
typedef CODE void (*lib_soputc_t)(FAR struct lib_sostream_s *this, int ch);
typedef CODE int (*lib_soflush_t)(FAR struct lib_sostream_s *this);
typedef CODE off_t (*lib_soseek_t)(FAR struct lib_sostream_s *this,
off_t offset, int whence);
struct lib_sistream_s
{

View File

@ -187,8 +187,8 @@
*/
struct oneshot_lowerhalf_s;
typedef void (*oneshot_callback_t)(FAR struct oneshot_lowerhalf_s *lower,
FAR void *arg);
typedef CODE void (*oneshot_callback_t)(FAR struct oneshot_lowerhalf_s *lower,
FAR void *arg);
/* The one short operations supported by the lower half driver */

View File

@ -323,7 +323,7 @@ enum cdcacm_event_e
CDCACM_EVENT_SENDBREAK /* Send break request received */
};
typedef FAR void (*cdcacm_callback_t)(enum cdcacm_event_e event);
typedef CODE void (*cdcacm_callback_t)(enum cdcacm_event_e event);
/****************************************************************************
* Public Function Prototypes

View File

@ -232,7 +232,7 @@ struct hid_rptinfo_s
* structure, false if it should be ignored.
*/
typedef bool (*hid_rptfilter_t)(FAR struct hid_rptitem_s *item);
typedef CODE bool (*hid_rptfilter_t)(FAR struct hid_rptitem_s *item);
/****************************************************************************
* Public Function Prototypes

View File

@ -421,7 +421,7 @@ struct trace_msg_t
/* Enumeration callback function signature */
typedef int (*trace_callback_t)(struct usbtrace_s *trace, void *arg);
typedef CODE int (*trace_callback_t)(struct usbtrace_s *trace, void *arg);
/* Bit mask input type for usbtrace_enable(). If TRACE_NIDS grows beyond
* 16, then this will have to be changed to uint32_t
@ -431,7 +431,7 @@ typedef uint16_t usbtrace_idset_t;
/* Print routine to use for usbdev_trprint() output */
typedef int (*trprintf_t)(const char *fmt, ...);
typedef CODE int (*trprintf_t)(const char *fmt, ...);
/****************************************************************************
* Public Data

View File

@ -85,7 +85,7 @@
/* Enumeration callback function signature */
typedef int (*usbhost_trcallback_t)(FAR uint32_t trace, FAR void *arg);
typedef CODE int (*usbhost_trcallback_t)(FAR uint32_t trace, FAR void *arg);
/****************************************************************************
* Public Data

View File

@ -446,7 +446,8 @@ typedef CODE uint8_t
struct bt_conn_s; /* Forward reference */
typedef void (*bt_gatt_rsp_func_t)(FAR struct bt_conn_s *conn, uint8_t err);
typedef CODE void (*bt_gatt_rsp_func_t)(FAR struct bt_conn_s *conn,
uint8_t err);
/* Read callback function
*

View File

@ -262,7 +262,7 @@ extern "C"
# define EXTERN extern
#endif
typedef int (*wait_cc1101_ready)(FAR struct cc1101_dev_s *dev, uint32_t);
typedef CODE int (*wait_cc1101_ready)(FAR struct cc1101_dev_s *dev, uint32_t);
struct cc1101_dev_s;
struct cc1101_ops_s

View File

@ -262,7 +262,7 @@
/* Defines the work callback */
typedef void (*worker_t)(FAR void *arg);
typedef CODE void (*worker_t)(FAR void *arg);
/* Defines one entry in the work queue. The user only needs this structure
* in order to declare instances of the work structure. Handling of all

View File

@ -231,7 +231,7 @@ typedef FAR void *pthread_addr_t;
#define __PTHREAD_ADDR_T_DEFINED 1
#endif
typedef pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t);
typedef CODE pthread_addr_t (*pthread_startroutine_t)(pthread_addr_t);
typedef pthread_startroutine_t pthread_func_t;
struct pthread_attr_s