aboutsummaryrefslogtreecommitdiff
path: root/Debugger/_c_arm_macros.h
diff options
context:
space:
mode:
authorTC Wan2010-12-02 10:23:37 +0800
committerTC Wan2010-12-02 10:23:37 +0800
commit825dba78c19d206f765a61506851a3cebf4cffb8 (patch)
treec324f868f387e688414179b6d39a06d88a4d4c51 /Debugger/_c_arm_macros.h
parente222748d4f2241b2b357c1dc6b1b734ebdde6525 (diff)
changed the license clause, misc cleanups
The armdebug project is now dual licensed to make it easier to integrate with the LEGO NXT firmware. You can choose either to use the GPLv2 or the LEGO Open Source License to integrate this into other projects. Misc cleanups: Removed types.h Moved Debugger Macros into its own file to improve readability. Added COPYING, LEGO license and GPL license texts.
Diffstat (limited to 'Debugger/_c_arm_macros.h')
-rw-r--r--Debugger/_c_arm_macros.h97
1 files changed, 18 insertions, 79 deletions
diff --git a/Debugger/_c_arm_macros.h b/Debugger/_c_arm_macros.h
index f356a25..025542e 100644
--- a/Debugger/_c_arm_macros.h
+++ b/Debugger/_c_arm_macros.h
@@ -3,21 +3,25 @@
*
*/
-/* Copyright (C) 2007,2009 the NxOS developers
+/* Copyright (C) 2010 the NxOS developers
+ *
+ * Module Developed by: TC Wan <tcwan@cs.usm.my>
+ *
* Thanks to Bartli (forum post @ embdev.net ARM programming with GCC/GNU tools forum)
*
* See AUTHORS for a full list of the developers.
*
- * Redistribution of this file is permitted under
- * the terms of the GNU Public License (GPL) version 2.
+ * See COPYING for redistribution license
+ *
*/
-#ifndef __NXOS_BASE_C_ARM_MACROS__
-#define __NXOS_BASE_C_ARM_MACROS__
+#ifndef __C_ARM_MACROS__
+#define __C_ARM_MACROS__
+
#ifdef __ASSEMBLY__
-#define NULL 0x0 /* Stick the definition here instead of making types.h messy */
+#define NULL 0x0
#define FALSE 0
#define TRUE ~FALSE
@@ -38,71 +42,7 @@
enum_val name
#define ENUM_END(enum_name)
-/** Macro to define driver ioctl table
- * First five table entries are predefined
- * 0: init
- * 1: shutdown
- * 2: sleep
- * 3: wakeup
- * 4: poll
- *
- */
-#define DRIVER_IOCTL(driver) \
-/* Dummy sleep and wakeup routines for now */ ;\
- .set driver ## _sleep, NULL ;\
- .set driver ## _wakeup, NULL ;\
- .set driver ## _poll, NULL ;\
-.data ;\
- .align 4 ;\
- .global driver ## _ioctl ;\
-driver ## _ioctl: ;\
- .word driver ## _init ;\
- .word driver ## _shutdown ;\
- .word driver ## _sleep ;\
- .word driver ## _wakeup ;\
- .word driver ## _poll ;\
- .set num_ ## driver ## _cmds, 5
-
-/** Macro to define additional driver ioctl commands
- * Be careful to follow the sequence defined for the CMD enums
- * The first CMD should have an enum value of 5
- *
- */
-#define DRIVER_CMD(driver, cmd) \
- .word driver ## _ ## cmd ;\
- .set num_ ## driver ## _cmds, num_ ## driver ## _cmds + 1
-
-/** Macro to define driver state
- * MUST BE DEFINED AFTER DRIVER_IOCTL section
- * @param driver name of driver
- * @param driverenum enum value of driver (in [31:25])
- *
- * The number of commands for driver (in [24:17]) -- derived from num_driver_cmds
- *
- * Format of driver_state table:
- * driver signature (driverenum << 24 | numcommands << 16)
- * driver parameters (per device instance)
- */
-#define DRIVER_STATE(driver, driverenum) \
-.bss ;\
- .global driver ## _state ;\
-driver ## _state: ;\
- .set driver ## _signature, (driverenum << 24) | (num_ ## driver ## _cmds << 16) ;\
- .word NULL /* driver_signature */
-
-
-/** Macro to define actual driver routine in .S
- * On entry:
- * r0 - address of driver_state
- * r1-r3 - parameters (variable)
- * r12 - number of parameters (IPC scratch register)
- * Stack - parameters (variable)
- */
-#define DRIVER_ROUTINE(driver, cmd) \
- .global driver ## _ ## cmd ## ;\
-driver ## _ ## cmd ## :
-
-#else
+#else /* C Defines */
/** Macro to control typedef generation
*
*/
@@ -137,13 +77,12 @@ driver ## _ ## cmd ## :
#endif
+/* Example of how to use the ENUM definition macros
ENUM_BEGIN
-ENUM_VAL(INIT) /**< Driver Init Routine. */
-ENUM_VAL(SHUTDOWN) /**< Driver Shutdown Routine. */
-ENUM_VAL(SLEEP) /**< Driver Sleep Routine. */
-ENUM_VAL(WAKEUP) /**< Driver Wakeup Routine. */
-ENUM_VAL(POLL) /**< Driver Poll Routine. */
-ENUM_END(nx_driver_default_cmd)
-
+ENUM_VAL(INIT)
+ENUM_VAL(RESET)
+ENUM_VAL(CONFIGURED)
+ENUM_END(enum_label)
+*/
-#endif /* __NXOS_BASE_C_ARM_MACROS__ */
+#endif /* __C_ARM_MACROS__ */