summaryrefslogtreecommitdiff
path: root/bsps/i386/pc386/start
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/i386/pc386/start')
-rw-r--r--bsps/i386/pc386/start/bspsmp.c43
-rw-r--r--bsps/i386/pc386/start/getcpuid.c22
-rw-r--r--bsps/i386/pc386/start/smp-imps.c40
3 files changed, 50 insertions, 55 deletions
diff --git a/bsps/i386/pc386/start/bspsmp.c b/bsps/i386/pc386/start/bspsmp.c
new file mode 100644
index 0000000000..026f86916f
--- /dev/null
+++ b/bsps/i386/pc386/start/bspsmp.c
@@ -0,0 +1,43 @@
+
+#include <rtems/score/smpimpl.h>
+
+#include <bsp/apic.h>
+#include <bsp/smp-imps.h>
+#include <bsp.h>
+#include <rtems.h>
+
+void _CPU_SMP_Prepare_start_multitasking( void )
+{
+ /* Do nothing */
+}
+
+bool _CPU_SMP_Start_processor( uint32_t cpu_index )
+{
+ (void) cpu_index;
+
+ return true;
+}
+
+
+uint32_t _CPU_SMP_Get_current_processor( void )
+{
+ return imps_apic_cpu_map[APIC_ID(IMPS_LAPIC_READ(LAPIC_ID))];
+}
+
+uint32_t _CPU_SMP_Initialize( void )
+{
+ /* XXX need to deal with finding too many cores */
+
+ return (uint32_t) imps_probe();
+}
+
+void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
+{
+ if ( cpu_count > 1 )
+ ipi_install_irq();
+}
+
+void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
+{
+ send_ipi( target_processor_index, 0x30 );
+}
diff --git a/bsps/i386/pc386/start/getcpuid.c b/bsps/i386/pc386/start/getcpuid.c
deleted file mode 100644
index 4918a2a970..0000000000
--- a/bsps/i386/pc386/start/getcpuid.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * COPYRIGHT (c) 2011.
- * 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/score/cpu.h>
-
-#include <bsp/apic.h>
-#include <bsp/smp-imps.h>
-
-static int lapic_dummy = 0;
-unsigned imps_lapic_addr = ((unsigned)(&lapic_dummy)) - LAPIC_ID;
-
-uint32_t _CPU_SMP_Get_current_processor( void )
-{
- return imps_apic_cpu_map[APIC_ID(IMPS_LAPIC_READ(LAPIC_ID))];
-}
-
diff --git a/bsps/i386/pc386/start/smp-imps.c b/bsps/i386/pc386/start/smp-imps.c
index 6480c0d25e..de593f3c40 100644
--- a/bsps/i386/pc386/start/smp-imps.c
+++ b/bsps/i386/pc386/start/smp-imps.c
@@ -85,6 +85,9 @@
extern void _pc386_delay(void);
extern uint32_t* gdtdesc;
+static int lapic_dummy = 0;
+unsigned imps_lapic_addr = ((unsigned)(&lapic_dummy)) - LAPIC_ID;
+
/* #define KERNEL_PRINT(_format) printk(_format) */
static void CMOS_WRITE_BYTE(
@@ -220,7 +223,7 @@ get_checksum(unsigned start, int length)
/*
* APIC ICR write and status check function.
*/
-static int
+int
send_ipi(unsigned int dst, unsigned int v)
{
int to, send_status;
@@ -698,7 +701,7 @@ imps_force(int ncpus)
*
* Function finished.
*/
-static int
+int
imps_probe(void)
{
/*
@@ -768,7 +771,8 @@ static void bsp_inter_processor_interrupt(void *arg)
_SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
}
-static void ipi_install_irq(void)
+void
+ipi_install_irq(void)
{
rtems_status_code status;
@@ -802,33 +806,3 @@ static void secondary_cpu_initialize(void)
_SMP_Start_multitasking_on_secondary_processor( _Per_CPU_Get() );
}
-
-uint32_t _CPU_SMP_Initialize( void )
-{
- /* XXX need to deal with finding too many cores */
-
- return (uint32_t) imps_probe();
-}
-
-void _CPU_SMP_Prepare_start_multitasking( void )
-{
- /* Do nothing */
-}
-
-bool _CPU_SMP_Start_processor( uint32_t cpu_index )
-{
- (void) cpu_index;
-
- return true;
-}
-
-void _CPU_SMP_Finalize_initialization( uint32_t cpu_count )
-{
- if ( cpu_count > 1 )
- ipi_install_irq();
-}
-
-void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
-{
- send_ipi( target_processor_index, 0x30 );
-}