summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r--c/src/lib/libcpu/powerpc/configure.in2
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c60
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c23
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/cpm/cp.c7
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/cpm/dpram.c6
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/include/cpm.h2
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/include/mmu.h2
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c3
-rw-r--r--c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c7
9 files changed, 55 insertions, 57 deletions
diff --git a/c/src/lib/libcpu/powerpc/configure.in b/c/src/lib/libcpu/powerpc/configure.in
index db92d4bc8f..94781cf671 100644
--- a/c/src/lib/libcpu/powerpc/configure.in
+++ b/c/src/lib/libcpu/powerpc/configure.in
@@ -70,4 +70,6 @@ mpc6xx/mmu/Makefile
mpc6xx/timer/Makefile
mpc6xx/wrapup/Makefile
shared/Makefile
+shared/include/Makefile
+shared/src/Makefile
wrapup/Makefile)
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c b/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c
index 50de9d7772..21c8de6df6 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/clock/clock.c
@@ -36,15 +36,13 @@
* $Id$
*/
-#include <bsp.h>
+#include <rtems.h>
#include <clockdrv.h>
#include <rtems/libio.h>
#include <stdlib.h> /* for atexit() */
#include <mpc8xx.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
volatile rtems_unsigned32 Clock_driver_ticks;
extern volatile m8xx_t m8xx;
@@ -78,37 +76,35 @@ void Install_clock(rtems_isr_entry clock_isr)
Clock_driver_ticks = 0;
- pit_value = (BSP_Configuration.microseconds_per_tick *
- Cpu_table.clicks_per_usec) - 1 ;
+ pit_value = (rtems_configuration_get_microseconds_per_tick() *
+ rtems_cpu_configuration_get_clicks_per_usec()) - 1 ;
if (pit_value > 0xffff) { /* pit is only 16 bits long */
rtems_fatal_error_occurred(-1);
}
- if (BSP_Configuration.ticks_per_timeslice) {
-
- /*
- * initialize the interval here
- * First tick is set to right amount of time in the future
- * Future ticks will be incremented over last value set
- * in order to provide consistent clicks in the face of
- * interrupt overhead
- */
-
- rtems_interrupt_catch(clock_isr, PPC_IRQ_LVL0, &previous_isr);
-
- m8xx.sccr &= ~(1<<24);
- m8xx.pitc = pit_value;
-
- /* set PIT irq level, enable PIT, PIT interrupts */
- /* and clear int. status */
- m8xx.piscr = M8xx_PISCR_PIRQ(0) |
- M8xx_PISCR_PTE | M8xx_PISCR_PS | M8xx_PISCR_PIE;
+
+ /*
+ * initialize the interval here
+ * First tick is set to right amount of time in the future
+ * Future ticks will be incremented over last value set
+ * in order to provide consistent clicks in the face of
+ * interrupt overhead
+ */
+
+ rtems_interrupt_catch(clock_isr, PPC_IRQ_LVL0, &previous_isr);
+
+ m8xx.sccr &= ~(1<<24);
+ m8xx.pitc = pit_value;
+
+ /* set PIT irq level, enable PIT, PIT interrupts */
+ /* and clear int. status */
+ m8xx.piscr = M8xx_PISCR_PIRQ(0) |
+ M8xx_PISCR_PTE | M8xx_PISCR_PS | M8xx_PISCR_PIE;
#ifdef EPPCBUG_SMC1
- simask_copy = m8xx.simask | M8xx_SIMASK_LVM0;
+ simask_copy = m8xx.simask | M8xx_SIMASK_LVM0;
#endif /* EPPCBUG_SMC1 */
- m8xx.simask |= M8xx_SIMASK_LVM0;
- }
+ m8xx.simask |= M8xx_SIMASK_LVM0;
atexit(Clock_exit);
}
@@ -133,12 +129,10 @@ ReInstall_clock(rtems_isr_entry new_clock_isr)
void
Clock_exit(void)
{
- if ( BSP_Configuration.ticks_per_timeslice ) {
- /* disable PIT and PIT interrupts */
- m8xx.piscr &= ~(M8xx_PISCR_PTE | M8xx_PISCR_PIE);
-
- (void) set_vector(0, PPC_IRQ_LVL0, 1);
- }
+ /* disable PIT and PIT interrupts */
+ m8xx.piscr &= ~(M8xx_PISCR_PTE | M8xx_PISCR_PIE);
+
+ (void) set_vector(0, PPC_IRQ_LVL0, 1);
}
rtems_device_driver Clock_initialize(
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
index 92c504d92e..0f25b297b4 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
@@ -46,10 +46,11 @@
* $Id$
*/
-#include <bsp.h>
+#include <rtems.h>
#include <rtems/libio.h>
#include <mpc8xx.h>
#include <mpc8xx/console.h>
+#include <mpc8xx/cpm.h>
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
@@ -399,7 +400,7 @@ m8xx_scc2_interrupt_handler (rtems_vector_number v)
/* Check that the buffer is ours */
if ((RxBd[SCC2_MINOR]->status & M8xx_BD_EMPTY) == 0) {
rtems_invalidate_multiple_data_cache_lines(
- RxBd[SCC2_MINOR]->buffer,
+ (const void *) RxBd[SCC2_MINOR]->buffer,
RxBd[SCC2_MINOR]->length );
nb_overflow = rtems_termios_enqueue_raw_characters(
(void *)ttyp[SCC2_MINOR],
@@ -442,7 +443,7 @@ m8xx_scc3_interrupt_handler (rtems_vector_number v)
/* Check that the buffer is ours */
if ((RxBd[SCC3_MINOR]->status & M8xx_BD_EMPTY) == 0) {
rtems_invalidate_multiple_data_cache_lines(
- RxBd[SCC3_MINOR]->buffer,
+ (const void *) RxBd[SCC3_MINOR]->buffer,
RxBd[SCC3_MINOR]->length );
nb_overflow = rtems_termios_enqueue_raw_characters(
(void *)ttyp[SCC3_MINOR],
@@ -484,7 +485,7 @@ m8xx_scc4_interrupt_handler (rtems_vector_number v)
/* Check that the buffer is ours */
if ((RxBd[SCC4_MINOR]->status & M8xx_BD_EMPTY) == 0) {
rtems_invalidate_multiple_data_cache_lines(
- RxBd[SCC4_MINOR]->buffer,
+ (const void *) RxBd[SCC4_MINOR]->buffer,
RxBd[SCC4_MINOR]->length );
nb_overflow = rtems_termios_enqueue_raw_characters(
(void *)ttyp[SCC4_MINOR],
@@ -526,7 +527,7 @@ m8xx_smc1_interrupt_handler (rtems_vector_number v)
/* Check that the buffer is ours */
if ((RxBd[SMC1_MINOR]->status & M8xx_BD_EMPTY) == 0) {
rtems_invalidate_multiple_data_cache_lines(
- RxBd[SMC1_MINOR]->buffer,
+ (const void *) RxBd[SMC1_MINOR]->buffer,
RxBd[SMC1_MINOR]->length );
nb_overflow = rtems_termios_enqueue_raw_characters(
(void *)ttyp[SMC1_MINOR],
@@ -568,7 +569,7 @@ m8xx_smc2_interrupt_handler (rtems_vector_number v)
/* Check that the buffer is ours */
if ((RxBd[SMC2_MINOR]->status & M8xx_BD_EMPTY) == 0) {
rtems_invalidate_multiple_data_cache_lines(
- RxBd[SMC2_MINOR]->buffer,
+ (const void *) RxBd[SMC2_MINOR]->buffer,
RxBd[SMC2_MINOR]->length );
nb_overflow = rtems_termios_enqueue_raw_characters(
(void *)ttyp[SMC2_MINOR],
@@ -983,7 +984,10 @@ m8xx_uart_pollRead(
if (RxBd[minor]->status & M8xx_BD_EMPTY) {
return -1;
}
- _CPU_Data_Cache_Block_Invalidate( RxBd[minor]->buffer );
+ rtems_invalidate_multiple_data_cache_lines(
+ (const void *) RxBd[minor]->buffer,
+ RxBd[minor]->length
+ );
c = ((char *)RxBd[minor]->buffer)[0];
RxBd[minor]->status = M8xx_BD_EMPTY | M8xx_BD_WRAP;
return c;
@@ -1019,7 +1023,10 @@ m8xx_uart_pollWrite(
while (TxBd[minor]->status & M8xx_BD_READY)
continue;
txBuf[minor] = *buf++;
- _CPU_Data_Cache_Block_Flush( &txBuf[minor] );
+ rtems_flush_multiple_data_cache_lines(
+ (const void *) TxBd[minor]->buffer,
+ TxBd[minor]->length
+ );
TxBd[minor]->buffer = &txBuf[minor];
TxBd[minor]->length = 1;
TxBd[minor]->status = M8xx_BD_READY | M8xx_BD_WRAP;
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/cpm/cp.c b/c/src/lib/libcpu/powerpc/mpc8xx/cpm/cp.c
index 235e4bafc3..b1ca0eed6b 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/cpm/cp.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/cpm/cp.c
@@ -12,13 +12,14 @@
* Copyright (c) 1999, National Research Council of Canada
*/
-#include <bsp.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/error.h>
+#include <rtems.h>
+#include <mpc8xx.h>
+#include <mpc8xx/cpm.h>
/*
* Send a command to the CPM RISC processer
*/
+
void m8xx_cp_execute_cmd( unsigned16 command )
{
rtems_unsigned16 lvl;
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/cpm/dpram.c b/c/src/lib/libcpu/powerpc/mpc8xx/cpm/dpram.c
index 985b5b5bd1..825e591351 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/cpm/dpram.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/cpm/dpram.c
@@ -13,9 +13,9 @@
* Copyright (c) 1999, National Research Council of Canada
*/
-#include <bsp.h>
-#include <rtems/rtems/intr.h>
-#include <rtems/error.h>
+#include <rtems.h>
+#include <mpc8xx.h>
+#include <mpc8xx/cpm.h>
/*
* Allocation order:
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/include/cpm.h b/c/src/lib/libcpu/powerpc/mpc8xx/include/cpm.h
index d39ddf2e23..2e0e0b84d2 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/include/cpm.h
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/include/cpm.h
@@ -18,8 +18,6 @@
extern "C" {
#endif
-#include <bsp.h>
-
/* Functions */
void m8xx_cp_execute_cmd( unsigned16 command );
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/include/mmu.h b/c/src/lib/libcpu/powerpc/mpc8xx/include/mmu.h
index 7370e0cf5a..9ade5f977c 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/include/mmu.h
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/include/mmu.h
@@ -18,8 +18,6 @@
extern "C" {
#endif
-#include <bsp.h>
-
/*
* The MMU_TLB_table is used to statically initialize the Table Lookaside
* Buffers in the MMU of an MPC8xx.
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c b/c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c
index 7e877b106f..9ae75d84f7 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/mmu/mmu.c
@@ -11,7 +11,8 @@
* http://www.OARcorp.com/rtems/license.html.
*/
-#include <bsp.h>
+#include <rtems.h>
+#include <mpc8xx.h>
#include <mpc8xx/mmu.h>
/*
diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c b/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
index 50c2a3e00a..d9fbbe4a39 100644
--- a/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
+++ b/c/src/lib/libcpu/powerpc/mpc8xx/timer/timer.c
@@ -43,12 +43,9 @@
* $Id$
*/
-#include <bsp.h>
#include <rtems.h>
#include <mpc8xx.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
static volatile rtems_unsigned32 Timer_starting;
static rtems_boolean Timer_driver_Find_average_overhead;
@@ -86,10 +83,10 @@ int Read_timer(void)
return total; /* in XXX microsecond units */
else {
- if ( total < Cpu_table.timer_least_valid ) {
+ if ( total < rtems_cpu_configuration_get_timer_least_valid() ) {
return 0; /* below timer resolution */
}
- return (total - Cpu_table.timer_average_overhead);
+ return (total - rtems_cpu_configuration_get_timer_average_overhead());
}
}