mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 07:43:33 +08:00
Mostly costmetic updates
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5452 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -94,28 +94,26 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Supplied by chip- or board-specific logic */
|
||||
|
||||
EXTERN void up_irqinitialize(void);
|
||||
EXTERN int up_timerisr(int irq, FAR chipreg_t *regs);
|
||||
void up_irqinitialize(void);
|
||||
int up_timerisr(int irq, FAR chipreg_t *regs);
|
||||
|
||||
#ifdef USE_LOWSERIALINIT
|
||||
EXTERN void up_lowserialinit(void);
|
||||
void up_lowserialinit(void);
|
||||
#endif
|
||||
|
||||
/* Defined in up_doirq.c */
|
||||
|
||||
EXTERN FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs);
|
||||
FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs);
|
||||
|
||||
/* Define in up_sigdeliver */
|
||||
|
||||
EXTERN void up_sigdeliver(void);
|
||||
void up_sigdeliver(void);
|
||||
|
||||
/* Defined in CPU-specific logic (only for Z180) */
|
||||
|
||||
@@ -132,7 +130,7 @@ void up_addregion(void);
|
||||
/* Defined in up_serial.c */
|
||||
|
||||
#ifdef USE_SERIALDRIVER
|
||||
EXTERN void up_serialinit(void);
|
||||
void up_serialinit(void);
|
||||
#else
|
||||
# define up_serialinit()
|
||||
#endif
|
||||
@@ -140,7 +138,7 @@ EXTERN void up_serialinit(void);
|
||||
/* Defined in drivers/lowconsole.c */
|
||||
|
||||
#ifdef CONFIG_DEV_LOWCONSOLE
|
||||
EXTERN void lowconsole_init(void);
|
||||
void lowconsole_init(void);
|
||||
#else
|
||||
# define lowconsole_init()
|
||||
#endif
|
||||
@@ -159,14 +157,14 @@ extern void up_puts(const char *str);
|
||||
|
||||
/* Defined in up_timerisr.c */
|
||||
|
||||
EXTERN void up_timerinit(void);
|
||||
void up_timerinit(void);
|
||||
|
||||
/* Defined in board/up_leds.c */
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
EXTERN void up_ledinit(void);
|
||||
EXTERN void up_ledon(int led);
|
||||
EXTERN void up_ledoff(int led);
|
||||
void up_ledinit(void);
|
||||
void up_ledon(int led);
|
||||
void up_ledoff(int led);
|
||||
#else
|
||||
# define up_ledinit()
|
||||
# define up_ledon(led)
|
||||
@@ -176,16 +174,16 @@ EXTERN void up_ledoff(int led);
|
||||
/* Architecture specific hook into the timer interrupt handler */
|
||||
|
||||
#ifdef CONFIG_ARCH_TIMERHOOK
|
||||
EXTERN void up_timerhook(void);
|
||||
void up_timerhook(void);
|
||||
#endif
|
||||
|
||||
/* Defined in board/up_network.c */
|
||||
|
||||
#ifdef CONFIG_NET
|
||||
EXTERN int up_netinitialize(void);
|
||||
EXTERN void up_netuninitialize(void);
|
||||
int up_netinitialize(void);
|
||||
void up_netuninitialize(void);
|
||||
# ifdef CONFIG_ARCH_MCFILTER
|
||||
EXTERN int up_multicastfilter(FAR struct uip_driver_s *dev, FAR uint8_t *mac, bool enable);
|
||||
int up_multicastfilter(FAR struct uip_driver_s *dev, FAR uint8_t *mac, bool enable);
|
||||
# else
|
||||
# define up_multicastfilter(dev, mac, enable)
|
||||
# endif
|
||||
@@ -197,19 +195,18 @@ EXTERN int up_multicastfilter(FAR struct uip_driver_s *dev, FAR uint8_t *mac, bo
|
||||
|
||||
/* Return the current value of the stack pointer (used in stack dump logic) */
|
||||
|
||||
EXTERN uint16_t up_getsp(void);
|
||||
uint16_t up_getsp(void);
|
||||
|
||||
/* Dump stack and registers */
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
EXTERN void up_stackdump(void);
|
||||
void up_stackdump(void);
|
||||
# define REGISTER_DUMP() _REGISTER_DUMP()
|
||||
#else
|
||||
# define up_stackdump()
|
||||
# define REGISTER_DUMP()
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,14 @@
|
||||
|
||||
#define IN_INTERRUPT() (current_regs != NULL)
|
||||
|
||||
/* The following macro is used when the system enters interrupt handling logic */
|
||||
/* The following macro is used when the system enters interrupt handling logic
|
||||
*
|
||||
* NOTE: Nested interrupts are not supported in this implementation. If you want
|
||||
* to implement nested interrupts, you would have to change the way that
|
||||
* current_regs is handled. The savestate variable would not work for
|
||||
* that purpose as implemented here because only the outermost nested
|
||||
* interrupt can result in a context switch (it can probably be deleted).
|
||||
*/
|
||||
|
||||
#define DECL_SAVESTATE() \
|
||||
FAR chipreg_t *savestate
|
||||
@@ -132,33 +139,30 @@ extern volatile chipreg_t *current_regs;
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Defined in ez80_copystate.c */
|
||||
|
||||
EXTERN void ez80_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src);
|
||||
void ez80_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src);
|
||||
|
||||
/* Defined in ez80_saveusercontext.asm */
|
||||
|
||||
EXTERN int ez80_saveusercontext(FAR chipreg_t *regs);
|
||||
int ez80_saveusercontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in ez80_restorecontext.asm */
|
||||
|
||||
EXTERN void ez80_restorecontext(FAR chipreg_t *regs);
|
||||
void ez80_restorecontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in ez80_sigsetup.c */
|
||||
|
||||
EXTERN void ez80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, chipreg_t *regs);
|
||||
void ez80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, chipreg_t *regs);
|
||||
|
||||
/* Defined in ez80_registerdump.c */
|
||||
|
||||
EXTERN void ez80_registerdump(void);
|
||||
void ez80_registerdump(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -77,9 +77,11 @@
|
||||
* - savestate holds the previous value of current_state.
|
||||
* - savecpr holds the previous value of current_cpr.
|
||||
*
|
||||
* TODO: I think this logic is bad... I do not thing that this will really
|
||||
* handle nested interrupts correctly. What if we are nested and then a
|
||||
* context switch occurs? current_regs will not be updated correctly!
|
||||
* NOTE: Nested interrupts are not supported in this implementation. If you want
|
||||
* to implement nested interrupts, you would have to change the way that
|
||||
* current_regs/cbr is handled. The savestate/savecbr variables would not work
|
||||
* for that purpose as implemented here because only the outermost nested
|
||||
* interrupt can result in a context switch (they can probabaly be deleted).
|
||||
*/
|
||||
|
||||
#define DECL_SAVESTATE() \
|
||||
@@ -203,33 +205,30 @@ extern uint8_t current_cbr;
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Defined in z180_copystate.c */
|
||||
|
||||
EXTERN void z180_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src);
|
||||
void z180_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src);
|
||||
|
||||
/* Defined in z180_saveusercontext.asm */
|
||||
|
||||
EXTERN int z180_saveusercontext(FAR chipreg_t *regs);
|
||||
int z180_saveusercontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z180_restoreusercontext.asm */
|
||||
|
||||
EXTERN void z180_restoreusercontext(FAR chipreg_t *regs);
|
||||
void z180_restoreusercontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z180_sigsetup.c */
|
||||
|
||||
EXTERN void z180_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
|
||||
void z180_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z180_registerdump.c */
|
||||
|
||||
EXTERN void z180_registerdump(void);
|
||||
void z180_registerdump(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,14 @@
|
||||
#define IN_INTERRUPT() \
|
||||
(g_z8irqstate.state != Z8_IRQSTATE_NONE)
|
||||
|
||||
/* The following macro is used when the system enters interrupt handling logic */
|
||||
/* The following macro is used when the system enters interrupt handling logic
|
||||
*
|
||||
* NOTE: Nested interrupts are not supported in this implementation. If you want
|
||||
* to implement nested interrupts, you would have to change the way that
|
||||
* current_regs is handled. The savestate variable would not work for
|
||||
* that purpose as implemented here because only the outermost nested
|
||||
* interrupt can result in a context switch (it can probably be deleted).
|
||||
*/
|
||||
|
||||
#define DECL_SAVESTATE() \
|
||||
struct z8_irqstate_s savestate
|
||||
@@ -216,37 +223,34 @@ extern struct z8_irqstate_s g_z8irqstate;
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Defined in z8_irq.c */
|
||||
|
||||
EXTERN void up_maskack_irq(int irq);
|
||||
void up_maskack_irq(int irq);
|
||||
|
||||
/* Defined in z8_saveusercontext.asm */
|
||||
|
||||
EXTERN int z8_saveusercontext(FAR chipreg_t *regs);
|
||||
int z8_saveusercontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z8_saveirqcontext.c */
|
||||
|
||||
EXTERN void z8_saveirqcontext(FAR chipreg_t *regs);
|
||||
void z8_saveirqcontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z8_restorecontext.asm */
|
||||
|
||||
EXTERN void z8_restorecontext(FAR chipreg_t *regs);
|
||||
void z8_restorecontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z8_sigsetup.c */
|
||||
|
||||
EXTERN void z8_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
|
||||
void z8_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z8_registerdump.c */
|
||||
|
||||
EXTERN void z8_registerdump(void);
|
||||
void z8_registerdump(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,14 @@
|
||||
|
||||
#define IN_INTERRUPT() (current_regs != NULL)
|
||||
|
||||
/* The following macro is used when the system enters interrupt handling logic */
|
||||
/* The following macro is used when the system enters interrupt handling logic
|
||||
*
|
||||
* NOTE: Nested interrupts are not supported in this implementation. If you want
|
||||
* to implement nested interrupts, you would have to change the way that
|
||||
* current_regs is handled. The savestate variable would not work for
|
||||
* that purpose as implemented here because only the outermost nested
|
||||
* interrupt can result in a context switch (it can probably be deleted).
|
||||
*/
|
||||
|
||||
#define DECL_SAVESTATE() \
|
||||
FAR chipreg_t *savestate
|
||||
@@ -131,33 +138,30 @@ extern volatile chipreg_t *current_regs;
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
#else
|
||||
#define EXTERN extern
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* Defined in z80_copystate.c */
|
||||
|
||||
EXTERN void z80_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src);
|
||||
void z80_copystate(FAR chipreg_t *dest, FAR const chipreg_t *src);
|
||||
|
||||
/* Defined in z80_saveusercontext.asm */
|
||||
|
||||
EXTERN int z80_saveusercontext(FAR chipreg_t *regs);
|
||||
int z80_saveusercontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z80_restoreusercontext.asm */
|
||||
|
||||
EXTERN void z80_restoreusercontext(FAR chipreg_t *regs);
|
||||
void z80_restoreusercontext(FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z80_sigsetup.c */
|
||||
|
||||
EXTERN void z80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
|
||||
void z80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *regs);
|
||||
|
||||
/* Defined in z80_registerdump.c */
|
||||
|
||||
EXTERN void z80_registerdump(void);
|
||||
void z80_registerdump(void);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user