mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
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:
@@ -254,8 +254,9 @@
|
|||||||
* mode.
|
* mode.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef void (*addrenv_sigtramp_t)(_sa_sigaction_t sighand, int signo,
|
typedef CODE void (*addrenv_sigtramp_t)(_sa_sigaction_t sighand, int signo,
|
||||||
FAR siginfo_t *info, FAR void *ucontext);
|
FAR siginfo_t *info,
|
||||||
|
FAR void *ucontext);
|
||||||
|
|
||||||
/* This structure describes the format of the .bss/.data reserved area */
|
/* This structure describes the format of the .bss/.data reserved area */
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,8 @@
|
|||||||
/* Type of the MCP2515 interrupt handling callback */
|
/* Type of the MCP2515 interrupt handling callback */
|
||||||
|
|
||||||
struct mcp2515_config_s; /* Forward reference */
|
struct mcp2515_config_s; /* Forward reference */
|
||||||
typedef void (*mcp2515_handler_t)(FAR struct mcp2515_config_s *config,
|
typedef CODE void (*mcp2515_handler_t)(FAR struct mcp2515_config_s *config,
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
|
|
||||||
/* A reference to a structure of this type must be passed to the MCP2515
|
/* A reference to a structure of this type must be passed to the MCP2515
|
||||||
* driver when the driver is instantiated. This structure provides
|
* driver when the driver is instantiated. This structure provides
|
||||||
|
|||||||
@@ -62,10 +62,10 @@
|
|||||||
* reload the read-ahead buffer, when appropriate.
|
* reload the read-ahead buffer, when appropriate.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef ssize_t (*rwbreload_t)(FAR void *dev, FAR uint8_t *buffer,
|
typedef CODE ssize_t (*rwbreload_t)(FAR void *dev, FAR uint8_t *buffer,
|
||||||
off_t startblock, size_t nblocks);
|
off_t startblock, size_t nblocks);
|
||||||
typedef ssize_t (*rwbflush_t)(FAR void *dev, FAR const uint8_t *buffer,
|
typedef CODE ssize_t (*rwbflush_t)(FAR void *dev, FAR const uint8_t *buffer,
|
||||||
off_t startblock, size_t nblocks);
|
off_t startblock, size_t nblocks);
|
||||||
|
|
||||||
/* This structure holds the state of the buffers. In typical usage,
|
/* This structure holds the state of the buffers. In typical usage,
|
||||||
* an instance of this structure is declared within each block driver
|
* an instance of this structure is declared within each block driver
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
/* Callback function used with env_foreach() */
|
/* 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
|
* Public Function Prototypes
|
||||||
|
|||||||
@@ -447,7 +447,7 @@
|
|||||||
* handler but rather from the context of the worker thread with interrupts enabled.
|
* 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
|
/* 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
|
* driver is instantiated. This structure provides information about the configuration of the
|
||||||
|
|||||||
@@ -312,8 +312,8 @@ typedef uint8_t ioe_pinset_t;
|
|||||||
/* This type represents a pin interrupt callback function */
|
/* This type represents a pin interrupt callback function */
|
||||||
|
|
||||||
struct ioexpander_dev_s;
|
struct ioexpander_dev_s;
|
||||||
typedef int (*ioe_callback_t)(FAR struct ioexpander_dev_s *dev,
|
typedef CODE int (*ioe_callback_t)(FAR struct ioexpander_dev_s *dev,
|
||||||
ioe_pinset_t pinset, FAR void *arg);
|
ioe_pinset_t pinset, FAR void *arg);
|
||||||
#endif /* CONFIG_IOEXPANDER_INT_ENABLE */
|
#endif /* CONFIG_IOEXPANDER_INT_ENABLE */
|
||||||
|
|
||||||
/* I/O expander interface methods */
|
/* I/O expander interface methods */
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ struct net_driver_s
|
|||||||
void *d_private;
|
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
|
* Public Data
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ int up_allocpage(FAR struct tcb_s *tcb, FAR void **vpage);
|
|||||||
#ifdef CONFIG_PAGING_BLOCKINGFILL
|
#ifdef CONFIG_PAGING_BLOCKINGFILL
|
||||||
int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage);
|
int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage);
|
||||||
#else
|
#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,
|
int up_fillpage(FAR struct tcb_s *tcb, FAR void *vpage,
|
||||||
up_pgcallback_t pg_callback);
|
up_pgcallback_t pg_callback);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ enum tstate_e
|
|||||||
|
|
||||||
NUM_TASK_STATES /* Must be last */
|
NUM_TASK_STATES /* Must be last */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum tstate_e tstate_t;
|
typedef enum tstate_e tstate_t;
|
||||||
|
|
||||||
/* The following definitions are determined by tstate_t. Ordering of values
|
/* The following definitions are determined by tstate_t. Ordering of values
|
||||||
@@ -250,6 +251,7 @@ union entry_u
|
|||||||
pthread_startroutine_t pthread;
|
pthread_startroutine_t pthread;
|
||||||
main_t main;
|
main_t main;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef union entry_u entry_t;
|
typedef union entry_u entry_t;
|
||||||
|
|
||||||
/* This is the type of the function called at task startup */
|
/* 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() */
|
/* 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__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
|
|
||||||
|
|||||||
@@ -279,7 +279,7 @@
|
|||||||
* handler but rather from the context of the worker thread with interrupts enabled.
|
* 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
|
/* 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
|
* driver is instantiated. This structure provides information about the configuration of the
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct xen1210_config_s;
|
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
|
/* 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
|
* driver is instantiated. This structure provides information about the configuration of
|
||||||
|
|||||||
@@ -495,7 +495,7 @@
|
|||||||
|
|
||||||
/* The type of the media change callback function */
|
/* 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
|
/* If the board supports multiple SPI devices types, this enumeration
|
||||||
* identifies which is selected or de-selected.
|
* identifies which is selected or de-selected.
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ struct spi_bitbang_ops_s
|
|||||||
|
|
||||||
/* This is the type of the function that can exchange one bit */
|
/* 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 */
|
/* This structure provides the state of the SPI bit-bang driver */
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -51,11 +51,11 @@
|
|||||||
/* These are the generic representations of a streams used by the NuttX */
|
/* These are the generic representations of a streams used by the NuttX */
|
||||||
|
|
||||||
struct lib_instream_s;
|
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;
|
struct lib_outstream_s;
|
||||||
typedef void (*lib_putc_t)(FAR struct lib_outstream_s *this, int ch);
|
typedef CODE 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 int (*lib_flush_t)(FAR struct lib_outstream_s *this);
|
||||||
|
|
||||||
struct lib_instream_s
|
struct lib_instream_s
|
||||||
{
|
{
|
||||||
@@ -75,15 +75,15 @@ struct lib_outstream_s
|
|||||||
/* Seek-able streams */
|
/* Seek-able streams */
|
||||||
|
|
||||||
struct lib_sistream_s;
|
struct lib_sistream_s;
|
||||||
typedef int (*lib_sigetc_t)(FAR struct lib_sistream_s *this);
|
typedef CODE 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,
|
typedef CODE off_t (*lib_siseek_t)(FAR struct lib_sistream_s *this,
|
||||||
int whence);
|
off_t offset, int whence);
|
||||||
|
|
||||||
struct lib_sostream_s;
|
struct lib_sostream_s;
|
||||||
typedef void (*lib_soputc_t)(FAR struct lib_sostream_s *this, int ch);
|
typedef CODE void (*lib_soputc_t)(FAR struct lib_sostream_s *this, int ch);
|
||||||
typedef int (*lib_soflush_t)(FAR struct lib_sostream_s *this);
|
typedef CODE 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,
|
typedef CODE off_t (*lib_soseek_t)(FAR struct lib_sostream_s *this,
|
||||||
int whence);
|
off_t offset, int whence);
|
||||||
|
|
||||||
struct lib_sistream_s
|
struct lib_sistream_s
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -187,8 +187,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct oneshot_lowerhalf_s;
|
struct oneshot_lowerhalf_s;
|
||||||
typedef void (*oneshot_callback_t)(FAR struct oneshot_lowerhalf_s *lower,
|
typedef CODE void (*oneshot_callback_t)(FAR struct oneshot_lowerhalf_s *lower,
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
|
|
||||||
/* The one short operations supported by the lower half driver */
|
/* The one short operations supported by the lower half driver */
|
||||||
|
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ enum cdcacm_event_e
|
|||||||
CDCACM_EVENT_SENDBREAK /* Send break request received */
|
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
|
* Public Function Prototypes
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ struct hid_rptinfo_s
|
|||||||
* structure, false if it should be ignored.
|
* 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
|
* Public Function Prototypes
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ struct trace_msg_t
|
|||||||
|
|
||||||
/* Enumeration callback function signature */
|
/* 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
|
/* Bit mask input type for usbtrace_enable(). If TRACE_NIDS grows beyond
|
||||||
* 16, then this will have to be changed to uint32_t
|
* 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 */
|
/* 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
|
* Public Data
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
/* Enumeration callback function signature */
|
/* 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
|
* Public Data
|
||||||
|
|||||||
@@ -446,7 +446,8 @@ typedef CODE uint8_t
|
|||||||
|
|
||||||
struct bt_conn_s; /* Forward reference */
|
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
|
/* Read callback function
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ extern "C"
|
|||||||
# define EXTERN extern
|
# define EXTERN extern
|
||||||
#endif
|
#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_dev_s;
|
||||||
|
|
||||||
struct cc1101_ops_s
|
struct cc1101_ops_s
|
||||||
|
|||||||
@@ -262,7 +262,7 @@
|
|||||||
|
|
||||||
/* Defines the work callback */
|
/* 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
|
/* 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
|
* in order to declare instances of the work structure. Handling of all
|
||||||
|
|||||||
+1
-1
@@ -231,7 +231,7 @@ typedef FAR void *pthread_addr_t;
|
|||||||
#define __PTHREAD_ADDR_T_DEFINED 1
|
#define __PTHREAD_ADDR_T_DEFINED 1
|
||||||
#endif
|
#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;
|
typedef pthread_startroutine_t pthread_func_t;
|
||||||
|
|
||||||
struct pthread_attr_s
|
struct pthread_attr_s
|
||||||
|
|||||||
Reference in New Issue
Block a user