aboutsummaryrefslogtreecommitdiffstats
path: root/os/ports/GCC/PPC/chcore.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-13 11:43:14 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-02-13 11:43:14 +0000
commit24469eee457801a9fe66f6dc77a74c05c50fdbaf (patch)
treeb1859792f95f763dde1cc321739cfed02f05c8e4 /os/ports/GCC/PPC/chcore.c
parent1b8cc3f865d5780ff37d92b2d7fb18df1ef99626 (diff)
downloadChibiOS-24469eee457801a9fe66f6dc77a74c05c50fdbaf.tar.gz
ChibiOS-24469eee457801a9fe66f6dc77a74c05c50fdbaf.tar.bz2
ChibiOS-24469eee457801a9fe66f6dc77a74c05c50fdbaf.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5176 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ports/GCC/PPC/chcore.c')
-rw-r--r--os/ports/GCC/PPC/chcore.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/os/ports/GCC/PPC/chcore.c b/os/ports/GCC/PPC/chcore.c
index 8403e0171..c3170c6cf 100644
--- a/os/ports/GCC/PPC/chcore.c
+++ b/os/ports/GCC/PPC/chcore.c
@@ -67,11 +67,11 @@ void port_halt(void) {
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/
-void port_switch(Thread *ntp, Thread *otp) {
-
- (void)otp;
- (void)ntp;
+__attribute__((naked))
+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. */
@@ -88,6 +88,7 @@ void port_switch(Thread *ntp, Thread *otp) {
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");
}
/**
@@ -95,8 +96,11 @@ void port_switch(Thread *ntp, Thread *otp) {
* @details If the work function returns @p chThdExit() is automatically
* invoked.
*/
-void _port_thread_start(void) {
+__attribute__((naked))
+void port_dummy2(void) {
+ asm (".global _port_thread_start");
+ asm ("_port_thread_start:");
chSysUnlock();
asm ("mr %r3, %r31"); /* Thread parameter. */
asm ("mtctr %r30");