aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/ports/e200
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 09:59:21 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 09:59:21 +0000
commit641f2c372605cf405f0dda8536b45a78e0e5e2e2 (patch)
treef120afff37ef959b367a6023749700d5b618beff /os/nil/ports/e200
parent5e24a813bef8d7ac5ca79fe9079db0fc2d2bb8b2 (diff)
downloadChibiOS-641f2c372605cf405f0dda8536b45a78e0e5e2e2.tar.gz
ChibiOS-641f2c372605cf405f0dda8536b45a78e0e5e2e2.tar.bz2
ChibiOS-641f2c372605cf405f0dda8536b45a78e0e5e2e2.zip
Tree reorganization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8899 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil/ports/e200')
-rw-r--r--os/nil/ports/e200/compilers/GCC/ivor.s234
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc560bcxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc560bxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc560dxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc560pxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc563mxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc564axx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc56ecxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc56elxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/mk/port_spc57emxx.mk14
-rw-r--r--os/nil/ports/e200/compilers/GCC/niltypes.h96
-rw-r--r--os/nil/ports/e200/nilcore.c107
-rw-r--r--os/nil/ports/e200/nilcore.h555
13 files changed, 0 insertions, 1118 deletions
diff --git a/os/nil/ports/e200/compilers/GCC/ivor.s b/os/nil/ports/e200/compilers/GCC/ivor.s
deleted file mode 100644
index 8bd687c0a..000000000
--- a/os/nil/ports/e200/compilers/GCC/ivor.s
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- ChibiOS is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file ivor.s
- * @brief Kernel ISRs.
- *
- * @addtogroup PPC_GCC_CORE
- * @{
- */
-
-#if !defined(FALSE) || defined(__DOXYGEN__)
-#define FALSE 0
-#endif
-
-#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE 1
-#endif
-
-/*
- * Imports the PPC configuration headers.
- */
-#define _FROM_ASM_
-#include "nilconf.h"
-#include "nilcore.h"
-
-#if !defined(__DOXYGEN__)
-
- .section .handlers, "ax"
-
-#if PPC_SUPPORTS_DECREMENTER
- /*
- * _IVOR10 handler (Book-E decrementer).
- */
- .align 4
- .globl _IVOR10
- .type _IVOR10, @function
-_IVOR10:
- /* Saving the external context (port_extctx structure).*/
- stwu %sp, -80(%sp)
-#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
- e_stmvsrrw 8(%sp) /* Saves PC, MSR. */
- e_stmvsprw 16(%sp) /* Saves CR, LR, CTR, XER. */
- e_stmvgprw 32(%sp) /* Saves GPR0, GPR3...GPR12. */
-#else /* !(PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI) */
- stw %r0, 32(%sp) /* Saves GPR0. */
- mfSRR0 %r0
- stw %r0, 8(%sp) /* Saves PC. */
- mfSRR1 %r0
- stw %r0, 12(%sp) /* Saves MSR. */
- mfCR %r0
- stw %r0, 16(%sp) /* Saves CR. */
- mfLR %r0
- stw %r0, 20(%sp) /* Saves LR. */
- mfCTR %r0
- stw %r0, 24(%sp) /* Saves CTR. */
- mfXER %r0
- stw %r0, 28(%sp) /* Saves XER. */
- stw %r3, 36(%sp) /* Saves GPR3...GPR12. */
- stw %r4, 40(%sp)
- stw %r5, 44(%sp)
- stw %r6, 48(%sp)
- stw %r7, 52(%sp)
- stw %r8, 56(%sp)
- stw %r9, 60(%sp)
- stw %r10, 64(%sp)
- stw %r11, 68(%sp)
- stw %r12, 72(%sp)
-#endif /* !(PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI) */
-
- /* Increasing the SPGR0 register.*/
- mfspr %r0, 272
- eaddi %r0, %r0, 1
- mtspr 272, %r0
-
- /* Reset DIE bit in TSR register.*/
- lis %r3, 0x0800 /* DIS bit mask. */
- mtspr 336, %r3 /* TSR register. */
-
- /* Restoring pre-IRQ MSR register value.*/
- mfSRR1 %r0
-#if !PPC_USE_IRQ_PREEMPTION
- /* No preemption, keeping EE disabled.*/
- se_bclri %r0, 16 /* EE = bit 16. */
-#endif
- mtMSR %r0
-
- /* System tick handler invocation.*/
- bl chSysTimerHandlerI
-
-#if PPC_USE_IRQ_PREEMPTION
- /* Prevents preemption again.*/
- wrteei 0
-#endif
-
- /* Jumps to the common IVOR epilogue code.*/
- b _ivor_exit
-#endif /* PPC_SUPPORTS_DECREMENTER */
-
- /*
- * _IVOR4 handler (Book-E external interrupt).
- */
- .align 4
- .globl _IVOR4
- .type _IVOR4, @function
-_IVOR4:
- /* Saving the external context (port_extctx structure).*/
- stwu %sp, -80(%sp)
-#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
- e_stmvsrrw 8(%sp) /* Saves PC, MSR. */
- e_stmvsprw 16(%sp) /* Saves CR, LR, CTR, XER. */
- e_stmvgprw 32(%sp) /* Saves GPR0, GPR3...GPR12. */
-#else /* !(PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI) */
- stw %r0, 32(%sp) /* Saves GPR0. */
- mfSRR0 %r0
- stw %r0, 8(%sp) /* Saves PC. */
- mfSRR1 %r0
- stw %r0, 12(%sp) /* Saves MSR. */
- mfCR %r0
- stw %r0, 16(%sp) /* Saves CR. */
- mfLR %r0
- stw %r0, 20(%sp) /* Saves LR. */
- mfCTR %r0
- stw %r0, 24(%sp) /* Saves CTR. */
- mfXER %r0
- stw %r0, 28(%sp) /* Saves XER. */
- stw %r3, 36(%sp) /* Saves GPR3...GPR12. */
- stw %r4, 40(%sp)
- stw %r5, 44(%sp)
- stw %r6, 48(%sp)
- stw %r7, 52(%sp)
- stw %r8, 56(%sp)
- stw %r9, 60(%sp)
- stw %r10, 64(%sp)
- stw %r11, 68(%sp)
- stw %r12, 72(%sp)
-#endif /* !(PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI) */
-
- /* Increasing the SPGR0 register.*/
- mfspr %r0, 272
- eaddi %r0, %r0, 1
- mtspr 272, %r0
-
- /* Software vector address from the INTC register.*/
- lis %r3, INTC_IACKR_ADDR@h
- ori %r3, %r3, INTC_IACKR_ADDR@l
- lwz %r3, 0(%r3) /* IACKR register value. */
- lwz %r3, 0(%r3)
- mtCTR %r3 /* Software handler address. */
-
- /* Restoring pre-IRQ MSR register value.*/
- mfSRR1 %r0
-#if !PPC_USE_IRQ_PREEMPTION
- /* No preemption, keeping EE disabled.*/
- se_bclri %r0, 16 /* EE = bit 16. */
-#endif
- mtMSR %r0
-
- /* Exectes the software handler.*/
- bctrl
-
-#if PPC_USE_IRQ_PREEMPTION
- /* Prevents preemption again.*/
- wrteei 0
-#endif
-
- /* Informs the INTC that the interrupt has been served.*/
- mbar 0
- lis %r3, INTC_EOIR_ADDR@h
- ori %r3, %r3, INTC_EOIR_ADDR@l
- stw %r3, 0(%r3) /* Writing any value should do. */
-
- /* Common IVOR epilogue code, context restore.*/
- .globl _ivor_exit
-_ivor_exit:
- /* Decreasing the SPGR0 register.*/
- mfspr %r0, 272
- eaddi %r0, %r0, -1
- mtspr 272, %r0
-
- bl chSchRescheduleS
-
- /* Restoring the external context.*/
-#if PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI
- e_lmvgprw 32(%sp) /* Restores GPR0, GPR3...GPR12. */
- e_lmvsprw 16(%sp) /* Restores CR, LR, CTR, XER. */
- e_lmvsrrw 8(%sp) /* Restores PC, MSR. */
-#else /*!(PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI) */
- lwz %r3, 36(%sp) /* Restores GPR3...GPR12. */
- lwz %r4, 40(%sp)
- lwz %r5, 44(%sp)
- lwz %r6, 48(%sp)
- lwz %r7, 52(%sp)
- lwz %r8, 56(%sp)
- lwz %r9, 60(%sp)
- lwz %r10, 64(%sp)
- lwz %r11, 68(%sp)
- lwz %r12, 72(%sp)
- lwz %r0, 8(%sp)
- mtSRR0 %r0 /* Restores PC. */
- lwz %r0, 12(%sp)
- mtSRR1 %r0 /* Restores MSR. */
- lwz %r0, 16(%sp)
- mtCR %r0 /* Restores CR. */
- lwz %r0, 20(%sp)
- mtLR %r0 /* Restores LR. */
- lwz %r0, 24(%sp)
- mtCTR %r0 /* Restores CTR. */
- lwz %r0, 28(%sp)
- mtXER %r0 /* Restores XER. */
- lwz %r0, 32(%sp) /* Restores GPR0. */
-#endif /* !(PPC_USE_VLE && PPC_SUPPORTS_VLE_MULTI) */
- addi %sp, %sp, 80 /* Back to the previous frame. */
- rfi
-
-#endif /* !defined(__DOXYGEN__) */
-
-/** @} */
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc560bcxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc560bcxx.mk
deleted file mode 100644
index 050076219..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc560bcxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z0 SPC560BCxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560BCxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC560BCxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc560bxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc560bxx.mk
deleted file mode 100644
index 6089f4743..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc560bxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z0 SPC560Bxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560Bxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC560Bxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc560dxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc560dxx.mk
deleted file mode 100644
index 91176f87b..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc560dxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z0 SPC560Dxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560Dxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC560Dxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc560pxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc560pxx.mk
deleted file mode 100644
index 9342310aa..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc560pxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z0 SPC560Pxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC560Pxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC560Pxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc563mxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc563mxx.mk
deleted file mode 100644
index febbf22a8..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc563mxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z3 SPC563Mxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC563Mxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC563Mxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc564axx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc564axx.mk
deleted file mode 100644
index 31b25c692..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc564axx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z4 SPC564Axx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC564Axx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC564Axx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc56ecxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc56ecxx.mk
deleted file mode 100644
index 84ada33e1..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc56ecxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z4 SPC56ECxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC56ECxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC56ECxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc56elxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc56elxx.mk
deleted file mode 100644
index a913240e3..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc56elxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z4 SPC56ELxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC56ELxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC56ELxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/mk/port_spc57emxx.mk b/os/nil/ports/e200/compilers/GCC/mk/port_spc57emxx.mk
deleted file mode 100644
index 669d371ea..000000000
--- a/os/nil/ports/e200/compilers/GCC/mk/port_spc57emxx.mk
+++ /dev/null
@@ -1,14 +0,0 @@
-# List of the ChibiOS/NIL e200z4 SPC57EMxx port files.
-PORTSRC = ${CHIBIOS}/os/nil/ports/e200/nilcore.c
-
-PORTASM = $(CHIBIOS)/os/common/ports/e200/devices/SPC57EMxx/boot.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/vectors.s \
- $(CHIBIOS)/os/common/ports/e200/compilers/GCC/crt0.s \
- $(CHIBIOS)/os/nil/ports/e200/compilers/GCC/ivor.s
-
-PORTINC = ${CHIBIOS}/os/common/ports/e200/compilers/GCC \
- ${CHIBIOS}/os/common/ports/e200/devices/SPC57EMxx \
- ${CHIBIOS}/os/nil/ports/e200 \
- ${CHIBIOS}/os/nil/ports/e200/compilers/GCC
-
-PORTLD = ${CHIBIOS}/os/common/ports/e200/compilers/GCC/ld
diff --git a/os/nil/ports/e200/compilers/GCC/niltypes.h b/os/nil/ports/e200/compilers/GCC/niltypes.h
deleted file mode 100644
index 587beb26e..000000000
--- a/os/nil/ports/e200/compilers/GCC/niltypes.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- ChibiOS is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file e200/compilers/GCC/niltypes.h
- * @brief Power e200 port system types.
- *
- * @addtogroup PPC_GCC_CORE
- * @{
- */
-
-#ifndef _NILTYPES_H_
-#define _NILTYPES_H_
-
-#include <stddef.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-/**
- * @name Common constants
- */
-/**
- * @brief Generic 'false' boolean constant.
- */
-#if !defined(FALSE) || defined(__DOXYGEN__)
-#define FALSE 0
-#endif
-
-/**
- * @brief Generic 'true' boolean constant.
- */
-#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE (!FALSE)
-#endif
-/** @} */
-
-typedef uint32_t syssts_t; /**< System status word. */
-typedef uint32_t rtcnt_t; /**< Realtime counter. */
-typedef uint8_t tstate_t; /**< Thread state. */
-typedef int32_t msg_t; /**< Inter-thread message. */
-typedef uint32_t eventmask_t; /**< Mask of event identifiers. */
-typedef int32_t cnt_t; /**< Generic signed counter. */
-typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
-
-/**
- * @brief Type of system time.
- */
-#if (NIL_CFG_ST_RESOLUTION == 32) || defined(__DOXYGEN__)
-typedef uint32_t systime_t;
-#else
-typedef uint16_t systime_t;
-#endif
-
-/**
- * @brief ROM constant modifier.
- * @note It is set to use the "const" keyword in this port.
- */
-#define ROMCONST const
-
-/**
- * @brief Makes functions not inlineable.
- * @note If the compiler does not support such attribute then the
- * realtime counter precision could be degraded.
- */
-#define NOINLINE __attribute__((noinline))
-
-/**
- * @brief Optimized thread function declaration macro.
- */
-#define PORT_THD_FUNCTION(tname, arg) \
- __attribute__((noreturn)) void tname(void *arg)
-
-/**
- * @brief Packed variable specifier.
- */
-#define PACKED_VAR __attribute__((packed))
-
-#endif /* _NILTYPES_H_ */
-
-/** @} */
diff --git a/os/nil/ports/e200/nilcore.c b/os/nil/ports/e200/nilcore.c
deleted file mode 100644
index 4e4510bab..000000000
--- a/os/nil/ports/e200/nilcore.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- ChibiOS is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file templates/nilcore.c
- * @brief Port code.
- *
- * @addtogroup NIL_CORE
- * @{
- */
-
-#include "nil.h"
-
-/*===========================================================================*/
-/* Module local definitions. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module exported variables. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module local types. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module local variables. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module local functions. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module exported functions. */
-/*===========================================================================*/
-
-/**
- * @brief Performs a context switch between two threads.
- * @details This is the most critical code in any port, this function
- * is responsible for the context switch between 2 threads.
- * @note The implementation of this code affects <b>directly</b> the context
- * switch performance so optimize here as much as you can.
- */
-#if !defined(__DOXYGEN__)
-__attribute__((naked))
-#endif
-void port_dummy1(void) {
-
- asm (".global _port_switch");
- asm ("_port_switch:");
- asm ("subi %sp, %sp, 80"); /* Size of the intctx structure. */
- asm ("mflr %r0");
- asm ("stw %r0, 84(%sp)"); /* LR into the caller frame. */
- asm ("mfcr %r0");
- asm ("stw %r0, 0(%sp)"); /* CR. */
- asm ("stmw %r14, 4(%sp)"); /* GPR14...GPR31. */
-
- asm ("stw %sp, 0(%r4)"); /* Store swapped-out stack. */
- asm ("lwz %sp, 0(%r3)"); /* Load swapped-in stack. */
-
- asm ("lmw %r14, 4(%sp)"); /* GPR14...GPR31. */
- asm ("lwz %r0, 0(%sp)"); /* CR. */
- asm ("mtcr %r0");
- asm ("lwz %r0, 84(%sp)"); /* LR from the caller frame. */
- asm ("mtlr %r0");
- asm ("addi %sp, %sp, 80"); /* Size of the intctx structure. */
- asm ("blr");
-}
-
-/**
- * @brief Start a thread by invoking its work function.
- * @details If the work function returns @p chThdExit() is automatically
- * invoked.
- */
-#if !defined(__DOXYGEN__)
-__attribute__((naked))
-#endif
-void port_dummy2(void) {
-
- asm (".global _port_thread_start");
- asm ("_port_thread_start:");
- chSysUnlock();
- asm ("mr %r3, %r31"); /* Thread parameter. */
- asm ("mtctr %r30");
- asm ("bctrl"); /* Invoke thread function. */
- asm ("li %r0, 0");
- asm ("bl chSysHalt"); /* Thread termination on exit. */
-}
-
-/** @} */
diff --git a/os/nil/ports/e200/nilcore.h b/os/nil/ports/e200/nilcore.h
deleted file mode 100644
index ac5a32433..000000000
--- a/os/nil/ports/e200/nilcore.h
+++ /dev/null
@@ -1,555 +0,0 @@
-/*
- ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio.
-
- This file is part of ChibiOS.
-
- ChibiOS is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- ChibiOS is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @file templates/nilcore.h
- * @brief Port macros and structures.
- *
- * @addtogroup NIL_CORE
- * @{
- */
-
-#ifndef _NILCORE_H_
-#define _NILCORE_H_
-
-#include "intc.h"
-
-/*===========================================================================*/
-/* Module constants. */
-/*===========================================================================*/
-
-/**
- * @name Architecture and Compiler
- * @{
- */
-/**
- * @brief Macro defining an PPC architecture.
- */
-#define PORT_ARCHITECTURE_PPC
-
-/**
- * @brief Macro defining the specific PPC architecture.
- */
-#define PORT_ARCHITECTURE_PPC_E200
-
-/**
- * @brief Name of the implemented architecture.
- */
-#define PORT_ARCHITECTURE_NAME "Power Architecture"
-
-/**
- * @brief Compiler name and version.
- */
-#if defined(__GNUC__) || defined(__DOXYGEN__)
-#define PORT_COMPILER_NAME "GCC " __VERSION__
-
-#else
-#error "unsupported compiler"
-#endif
-
-/**
- * @brief This port supports a realtime counter.
- */
-#define PORT_SUPPORTS_RT FALSE
-/** @} */
-
-/**
- * @name E200 core variants
- * @{
- */
-#define PPC_VARIANT_e200z0 200
-#define PPC_VARIANT_e200z2 202
-#define PPC_VARIANT_e200z3 203
-#define PPC_VARIANT_e200z4 204
-/** @} */
-
-/* Inclusion of the PPC implementation specific parameters.*/
-#include "ppcparams.h"
-#include "vectors.h"
-
-/*===========================================================================*/
-/* Module pre-compile time settings. */
-/*===========================================================================*/
-
-/**
- * @brief Per-thread stack overhead for interrupts servicing.
- * @details This constant is used in the calculation of the correct working
- * area size.
- */
-#if !defined(PORT_INT_REQUIRED_STACK) || defined(__DOXYGEN__)
-#define PORT_INT_REQUIRED_STACK 256
-#endif
-
-/**
- * @brief Enables an alternative timer implementation.
- * @details Usually the port uses a timer interface defined in the file
- * @p nilcore_timer.h, if this option is enabled then the file
- * @p nilcore_timer_alt.h is included instead.
- */
-#if !defined(PORT_USE_ALT_TIMER) || defined(__DOXYGEN__)
-#define PORT_USE_ALT_TIMER FALSE
-#endif
-
-/**
- * @brief Use VLE instruction set.
- * @note This parameter is usually set in the Makefile.
- */
-#if !defined(PPC_USE_VLE) || defined(__DOXYGEN__)
-#define PPC_USE_VLE TRUE
-#endif
-
-/**
- * @brief Enables the use of the @p WFI instruction.
- */
-#if !defined(PPC_ENABLE_WFI_IDLE) || defined(__DOXYGEN__)
-#define PPC_ENABLE_WFI_IDLE FALSE
-#endif
-
-/*===========================================================================*/
-/* Derived constants and error checks. */
-/*===========================================================================*/
-
-#if PPC_USE_VLE && !PPC_SUPPORTS_VLE
-#error "the selected MCU does not support VLE instructions set"
-#endif
-
-#if !PPC_USE_VLE && !PPC_SUPPORTS_BOOKE
-#error "the selected MCU does not support BookE instructions set"
-#endif
-
-/**
- * @brief Name of the architecture variant.
- */
-#if (PPC_VARIANT == PPC_VARIANT_e200z0) || defined(__DOXYGEN__)
-#define PORT_CORE_VARIANT_NAME "e200z0"
-#elif PPC_VARIANT == PPC_VARIANT_e200z2
-#define PORT_CORE_VARIANT_NAME "e200z2"
-#elif PPC_VARIANT == PPC_VARIANT_e200z3
-#define PORT_CORE_VARIANT_NAME "e200z3"
-#elif PPC_VARIANT == PPC_VARIANT_e200z4
-#define PORT_CORE_VARIANT_NAME "e200z4"
-#else
-#error "unknown or unsupported PowerPC variant specified"
-#endif
-
-/**
- * @brief Port-specific information string.
- */
-#if PPC_USE_VLE
-#define PORT_INFO "VLE mode"
-#else
-#define PORT_INFO "Book-E mode"
-#endif
-
-/*===========================================================================*/
-/* Module data structures and types. */
-/*===========================================================================*/
-
-/* The following code is not processed when the file is included from an
- asm module.*/
-#if !defined(_FROM_ASM_)
-
-/**
- * @brief Type of stack and memory alignment enforcement.
- */
-typedef uint64_t stkalign_t;
-
-/**
- * @brief Generic PPC register.
- */
-typedef void *regppc_t;
-
-/**
- * @brief Mandatory part of a stack frame.
- */
-struct port_eabi_frame {
- uint32_t slink; /**< Stack back link. */
- uint32_t shole; /**< Stack hole for LR storage. */
-};
-
-/**
- * @brief Interrupt saved context.
- * @details This structure represents the stack frame saved during a
- * preemption-capable interrupt handler.
- * @note R2 and R13 are not saved because those are assumed to be immutable
- * during the system life cycle.
- */
-struct port_extctx {
- struct port_eabi_frame frame;
- /* Start of the e_stmvsrrw frame (offset 8).*/
- regppc_t pc;
- regppc_t msr;
- /* Start of the e_stmvsprw frame (offset 16).*/
- regppc_t cr;
- regppc_t lr;
- regppc_t ctr;
- regppc_t xer;
- /* Start of the e_stmvgprw frame (offset 32).*/
- regppc_t r0;
- regppc_t r3;
- regppc_t r4;
- regppc_t r5;
- regppc_t r6;
- regppc_t r7;
- regppc_t r8;
- regppc_t r9;
- regppc_t r10;
- regppc_t r11;
- regppc_t r12;
- regppc_t padding;
- };
-
-/**
- * @brief System saved context.
- * @details This structure represents the inner stack frame during a context
- * switching.
- * @note R2 and R13 are not saved because those are assumed to be immutable
- * during the system life cycle.
- * @note LR is stored in the caller context so it is not present in this
- * structure.
- */
-struct port_intctx {
- regppc_t cr; /* Part of it is not volatile... */
- regppc_t r14;
- regppc_t r15;
- regppc_t r16;
- regppc_t r17;
- regppc_t r18;
- regppc_t r19;
- regppc_t r20;
- regppc_t r21;
- regppc_t r22;
- regppc_t r23;
- regppc_t r24;
- regppc_t r25;
- regppc_t r26;
- regppc_t r27;
- regppc_t r28;
- regppc_t r29;
- regppc_t r30;
- regppc_t r31;
- regppc_t padding;
-};
-
-#endif /* !defined(_FROM_ASM_) */
-
-/*===========================================================================*/
-/* Module macros. */
-/*===========================================================================*/
-
-/**
- * @brief Platform dependent thread stack setup.
- * @details This code usually setup the context switching frame represented
- * by an @p port_intctx structure.
- */
-#define PORT_SETUP_CONTEXT(tp, wend, pf, arg) { \
- uint8_t *sp = (uint8_t *)(wend) - \
- sizeof(struct port_eabi_frame); \
- ((struct port_eabi_frame *)sp)->slink = 0; \
- ((struct port_eabi_frame *)sp)->shole = (uint32_t)_port_thread_start; \
- (tp)->ctxp = (struct port_intctx *)(sp - sizeof(struct port_intctx)); \
- (tp)->ctxp->r31 = (regppc_t)(arg); \
- (tp)->ctxp->r30 = (regppc_t)(pf); \
-}
-
-/**
- * @brief Computes the thread working area global size.
- * @note There is no need to perform alignments in this macro.
- */
-#define PORT_WA_SIZE(n) (sizeof(struct port_intctx) + \
- sizeof(struct port_extctx) + \
- (n) + (PORT_INT_REQUIRED_STACK))
-
-/**
- * @brief IRQ prologue code.
- * @details This macro must be inserted at the start of all IRQ handlers
- * enabled to invoke system APIs.
- */
-#define PORT_IRQ_PROLOGUE()
-
-/**
- * @brief IRQ epilogue code.
- * @details This macro must be inserted at the end of all IRQ handlers
- * enabled to invoke system APIs.
- */
-#define PORT_IRQ_EPILOGUE()
-
-/**
- * @brief IRQ handler function declaration.
- * @note @p id can be a function name or a vector number depending on the
- * port implementation.
- */
-#define PORT_IRQ_HANDLER(id) void id(void)
-
-/**
- * @brief Fast IRQ handler function declaration.
- * @note @p id can be a function name or a vector number depending on the
- * port implementation.
- */
-#define PORT_FAST_IRQ_HANDLER(id) void id(void)
-
-/**
- * @brief Priority level verification macro.
- */
-#define PORT_IRQ_IS_VALID_PRIORITY(n) \
- (((n) >= 0U) && ((n) < INTC_PRIORITY_LEVELS))
-
-/**
- * @brief Priority level verification macro.
- */
-#define PORT_IRQ_IS_VALID_KERNEL_PRIORITY(n) \
- (((n) >= 0U) && ((n) < INTC_PRIORITY_LEVELS))
-
-/**
- * @brief Performs a context switch between two threads.
- * @details This is the most critical code in any port, this function
- * is responsible for the context switch between 2 threads.
- * @note The implementation of this code affects <b>directly</b> the context
- * switch performance so optimize here as much as you can.
- *
- * @param[in] ntp the thread to be switched in
- * @param[in] otp the thread to be switched out
- */
-#if !NIL_CFG_ENABLE_STACK_CHECK || defined(__DOXYGEN__)
-#define port_switch(ntp, otp) _port_switch(ntp, otp)
-#else
-#define port_switch(ntp, otp) { \
- register struct port_intctx *sp asm ("%r1"); \
- if ((stkalign_t *)(sp - 1) < otp->stklim) \
- chSysHalt("stack overflow"); \
- _port_switch(ntp, otp); \
-}
-#endif
-
-/**
- * @brief Writes to a special register.
- *
- * @param[in] spr special register number
- * @param[in] val value to be written, must be an automatic variable
- */
-#define port_write_spr(spr, val) \
- asm volatile ("mtspr %[p0], %[p1]" : : [p0] "n" (spr), [p1] "r" (val))
-
-/**
- * @brief Writes to a special register.
- *
- * @param[in] spr special register number
- * @param[in] val returned value, must be an automatic variable
- */
-#define port_read_spr(spr, val) \
- asm volatile ("mfspr %[p0], %[p1]" : [p0] "=r" (val) : [p1] "n" (spr))
-
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-/* The following code is not processed when the file is included from an
- asm module.*/
-#if !defined(_FROM_ASM_)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- void _port_switch(thread_t *ntp, thread_t *otp);
- void _port_thread_start(void);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(_FROM_ASM_) */
-
-/*===========================================================================*/
-/* Module inline functions. */
-/*===========================================================================*/
-
-/* The following code is not processed when the file is included from an
- asm module.*/
-#if !defined(_FROM_ASM_)
-
-/**
- * @brief Port-related initialization code.
- */
-static inline void port_init(void) {
- uint32_t n;
- unsigned i;
-
- /* Initializing the SPRG0 register to zero, it is required for interrupts
- handling.*/
- n = 0;
- port_write_spr(272, n);
-
-#if PPC_SUPPORTS_IVORS
- /* The CPU supports IVOR registers, the kernel requires IVOR4 and IVOR10
- and the initialization is performed here.*/
- asm volatile ("li %%r3, _IVOR4@l \t\n"
- "mtIVOR4 %%r3 \t\n"
- "li %%r3, _IVOR10@l \t\n"
- "mtIVOR10 %%r3" : : : "r3", "memory");
-#endif
-
- /* INTC initialization, software vector mode, 4 bytes vectors, starting
- at priority 0.*/
- INTC_BCR = 0;
- for (i = 0; i < PPC_CORE_NUMBER; i++) {
- INTC_CPR(i) = 0;
- INTC_IACKR(i) = (uint32_t)_vectors;
- }
-}
-
-/**
- * @brief Returns a word encoding the current interrupts status.
- *
- * @return The interrupts status.
- */
-static inline syssts_t port_get_irq_status(void) {
- uint32_t sts;
-
- asm volatile ("mfmsr %[p0]" : [p0] "=r" (sts) :);
- return sts;
-}
-
-/**
- * @brief Checks the interrupt status.
- *
- * @param[in] sts the interrupt status word
- *
- * @return The interrupt status.
- * @retvel false the word specified a disabled interrupts status.
- * @retvel true the word specified an enabled interrupts status.
- */
-static inline bool port_irq_enabled(syssts_t sts) {
-
- return (bool)((sts & (1 << 15)) != 0);
-}
-
-/**
- * @brief Determines the current execution context.
- *
- * @return The execution context.
- * @retval false not running in ISR mode.
- * @retval true running in ISR mode.
- */
-static inline bool port_is_isr_context(void) {
- uint32_t sprg0;
-
- /* The SPRG0 register is increased before entering interrupt handlers and
- decreased at the end.*/
- port_read_spr(272, sprg0);
- return (bool)(sprg0 > 0);
-}
-
-/**
- * @brief Kernel-lock action.
- */
-static inline void port_lock(void) {
-
- asm volatile ("wrteei 0" : : : "memory");
-}
-
-/**
- * @brief Kernel-unlock action.
- */
-static inline void port_unlock(void) {
-
- asm volatile("wrteei 1" : : : "memory");
-}
-
-/**
- * @brief Kernel-lock action from an interrupt handler.
- */
-static inline void port_lock_from_isr(void) {
-
-}
-
-/**
- * @brief Kernel-unlock action from an interrupt handler.
- */
-static inline void port_unlock_from_isr(void) {
-
-}
-
-/**
- * @brief Disables all the interrupt sources.
- */
-static inline void port_disable(void) {
-
- asm volatile ("wrteei 0" : : : "memory");
-}
-
-/**
- * @brief Disables the interrupt sources below kernel-level priority.
- */
-static inline void port_suspend(void) {
-
- asm volatile ("wrteei 0" : : : "memory");
-}
-
-/**
- * @brief Enables all the interrupt sources.
- */
-static inline void port_enable(void) {
-
- asm volatile ("wrteei 1" : : : "memory");
-}
-
-/**
- * @brief Enters an architecture-dependent IRQ-waiting mode.
- * @details The function is meant to return when an interrupt becomes pending.
- * The simplest implementation is an empty function or macro but this
- * would not take advantage of architecture-specific power saving
- * modes.
- */
-static inline void port_wait_for_interrupt(void) {
-
-#if PPC_ENABLE_WFI_IDLE
- asm volatile ("wait" : : : "memory");
-#endif
-}
-
-/**
- * @brief Returns the current value of the realtime counter.
- *
- * @return The realtime counter value.
- */
-static inline rtcnt_t port_rt_get_counter_value(void) {
-
- return 0;
-}
-
-#endif /* !defined(_FROM_ASM_) */
-
-/*===========================================================================*/
-/* Module late inclusions. */
-/*===========================================================================*/
-
-#if !defined(_FROM_ASM_)
-
-#if NIL_CFG_ST_TIMEDELTA > 0
-#if !PORT_USE_ALT_TIMER
-#include "nilcore_timer.h"
-#else /* PORT_USE_ALT_TIMER */
-#include "nilcore_timer_alt.h"
-#endif /* PORT_USE_ALT_TIMER */
-#endif /* NIL_CFG_ST_TIMEDELTA > 0 */
-
-#endif /* !defined(_FROM_ASM_) */
-
-#endif /* _NILCORE_H_ */
-
-/** @} */