summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2016-01-08 12:15:46 -0500
committerGedare Bloom <gedare@rtems.org>2016-03-03 16:36:29 -0500
commitfd05a055e67128f2410629dba52f8c33e08d2297 (patch)
tree250c660a7d70cca07165429181b8bad0d75527d9
parentversion.c: Add space so printing is neater (diff)
downloadrtems-fd05a055e67128f2410629dba52f8c33e08d2297.tar.bz2
i386: move idle thread into BSP layer
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.am1
-rw-r--r--c/src/lib/libbsp/i386/pc386/include/bsp.h3
-rw-r--r--c/src/lib/libbsp/i386/pc386/startup/bspidle.S19
-rw-r--r--cpukit/score/cpu/i386/cpu.c8
-rw-r--r--cpukit/score/cpu/i386/rtems/score/cpu.h2
5 files changed, 24 insertions, 9 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index ac0774126f..75a56c9e95 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -148,6 +148,7 @@ include_HEADERS += ../../i386/shared/comm/uart.h
# startup
libbsp_a_SOURCES += ../../shared/bsppredriverhook.c
libbsp_a_SOURCES += startup/bspgetworkarea.c
+libbsp_a_SOURCES += startup/bspidle.S
libbsp_a_SOURCES += startup/bspstart.c
libbsp_a_SOURCES += startup/bspcmdline.c
libbsp_a_SOURCES += ../../shared/bspclean.c
diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h
index d68af4d9db..cee5566f0d 100644
--- a/c/src/lib/libbsp/i386/pc386/include/bsp.h
+++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h
@@ -213,6 +213,9 @@ void rtems_irq_mngt_init(void); /* from 'irq_init.c' */
} while ( 0 )
#endif /* edison */
+void *bsp_idle_thread( uintptr_t ignored );
+#define BSP_IDLE_TASK_BODY bsp_idle_thread
+
void kbd_reset_setup(char *str, int *ints); /* from 'pc_keyb.c' */
size_t read_aux(char * buffer, size_t count); /* from 'ps2_mouse.c' */
diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspidle.S b/c/src/lib/libbsp/i386/pc386/startup/bspidle.S
new file mode 100644
index 0000000000..740671afc1
--- /dev/null
+++ b/c/src/lib/libbsp/i386/pc386/startup/bspidle.S
@@ -0,0 +1,19 @@
+/*
+ * Idle Thread Body
+ *
+ * COPYRIGHT (c) 2016.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <rtems/asm.h>
+
+.p2align 4
+
+PUBLIC(bsp_idle_thread)
+SYM(bsp_idle_thread):
+hltloop: hlt
+ jmp hltloop
diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c
index f22c4d3471..17aa990f3c 100644
--- a/cpukit/score/cpu/i386/cpu.c
+++ b/cpukit/score/cpu/i386/cpu.c
@@ -120,14 +120,6 @@ uint32_t _CPU_ISR_Get_level( void )
return level;
}
-void *_CPU_Thread_Idle_body( uintptr_t ignored )
-{
- while(1){
- __asm__ volatile ("hlt");
- }
- return NULL;
-}
-
struct Frame_ {
struct Frame_ *up;
uintptr_t pc;
diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h
index d6828dc3ac..dc9deee953 100644
--- a/cpukit/score/cpu/i386/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/rtems/score/cpu.h
@@ -117,7 +117,7 @@ extern "C" {
* not provide one.
*/
-#define CPU_PROVIDES_IDLE_THREAD_BODY TRUE
+#define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
/*
* Define what is required to specify how the network to host conversion