diff --git a/arch/z80/src/z8/chip.h b/arch/z80/src/z8/chip.h index 05c4a18718..09bc958b56 100644 --- a/arch/z80/src/z8/chip.h +++ b/arch/z80/src/z8/chip.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/z80/src/z8/chip.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,24 +16,24 @@ * License for the specific language governing permissions and limitations * under the License. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_Z80_SRC_Z8_CHIP_H #define __ARCH_Z80_SRC_Z8_CHIP_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Hexadecimal Representation *******************************************************/ +/* Hexadecimal Representation ***********************************************/ #ifdef __ASSEMBLY__ # define _HX(h) %##h @@ -56,13 +56,14 @@ * f00 - fff : 256 byte control register area */ -/* Special Function Registers ******************************************************* +/* Special Function Registers *********************************************** * * Because of the many different ez80 configurations, we will rely on the - * ZDS-II header file, ez8.h, to provide the correct addresses for each register. + * ZDS-II header file, ez8.h, to provide the correct addresses for + * each register. */ -/* Timer Register Bit Definitions ***************************************************/ +/* Timer Register Bit Definitions *******************************************/ /* Timer control register */ @@ -85,7 +86,7 @@ #define Z8_TIMERCTL_GATED _HX(06) #define Z8_TIMERCTL_CAPCMP _HX(07) -/* UART Register Offsets ************************************************************/ +/* UART Register Offsets ****************************************************/ #define Z8_UART_TXD _HX(00) /* 8-bits: UART Transmit Data */ #define Z8_UART_RXD _HX(00) /* 8-bits: UART Receive Data */ @@ -103,7 +104,7 @@ #define Z8_UART_BRH _HX(06) /* 8-bits: UART Baud Rate High Byte */ #define Z8_UART_BRL _HX(07) /* 8-bits: UART Baud Rate Low Byte */ -/* UART0/1 Base Register Addresses **************************************************/ +/* UART0/1 Base Register Addresses ******************************************/ #ifdef EZ8_UART0 # define Z8_UART0_BASE ((uint8_t volatile far*)0xf40) @@ -113,7 +114,7 @@ # define Z8_UART1_BASE ((uint8_t volatile far*)0xf48) #endif -/* UART0/1 Status 0 Register Bit Definitions ****************************************/ +/* UART0/1 Status 0 Register Bit Definitions ********************************/ #define Z8_UARTSTAT0_RDA _HX(80) /* Bit 7: Receive Data Available */ #define Z8_UARTSTAT0_PE _HX(40) /* Bit 6: Parity Error */ @@ -124,7 +125,7 @@ #define Z8_UARTSTAT0_TXE _HX(02) /* Bit 1: Transmitter Empty */ #define Z8_UARTSTAT0_CTS _HX(01) /* Bit 0: Clear To Send */ -/* UART0/1 Control 0/1 Register Bit Definitions *************************************/ +/* UART0/1 Control 0/1 Register Bit Definitions *****************************/ #define Z8_UARTCTL0_TEN _HX(80) /* Bit 7: Transmit Enable */ #define Z8_UARTCTL0_REN _HX(40) /* Bit 6: Receive Enable */ @@ -144,7 +145,7 @@ #define Z8_UARTCTL1_RDAIRQ _HX(02) /* Bit 1: Receive Data Interrupt Enable */ #define Z8_UARTCTL1_IREN _HX(01) /* Bit 0: Infrared Encoder/Decoder Enable */ -/* UART0/1 Mode Status/Select Register Bit Definitions ******************************/ +/* UART0/1 Mode Status/Select Register Bit Definitions **********************/ #define Z8_UARTMDSEL_NORMAL _HX(00) /* Bits 5-7=0: Multiprocessor and Normal Mode */ #define Z8_UARTMDSEL_FILTER HX(20) /* Bits 5-7=1: Noise Filter Control/Status */ @@ -152,7 +153,7 @@ #define Z8_UARTMDSEL_HWREV HX(e0) /* Bits 5-7=7: LIN-UART Hardware Revision */ /* Bits 0-4: Mode dependent status */ -/* I2C Status Register Bit Definitions **********************************************/ +/* I2C Status Register Bit Definitions **************************************/ #if defined(_Z8FMC16) || defined(_Z8F1680) # define I2C_ISTAT_NCKI (1 << 0) /* Bit 0: 1=NAK Interrupt */ @@ -174,7 +175,7 @@ # define I2C_STAT_TDRE (1 << 7) /* Bit 7: 1=Transmit Data Register Empty */ #endif -/* I2C Control Register Bit Definitions *********************************************/ +/* I2C Control Register Bit Definitions *************************************/ #define I2C_CTL_FILTEN (1 << 0) /* Bit 0: 1=I2C Signal Filter Enable */ #define I2C_CTL_FLUSH (1 << 1) /* Bit 1: 1=Flush Data */ @@ -185,9 +186,9 @@ #define I2C_CTL_START (1 << 6) /* Bit 6: 1=Send Start Condition */ #define I2C_CTL_IEN (1 << 7) /* Bit 7: 1=I2C Enable */ -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus diff --git a/arch/z80/src/z8/switch.h b/arch/z80/src/z8/switch.h index 8513f4a7ea..258d7e8cee 100644 --- a/arch/z80/src/z8/switch.h +++ b/arch/z80/src/z8/switch.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/z80/src/z8/switch.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,14 +16,14 @@ * License for the specific language governing permissions and limitations * under the License. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_Z80_SRC_Z8_SWITCH_H #define __ARCH_Z80_SRC_Z8_SWITCH_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ # include @@ -32,15 +32,15 @@ #endif #include "z80_internal.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Z8_IRQSTATE_* definitions ******************************************************** - * These are used in the state field of 'struct z8_irqstate_s' structure to define - * the current state of the interrupt handling. These definition support "lazy" - * interrupt context saving. See comments below associated with s'truct - * z8_irqstate_s'. +/* Z8_IRQSTATE_* definitions ************************************************ + * These are used in the state field of 'struct z8_irqstate_s' structure + * to define the current state of the interrupt handling. + * These definition support "lazy" interrupt context saving. See comments + * below associated with s'truct z8_irqstate_s'. */ #define Z8_IRQSTATE_NONE 0 /* Not handling an interrupt */ @@ -53,16 +53,16 @@ * value[0] = RP (MS byte) and Flags (LS) byte * value[1] = PC * - * The pointer to the save structure is a stack pointer at the time that z80_doirq() - * was called: + * The pointer to the save structure is a stack pointer at the time + * that z80_doirq() was called: * * PC[7:0] * PC[15:8] * Flags Register * SP -> RP * - * The stack pointer on return from interrupt can be obtained by adding 4 to the - * pointer to the save structure. + * The stack pointer on return from interrupt can be obtained by adding 4 + * to the pointer to the save structure. */ #define Z8_IRQSAVE_RPFLAGS (0) /* Index 10: RP (MS) and FLAGS (LS) */ @@ -77,10 +77,10 @@ #define Z8_IRQSAVE_PCL_OFFS (2*Z8_IRQSAVE_PC+1) /* Offset 3: PC[0:7] */ #define Z8_IRQSAVE_SIZE (2*Z8_IRQSAVE_REGS) /* Number 8-bit values saved */ -/* Macros for portability *********************************************************** +/* Macros for portability *************************************************** * - * Common logic in arch/z80/src/common is customized for the z8 context switching - * logic via the following macros. + * Common logic in arch/z80/src/common is customized for the z8 + * context switching logic via the following macros. */ /* Initialize the IRQ state */ @@ -90,17 +90,19 @@ g_z8irqstate.state = Z8_IRQSTATE_NONE; \ } while (0) -/* IN_INTERRUPT returns true if the system is currently operating in the interrupt - * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). +/* IN_INTERRUPT returns true if the system is currently operating in the + * interrupt context. IN_INTERRUPT is the inline equivalent + * of up_interrupt_context(). */ #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 + * NOTE: Nested interrupts are not supported in this implementation. If you + * want to implement nested interrupts, you would have to change the way that * g_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). @@ -118,7 +120,9 @@ up_ack_irq(irq); \ } while (0) -/* The following macro is used when the system exits interrupt handling logic */ +/* The following macro is used when the system exits interrupt + * handling logic + */ #define IRQ_LEAVE(irq) \ do { \ @@ -126,7 +130,9 @@ g_z8irqstate.regs = savestate.regs; \ } while (0) -/* The following macro is used to sample the interrupt state (as a opaque handle) */ +/* The following macro is used to sample the interrupt state + * (as a opaque handle) + */ #define IRQ_STATE() \ (g_z8irqstate.regs) @@ -144,8 +150,9 @@ g_z8irqstate.regs = (tcb)->xcp.regs; \ } while (0) -/* Save the user context in the specified TCB. User context saves can be simpler - * because only those registers normally saved in a C called need be stored. +/* Save the user context in the specified TCB. User context saves + * can be simpler because only those registers normally + * saved in a C called need be stored. */ #define SAVE_USERCONTEXT(tcb) \ @@ -158,18 +165,18 @@ #define RESTORE_USERCONTEXT(tcb) \ z8_restorecontext((tcb)->xcp.regs) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/* In order to provide faster interrupt handling, the interrupt logic does "lazy" - * context saving as described below: +/* In order to provide faster interrupt handling, the interrupt logic does + * "lazy" context saving as described below: * - * (1) At the time of the interrupt, minimum information is saved and the register - * pointer is changed so that the interrupt logic does not alter the state of - * the interrupted task's registers. - * (2) If no context switch occurs during the interrupt processing, then the return - * from interrupt is also simple. + * (1) At the time of the interrupt, minimum information is saved and the + * register pointer is changed so that the interrupt logic does not alter + * the state of the interrupted task's registers. + * (2) If no context switch occurs during the interrupt processing, then + * the return from interrupt is also simple. * (3) If a context switch occurs during interrupt processing, then * (a) The full context of the interrupt task is saved, and * (b) A full context switch is performed when the interrupt exits (see @@ -186,19 +193,21 @@ struct z8_irqstate_s }; #endif -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/* This structure holds information about the current interrupt processing state */ +/* This structure holds information about the current interrupt + * processing state + */ extern struct z8_irqstate_s g_z8irqstate; #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus diff --git a/arch/z80/src/z8/z80_mem.h b/arch/z80/src/z8/z80_mem.h index 380b58a439..9cba9b4b95 100644 --- a/arch/z80/src/z8/z80_mem.h +++ b/arch/z80/src/z8/z80_mem.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/z80/src/z8/z80_mem.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,20 +16,20 @@ * License for the specific language governing permissions and limitations * under the License. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_Z80_SRC_Z8_Z80_MEM_H #define __ARCH_Z80_SRC_Z8_Z80_MEM_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* For the ZiLOG ZDS-II toolchain(s), the heap will be set using linker- * defined values: @@ -52,9 +52,9 @@ extern far unsigned long far_stacktop; (((uint16_t)&far_stacktop) - CONFIG_IDLETHREAD_STACKSIZE) #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus diff --git a/arch/z80/src/z80/chip.h b/arch/z80/src/z80/chip.h index 82f3a404c5..67ecba50f5 100644 --- a/arch/z80/src/z80/chip.h +++ b/arch/z80/src/z80/chip.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/z80/src/z80/chip.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,23 +16,23 @@ * License for the specific language governing permissions and limitations * under the License. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_Z80_SRC_Z80_CHIP_H #define __ARCH_Z80_SRC_Z80_CHIP_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #endif /* __ARCH_Z80_SRC_Z80_CHIP_H */ diff --git a/arch/z80/src/z80/switch.h b/arch/z80/src/z80/switch.h index 7bb25bec42..a0db842040 100644 --- a/arch/z80/src/z80/switch.h +++ b/arch/z80/src/z80/switch.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/z80/src/z80/switch.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,47 +16,50 @@ * License for the specific language governing permissions and limitations * under the License. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_Z80_SRC_Z80_SWITCH_H #define __ARCH_Z80_SRC_Z80_SWITCH_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include "z80_internal.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Macros for portability *********************************************************** +/* Macros for portability *************************************************** * - * Common logic in arch/z80/src/common is customized for the z80 context switching - * logic via the following macros. + * Common logic in arch/z80/src/common is customized for the z80 + * context switching logic via the following macros. */ /* Initialize the IRQ state */ #define INIT_IRQCONTEXT() g_current_regs = NULL -/* IN_INTERRUPT returns true if the system is currently operating in the interrupt - * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). +/* IN_INTERRUPT returns true if the system is currently operating in the + * interrupt context. + * IN_INTERRUPT is the inline equivalent of up_interrupt_context(). */ #define IN_INTERRUPT() (g_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 - * g_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). + * NOTE: Nested interrupts are not supported in this implementation. + * If you want to implement nested interrupts, you would have to change + * the way that g_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() \ @@ -68,11 +71,15 @@ g_current_regs = (regs); \ } while (0) -/* The following macro is used when the system exits interrupt handling logic */ +/* The following macro is used when the system exits + * interrupt handling logic + */ #define IRQ_LEAVE(irq) g_current_regs = savestate -/* The following macro is used to sample the interrupt state (as a opaque handle) */ +/* The following macro is used to sample the interrupt state + * (as a opaque handle) + */ #define IRQ_STATE() (g_current_regs) @@ -84,8 +91,9 @@ #define SET_IRQCONTEXT(tcb) z80_copystate((FAR chipreg_t*)g_current_regs, (tcb)->xcp.regs) -/* Save the user context in the specified TCB. User context saves can be simpler - * because only those registers normally saved in a C called need be stored. +/* Save the user context in the specified TCB. User context saves + * can be simpler because only those registers normally saved in a C called + * need be stored. */ #define SAVE_USERCONTEXT(tcb) up_saveusercontext((tcb)->xcp.regs) @@ -96,25 +104,25 @@ #define RESTORE_USERCONTEXT(tcb) z80_restoreusercontext((tcb)->xcp.regs) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/* This holds a references to the current interrupt level register storage structure. - * If is non-NULL only during interrupt processing. +/* This holds a references to the current interrupt level register + * storage structure. If is non-NULL only during interrupt processing. */ extern volatile chipreg_t *g_current_regs; #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef __cplusplus diff --git a/arch/z80/src/z80/z80_mem.h b/arch/z80/src/z80/z80_mem.h index acec76caf4..36e53105d5 100644 --- a/arch/z80/src/z80/z80_mem.h +++ b/arch/z80/src/z80/z80_mem.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * arch/z80/src/z80/z80_mem.h * * Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,43 +16,44 @@ * License for the specific language governing permissions and limitations * under the License. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __ARCH_Z80_SRC_Z80_Z80_MEM_H #define __ARCH_Z80_SRC_Z80_Z80_MEM_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Locate the IDLE thread stack at the end of RAM. */ #define CONFIG_STACK_END CONFIG_RAM_SIZE #define CONFIG_STACK_BASE (CONFIG_STACK_END - CONFIG_IDLETHREAD_STACKSIZE) -/* The heap then extends from the linker determined beginning of the heap (s__HEAP). - * to the bottom of the IDLE thread stack. NOTE: The symbol s__HEAP is not - * accessible from C because it does not begin with the _ character. g_heapbase - * is defined in z80_head.asm to provide that value to the C code. +/* The heap then extends from the linker determined beginning of the heap + * (s__HEAP) to the bottom of the IDLE thread stack. + * NOTE: The symbol s__HEAP is not accessible from C because + * it does not begin with the _ character. g_heapbase is defined + * in z80_head.asm to provide that value to the C code. */ #define CONFIG_HEAP1_END CONFIG_STACK_BASE #define CONFIG_HEAP1_BASE g_heapbase -/************************************************************************************ +/**************************************************************************** * Public variables - ************************************************************************************/ + ****************************************************************************/ -/* This is the bottom of the heap as provided by the linker symbol s__HEAP. NOTE: - * The symbol s__HEAP is not accessible from C because it does not begin with the _ - * character. g_heapbase is defined in z80_head.asm to provide that value to the C - * code. +/* This is the bottom of the heap as provided by the linker symbol s__HEAP. + * NOTE: The symbol s__HEAP is not accessible from C because + * it does not begin with the _ character. g_heapbase is defined in + * z80_head.asm to provide that value to the C code. */ extern const uint16_t g_heapbase;