summaryrefslogtreecommitdiff
path: root/nuttx/arch/z80
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-23 17:32:41 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-12-23 17:32:41 +0000
commit10b6fd31cc5b27540bdde4999060a42de3e44d26 (patch)
tree96203f9eb5cff73526dd98af4ed20a40080a758a /nuttx/arch/z80
parent8a547ed6db3b7e17d90c8ebda107cafc98e7723e (diff)
downloadpx4-nuttx-10b6fd31cc5b27540bdde4999060a42de3e44d26.tar.gz
px4-nuttx-10b6fd31cc5b27540bdde4999060a42de3e44d26.tar.bz2
px4-nuttx-10b6fd31cc5b27540bdde4999060a42de3e44d26.zip
Mostly costmetic updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5452 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z80')
-rw-r--r--nuttx/arch/z80/include/z80/chip.h6
-rw-r--r--nuttx/arch/z80/src/common/up_internal.h41
-rw-r--r--nuttx/arch/z80/src/ez80/switch.h26
-rw-r--r--nuttx/arch/z80/src/z180/switch.h25
-rw-r--r--nuttx/arch/z80/src/z8/switch.h28
-rw-r--r--nuttx/arch/z80/src/z80/switch.h26
6 files changed, 80 insertions, 72 deletions
diff --git a/nuttx/arch/z80/include/z80/chip.h b/nuttx/arch/z80/include/z80/chip.h
index 5c0c61166..c355eb788 100644
--- a/nuttx/arch/z80/include/z80/chip.h
+++ b/nuttx/arch/z80/include/z80/chip.h
@@ -34,8 +34,8 @@
*
************************************************************************************/
-#ifndef __ARCH_Z80_SRC_Z80_CHIP_H
-#define __ARCH_Z80_SRC_Z80_CHIP_H
+#ifndef __ARCH_Z80_INCLUDE_Z80_CHIP_H
+#define __ARCH_Z80_INCLUDE_Z80_CHIP_H
/************************************************************************************
* Included Files
@@ -76,4 +76,4 @@ extern "C" {
#endif
#endif
-#endif /* __ARCH_Z80_SRC_Z80_CHIP_H */
+#endif /* __ARCH_Z80_INCLUDE_Z80_CHIP_H */
diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h
index def13b546..5f1750b64 100644
--- a/nuttx/arch/z80/src/common/up_internal.h
+++ b/nuttx/arch/z80/src/common/up_internal.h
@@ -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
diff --git a/nuttx/arch/z80/src/ez80/switch.h b/nuttx/arch/z80/src/ez80/switch.h
index 0bac6aed1..0970b25ce 100644
--- a/nuttx/arch/z80/src/ez80/switch.h
+++ b/nuttx/arch/z80/src/ez80/switch.h
@@ -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
diff --git a/nuttx/arch/z80/src/z180/switch.h b/nuttx/arch/z80/src/z180/switch.h
index ae80f4f76..7bf851a7c 100644
--- a/nuttx/arch/z80/src/z180/switch.h
+++ b/nuttx/arch/z80/src/z180/switch.h
@@ -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
diff --git a/nuttx/arch/z80/src/z8/switch.h b/nuttx/arch/z80/src/z8/switch.h
index 45089947c..17f15b6da 100644
--- a/nuttx/arch/z80/src/z8/switch.h
+++ b/nuttx/arch/z80/src/z8/switch.h
@@ -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
diff --git a/nuttx/arch/z80/src/z80/switch.h b/nuttx/arch/z80/src/z80/switch.h
index 3732a32a3..4a49c70ef 100644
--- a/nuttx/arch/z80/src/z80/switch.h
+++ b/nuttx/arch/z80/src/z80/switch.h
@@ -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