aboutsummaryrefslogtreecommitdiffstats
path: root/demos/Win32-MinGW
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-01-20 20:11:02 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-01-20 20:11:02 +0000
commit4d2e568b56607bb166c4d2dd004b1c9970c2879f (patch)
treeb760b645c8973b1a9a6f210f8c372bacc42c6ab2 /demos/Win32-MinGW
parent22e22db0161126d1c58a07e2323662efc18d6c86 (diff)
downloadChibiOS-4d2e568b56607bb166c4d2dd004b1c9970c2879f.tar.gz
ChibiOS-4d2e568b56607bb166c4d2dd004b1c9970c2879f.tar.bz2
ChibiOS-4d2e568b56607bb166c4d2dd004b1c9970c2879f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@650 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/Win32-MinGW')
-rw-r--r--demos/Win32-MinGW/Makefile2
-rw-r--r--demos/Win32-MinGW/chcore.c6
-rw-r--r--demos/Win32-MinGW/chcore.h36
3 files changed, 22 insertions, 22 deletions
diff --git a/demos/Win32-MinGW/Makefile b/demos/Win32-MinGW/Makefile
index bda1426cb..841557827 100644
--- a/demos/Win32-MinGW/Makefile
+++ b/demos/Win32-MinGW/Makefile
@@ -77,7 +77,7 @@ ULIBDIR =
ULIBS =
# Define optimisation level here
-OPT = -ggdb -Os -fomit-frame-pointer
+OPT = -ggdb -O2 -fomit-frame-pointer
#
# End of user defines
diff --git a/demos/Win32-MinGW/chcore.c b/demos/Win32-MinGW/chcore.c
index 1dc05569c..446508e3c 100644
--- a/demos/Win32-MinGW/chcore.c
+++ b/demos/Win32-MinGW/chcore.c
@@ -98,7 +98,7 @@ void ChkIntSources(void) {
* @param msg pointer to the message
*/
__attribute__((fastcall))
-void sys_puts(char *msg) {
+void port_puts(char *msg) {
}
/**
@@ -107,7 +107,7 @@ void sys_puts(char *msg) {
* @param ntp the thread to be switched in
*/
__attribute__((fastcall))
-void sys_switch(Thread *otp, Thread *ntp) {
+void port_switch(Thread *otp, Thread *ntp) {
register struct intctx volatile *esp asm("esp");
asm volatile ("push %ebp \n\t" \
@@ -126,7 +126,7 @@ void sys_switch(Thread *otp, Thread *ntp) {
* Halts the system. In this implementation it just exits the simulation.
*/
__attribute__((fastcall))
-void sys_halt(void) {
+void port_halt(void) {
exit(2);
}
diff --git a/demos/Win32-MinGW/chcore.h b/demos/Win32-MinGW/chcore.h
index 40555df63..029de3566 100644
--- a/demos/Win32-MinGW/chcore.h
+++ b/demos/Win32-MinGW/chcore.h
@@ -65,9 +65,9 @@ struct intctx {
* This structure usually contains just the saved stack pointer defined as a
* pointer to a @p intctx structure.
*/
-typedef struct {
+struct context {
struct intctx volatile *esp;
-} Context;
+};
#define APUSH(p, a) (p) -= sizeof(void *), *(void **)(p) = (void*)(a)
@@ -130,71 +130,71 @@ typedef struct {
* IRQ prologue code, inserted at the start of all IRQ handlers enabled to
* invoke system APIs.
*/
-#define SYS_IRQ_PROLOGUE()
+#define PORT_IRQ_PROLOGUE()
/**
* IRQ epilogue code, inserted at the end of all IRQ handlers enabled to
* invoke system APIs.
*/
-#define SYS_IRQ_EPILOGUE()
+#define PORT_IRQ_EPILOGUE()
/**
- * IRQ handler function modifier.
+ * IRQ handler function declaration.
*/
-#define SYS_IRQ_HANDLER
+#define PORT_IRQ_HANDLER(id) void id(void)
/**
* Simulator initialization.
*/
-#define sys_init() InitCore()
+#define port_init() InitCore()
/**
* Does nothing in this simulator.
*/
-#define sys_disable_all()
+#define port_lock()
/**
* Does nothing in this simulator.
*/
-#define sys_disable()
+#define port_unlock()
/**
* Does nothing in this simulator.
*/
-#define sys_enable()
+#define port_lock_from_isr()
/**
* Does nothing in this simulator.
*/
-#define sys_lock()
+#define port_unlock_from_isr()
/**
* Does nothing in this simulator.
*/
-#define sys_unlock()
+#define port_disable()
/**
* Does nothing in this simulator.
*/
-#define sys_lock_from_isr()
+#define port_suspend()
/**
* Does nothing in this simulator.
*/
-#define sys_unlock_from_isr()
+#define port_enable()
/**
* In the simulator this does a polling pass on the simulated interrupt
* sources.
*/
-#define sys_wait_for_interrupt() ChkIntSources()
+#define port_wait_for_interrupt() ChkIntSources()
#ifdef __cplusplus
extern "C" {
#endif
- __attribute__((fastcall)) void sys_puts(char *msg);
- __attribute__((fastcall)) void sys_switch(Thread *otp, Thread *ntp);
- __attribute__((fastcall)) void sys_halt(void);
+ __attribute__((fastcall)) void port_puts(char *msg);
+ __attribute__((fastcall)) void port_switch(Thread *otp, Thread *ntp);
+ __attribute__((fastcall)) void port_halt(void);
void InitCore(void);
void ChkIntSources(void);
void threadexit(void);