aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/STM8S-STM8S208-RC/ch.rapp74
-rw-r--r--demos/STM8S-STM8S208-RC/ch.rprj4
-rw-r--r--docs/reports/STM8S208-16.txt24
-rw-r--r--os/ports/RC/STM8/chcore.c10
-rw-r--r--os/ports/RC/STM8/chcore.h24
5 files changed, 74 insertions, 62 deletions
diff --git a/demos/STM8S-STM8S208-RC/ch.rapp b/demos/STM8S-STM8S208-RC/ch.rapp
index 8378004bc..499f89206 100644
--- a/demos/STM8S-STM8S208-RC/ch.rapp
+++ b/demos/STM8S-STM8S208-RC/ch.rapp
@@ -1,5 +1,5 @@
-<ApplicationBuild Header="ch" Extern=".\ch.rapp" Path=".\ch.rapp" OutputFile="..\STM8S-STM8S208-RC/bin\ch.aof" sate="98" >
+<ApplicationBuild Header="ch" Extern=".\ch.rapp" Path=".\ch.rapp" OutputFile="..\STM8S-STM8S208-RC/bin\ch.aof" sate="96" >
<Group Header="kernel" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\os\kernel\src\chcond.c" Header="chcond.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chcond.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chdebug.c" Header="chdebug.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chdebug.obj" sate="0" />
@@ -10,15 +10,15 @@
<Set Header="RCST7" >
<Section Header="Model" >
<Property Header="GlobalMemory" Value="" Removable="1" />
-
+
</Section>
-
+
</Set>
-
+
</Config>
-
+
</Options>
-
+
</NodeC>
<NodeC Path="..\..\os\kernel\src\chlists.c" Header="chlists.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chlists.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chmboxes.c" Header="chmboxes.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chmboxes.obj" sate="0" />
@@ -28,21 +28,9 @@
<NodeC Path="..\..\os\kernel\src\chmtx.c" Header="chmtx.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chmtx.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chqueues.c" Header="chqueues.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chqueues.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chregistry.c" Header="chregistry.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chregistry.obj" sate="0" />
- <NodeC Path="..\..\os\kernel\src\chschd.c" Header="chschd.c" Marker="0" OutputFile="..\STM8S-STM8S208-RC/bin\chschd.obj" sate="0" >
- <Options>
- <Config Header="Standard" >
- <Set Header="RCST7" >
- <Section Header="Model" >
- <Property Header="GlobalMemory" Value="" Removable="1" />
-
- </Section>
-
- </Set>
-
- </Config>
-
- </Options>
-
+ <NodeC Path="..\..\os\kernel\src\chschd.c" Header="chschd.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chschd.obj" sate="0" >
+ <Options/>
+
</NodeC>
<NodeC Path="..\..\os\kernel\src\chsem.c" Header="chsem.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chsem.obj" sate="0" />
<NodeC Path="..\..\os\kernel\src\chsys.c" Header="chsys.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chsys.obj" sate="0" />
@@ -53,17 +41,17 @@
<Set Header="RCST7" >
<Section Header="Model" >
<Property Header="GlobalMemory" Value="" Removable="1" />
-
+
</Section>
-
+
</Set>
-
+
</Config>
-
+
</Options>
-
+
</NodeC>
-
+
</Group>
<Group Header="test" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\test\test.c" Header="test.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\test.obj" sate="0" />
@@ -78,13 +66,13 @@
<NodeC Path="..\..\test\testqueues.c" Header="testqueues.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\testqueues.obj" sate="0" />
<NodeC Path="..\..\test\testsem.c" Header="testsem.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\testsem.obj" sate="0" />
<NodeC Path="..\..\test\testthd.c" Header="testthd.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\testthd.obj" sate="0" />
-
+
</Group>
<Group Header="port" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\os\ports\RC\STM8\chcore.c" Header="chcore.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\chcore.obj" sate="0" />
-
+
</Group>
- <Group Header="hal" Marker="-1" OutputFile="" sate="96" >
+ <Group Header="hal" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\os\hal\src\adc.c" Header="adc.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\adc.obj" sate="0" />
<NodeC Path="..\..\os\hal\src\can.c" Header="can.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\can.obj" sate="0" />
<NodeC Path="..\..\os\hal\src\hal.c" Header="hal.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\hal.obj" sate="0" />
@@ -97,11 +85,11 @@
<NodeC Path="..\..\os\hal\platforms\STM8\hal_lld.c" Header="hal_lld.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\hal_lld.obj" sate="0" />
<NodeC Path="..\..\os\hal\platforms\STM8\serial_lld.c" Header="serial_lld.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\serial_lld.obj" sate="0" />
<NodeC Path="..\..\os\hal\platforms\STM8\pal_lld.c" Header="pal_lld.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\pal_lld.obj" sate="0" />
-
+
</Group>
<Group Header="board" Marker="-1" OutputFile="" sate="0" >
<NodeC Path="..\..\boards\RAISONANCE_REVA_STM8S\board.c" Header="board.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\board.obj" sate="0" />
-
+
</Group>
<NodeC Path=".\main.c" Header="main.c" Marker="-1" OutputFile="..\STM8S-STM8S208-RC/bin\main.obj" sate="0" />
<Options>
@@ -109,21 +97,21 @@
<Set Header="ApplicationBuild" >
<Section Header="General" >
<Property Header="TargetFamily" Value="ST7" />
-
+
</Section>
<Section Header="Directories" >
<Property Header="IncDir" Value="$(RkitInc);$(RkitInc)\ST7;..\..\os\kernel\include;..\..\os\ports\RC\STM8;..\..\os\hal\include;..\..\os\hal\platforms\STM8;..\..\boards\RAISONANCE_REVA_STM8S;..\..\test" Removable="1" />
<Property Header="OutDir" Value="$(ApplicationDir)/bin" Removable="1" />
<Property Header="ListDir" Value="$(ApplicationDir)/lst" Removable="1" />
<Property Header="LinkerOutputDir" Value="Output Directory" Removable="1" />
-
+
</Section>
-
+
</Set>
<Set Header="Target" >
<Section Header="ProcessorST7" >
<Property Header="Processor" Value="STM8S208MB" Removable="1" />
-
+
</Section>
<Section Header="ToolSetST7" >
<Property Header="BuildToolSetST7" Value="ST7\RaisonanceTools.config" Removable="1" />
@@ -134,33 +122,33 @@
<Section Header="DebugST7" >
<Property Header="Startup" Value="1" Removable="1" />
<Property Header="DebugTool_STM8" Value="RLINK_STM8" Removable="1" />
-
+
</Section>
</Set>
<Set Header="RCST7" >
<Section Header="CodeGen" >
<Property Header="ENUMTYPE" Value="ET(CHAR)" Removable="1" />
-
+
</Section>
<Section Header="Model" >
<Property Header="GlobalMemory" Value="DGC(DATA)" Removable="1" />
<Property Header="ModelP" Value="STM8(SMALL)" Removable="1" />
-
+
</Section>
<Section Header="OPTIM" >
<Property Header="OTLEVEL" Value="3" Removable="1" />
<Property Header="SPEEDSIZE" Value="SPEED" Removable="1" />
-
+
</Section>
-
+
</Set>
<Set Header="MAST7" >
<Section Header="Set" >
<Property Header="Defines" Value="STM8S208RB" Removable="1" />
-
+
</Section>
-
+
</Set>
</Config>
</Options>
diff --git a/demos/STM8S-STM8S208-RC/ch.rprj b/demos/STM8S-STM8S208-RC/ch.rprj
index dc557d7be..d066d7b79 100644
--- a/demos/STM8S-STM8S208-RC/ch.rprj
+++ b/demos/STM8S-STM8S208-RC/ch.rprj
@@ -1,4 +1,4 @@
-<Project Header="Project 'ch'" Path=".\ch.rprj" Project="Yes" OutputFile="" sate="96" ActiveApp="ch" >
- <ApplicationBuild Header="ch" Extern=".\ch.rapp" Path=".\ch.rapp" OutputFile="..\STM8S-STM8S208-RC/bin\ch.aof" sate="98" />
+<Project Header="Project 'ch'" Path=".\ch.rprj" Project="Yes" OutputFile="" sate="98" ActiveApp="ch" >
+ <ApplicationBuild Header="ch" Extern=".\ch.rapp" Path=".\ch.rapp" OutputFile="..\STM8S-STM8S208-RC/bin\ch.aof" sate="96" />
</Project> \ No newline at end of file
diff --git a/docs/reports/STM8S208-16.txt b/docs/reports/STM8S208-16.txt
index 6cf66f335..0c6ddb59d 100644
--- a/docs/reports/STM8S208-16.txt
+++ b/docs/reports/STM8S208-16.txt
@@ -6,7 +6,7 @@ Compiler: Raisonance RKit-STM8_2.28.10.0092
*** ChibiOS/RT test suite
***
-*** Kernel: 1.5.7unstable
+*** Kernel: 1.5.9unstable
*** Architecture: STM8
*** Platform: STM8x
*** Test Board: Raisonance REva V3 + STM8S208RB
@@ -67,31 +67,31 @@ Compiler: Raisonance RKit-STM8_2.28.10.0092
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
---- Score : 31156 msgs/S, 62312 ctxswc/S
+--- Score : 31277 msgs/S, 62554 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
---- Score : 24035 msgs/S, 48070 ctxswc/S
+--- Score : 24107 msgs/S, 48214 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
---- Score : 24035 msgs/S, 48070 ctxswc/S
+--- Score : 24107 msgs/S, 48214 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
---- Score : 108456 ctxswc/S
+--- Score : 108544 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
---- Score : 17186 threads/S
+--- Score : 17261 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
---- Score : 26073 threads/S
+--- Score : 26116 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads)
---- Score : 6884 reschedules/S, 41304 ctxswc/S
+--- Score : 6919 reschedules/S, 41514 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
@@ -99,19 +99,19 @@ Compiler: Raisonance RKit-STM8_2.28.10.0092
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
---- Score : 65072 bytes/S
+--- Score : 64416 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
---- Score : 55670 timers/S
+--- Score : 55770 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
---- Score : 220452 wait+signal/S
+--- Score : 211692 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, RAM footprint)
---- System: 179 bytes
+--- System: 177 bytes
--- Thread: 29 bytes
--- Timer : 10 bytes
--- Semaph: 6 bytes
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_ */
/** @} */