aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-06-02 11:34:53 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-06-02 11:34:53 +0000
commitb2db83ef52aa6668193bdc71a88b81d3aefefea0 (patch)
tree9b2ec6423b3b1db1f326ed8f80bdf9f0e81489fe /os/ports
parent4ee79187645d1a2687f81de3f19320acbce733c8 (diff)
downloadChibiOS-b2db83ef52aa6668193bdc71a88b81d3aefefea0.tar.gz
ChibiOS-b2db83ef52aa6668193bdc71a88b81d3aefefea0.tar.bz2
ChibiOS-b2db83ef52aa6668193bdc71a88b81d3aefefea0.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1983 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports')
-rw-r--r--os/ports/RC/STM8/chcore.c10
-rw-r--r--os/ports/RC/STM8/chcore.h24
2 files changed, 29 insertions, 5 deletions
diff --git a/os/ports/RC/STM8/chcore.c b/os/ports/RC/STM8/chcore.c
index af890f6b9..6aaa182af 100644
--- a/os/ports/RC/STM8/chcore.c
+++ b/os/ports/RC/STM8/chcore.c
@@ -28,6 +28,8 @@
#include "ch.h"
+page0 ReadyList rlist;
+
/**
* @brief Performs a context switch between two threads.
*
@@ -38,12 +40,10 @@ void _port_switch(Thread *otp) {
(void)otp;
/* Asm because unoptimal code would generated by using _getSP_().*/
#pragma ASM
- EXTRN PAGE0(rlist)
-
LDW Y,SP ; old context pointer
- LDW (005H,X),Y ; SP saved in otp->p_ctx.sp
- LDW X,rlist + 0DH ; r_current (currp) field
- LDW X,(005H,X) ; currp->p_ctx.sp
+ LDW (5,X),Y ; SP saved in otp->p_ctx.sp
+ LDW X,rlist + 5 ; r_current (currp) field
+ LDW X,(5,X) ; currp->p_ctx.sp
LDW SP,X ; new context pointer
#pragma ENDASM
}
diff --git a/os/ports/RC/STM8/chcore.h b/os/ports/RC/STM8/chcore.h
index 6fa112346..c4f490edc 100644
--- a/os/ports/RC/STM8/chcore.h
+++ b/os/ports/RC/STM8/chcore.h
@@ -273,6 +273,30 @@ extern "C" {
}
#endif
+/*===========================================================================*/
+/* Scheduler captured code. */
+/*===========================================================================*/
+
+#define PORT_OPTIMIZED_RLIST_VAR
+#define PORT_OPTIMIZED_RLIST_EXT
+#define PORT_OPTIMIZED_READYLIST_STRUCT
+
+typedef struct {
+ ThreadsQueue r_queue;
+ tprio_t r_prio;
+ Thread *r_current;
+#if CH_USE_REGISTRY
+ Thread *r_newer;
+ Thread *r_older;
+#endif
+ /* End of the fields shared with the Thread structure.*/
+#if CH_TIME_QUANTUM > 0
+ cnt_t r_preempt;
+#endif
+} ReadyList;
+
+extern page0 ReadyList rlist;
+
#endif /* _CHCORE_H_ */
/** @} */