summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/powerpc/ppc403/console
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-05 16:44:02 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-05 16:44:02 +0000
commit458bd343e24cda7169c75f079705979891c9abc1 (patch)
treea9e584c28211674b28d1e37aec005e0e3a25afa1 /c/src/lib/libcpu/powerpc/ppc403/console
parentEliminated references to stack checker related #defines. (diff)
downloadrtems-458bd343e24cda7169c75f079705979891c9abc1.tar.bz2
This is another pass at making sure that nothing outside the BSP
unnecessarily uses any variables defined by the BSP. On this sweep, use of BSP_Configuration and Cpu_table was eliminated. A significant part of this modification was the addition of macros to access fields in the RTEMS configuration structures. This is necessary to strengthen the division between the BSP independent parts of RTEMS and the BSPs themselves. This started after comments and analysis by Ralf Corsepius <corsepiu@faw.uni-ulm.de>.
Diffstat (limited to 'c/src/lib/libcpu/powerpc/ppc403/console')
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/console.c9
-rw-r--r--c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled11
2 files changed, 9 insertions, 11 deletions
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
index b1fc7bfe9c..11177c8a42 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
@@ -60,7 +60,6 @@
#include <rtems/libio.h>
#include "../ictrl/ictrl.h"
#include <stdlib.h> /* for atexit() */
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
struct async {
/*---------------------------------------------------------------------------+
@@ -215,7 +214,7 @@ void
spiBaudSet(unsigned32 baudrate)
{
unsigned32 tmp;
- tmp = Cpu_table.serial_per_sec / baudrate;
+ tmp = rtems_cpu_configuration_get_serial_per_sec() / baudrate;
tmp = ((tmp) >> 4) - 1;
port->BRDL = tmp & 0xff;
port->BRDH = tmp >> 8;
@@ -314,7 +313,7 @@ spiDeInit(void)
*/
/* set up baud rate to original state */
- spiBaudSet(Cpu_table.serial_rate);
+ spiBaudSet(rtems_cpu_configuration_get_serial_rate());
/* clear any receive (error) status */
port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
@@ -356,7 +355,7 @@ spiInitialize(void)
asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */
tmp &= ~3;
- tmp |= (Cpu_table.serial_external_clock ? 2 : 0) | 1;
+ tmp |= (rtems_cpu_configuration_get_serial_external_clock() ? 2 : 0) | 1;
asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */
@@ -365,7 +364,7 @@ spiInitialize(void)
LSRParityError | LSRBreakInterrupt);
/* set up baud rate */
- spiBaudSet(Cpu_table.serial_rate);
+ spiBaudSet(rtems_cpu_configuration_get_serial_rate());
/* set up port control: DTR/RTS active,8 bit,1 stop,no parity */
port->SPCTL = (CRNormal |
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled b/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
index e5d3b6fbce..976b5f975c 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
+++ b/c/src/lib/libcpu/powerpc/ppc403/console/console.c.polled
@@ -34,8 +34,6 @@
#include <rtems.h>
#include <rtems/libio.h>
-extern rtems_cpu_table Cpu_table; /* owned by BSP */
-
struct async {
/*-----------------------------------------------------------------------------+
| Line Status Register.
@@ -147,12 +145,13 @@ rtems_device_driver console_initialize(
/* Initialise the serial port */
asm volatile ("mfdcr %0, 0xa0" : "=r" (tmp)); /* IOCR */
tmp &= ~3;
- tmp |= (Cpu_table.serial_external_clock ? 2 : 0) |
- (Cpu_table.serial_cts_rts ? 1 : 0);
+ tmp |= (rtems_cpu_configuration_get_serial_external_clock() ? 2 : 0) |
+ (rtems_cpu_configuration_get_serial_cts_rts() ? 1 : 0);
asm volatile ("mtdcr 0xa0, %0" : "=r" (tmp) : "0" (tmp)); /* IOCR */
port->SPLS = (LSRDataReady | LSRFramingError | LSROverrunError |
LSRParityError | LSRBreakInterrupt);
- tmp = Cpu_table.serial_per_sec / Cpu_table.serial_rate;
+ tmp = rtems_cpu_configuration_get_serial_per_sec() /
+ rtems_cpu_configuration_get_serial_rate();
#if 0 /* replaced by IMD... */
tmp = ((tmp + 8) >> 4) - 1;
port->BRDL = tmp & 0x255;
@@ -278,7 +277,7 @@ void outbyte(
break;
}
- if (Cpu_table.serial_xon_xoff)
+ if (rtems_cpu_configuration_get_serial_xon_xoff())
while (is_character_ready(&status))
{
if (status == XOFFchar)