forked from Imagelibrary/rtems
Patch from Eric Valette <valette@crf.canon.fr>:
- The same bug fix that was done on pc386 to prevent interrupt
from occuring (never experienced it but who knows as I have 8259
emulation :()
- Removed every compiler warning (except wrong ones and ones I can't do
anything).
- Removed any libc available code in code linked with mcp750 rtems
executbale. Unfortunately using newlib functions for linking the
bootloader does not work as the compilation options in bootloader
(-mrelocatable -fixed-r13) are not compatible with newlib options.
=> I have put any libc external reference in one single new file (lib.c)
that is linked only with the boot loader. Removing the file from
${OBJ} and using -lc crash the bootloader. Added big warning...
This commit is contained in:
@@ -9,14 +9,14 @@ RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=misc pci zlib mm em86 polled_io
|
||||
C_PIECES=misc pci zlib mm em86 polled_io lib
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
H_FILES=bootldr.h zlib.h pci.h
|
||||
|
||||
# Assembly source names, if any, go here -- minus the .s
|
||||
S_PIECES=head exception em86real consoleLib
|
||||
S_PIECES=head exception em86real
|
||||
S_FILES=$(S_PIECES:%=%.S)
|
||||
S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
|
||||
|
||||
@@ -57,14 +57,28 @@ IMAGES := rtems.gz
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS += bootloader
|
||||
CLEAN_ADDITIONS += bootloader reloc.O
|
||||
CLOBBER_ADDITIONS += $(IMAGES)
|
||||
|
||||
#
|
||||
# CAUTION :
|
||||
#
|
||||
# As we use very specific compilation options in this directory
|
||||
# we shall not use any other code. This includes the newlib libc.a
|
||||
# as well as other code located in .o files in mcp750 directory.
|
||||
#
|
||||
# NEVER remove lib.c. You have been warned...
|
||||
#
|
||||
bootloader : ${OBJS} $(IMAGES) $(BINARY_LOADED) ppcboot.lds
|
||||
$(LD) -o bootloader $(OBJS) --just-symbols=$(BINARY_LOADED) \
|
||||
-b binary $(IMAGES) -T @srcdir@/ppcboot.lds \
|
||||
-Map bootloader.map
|
||||
|
||||
check_unresolved : ${OBJS}
|
||||
$(LD) -r -o reloc.O ${OBJS}
|
||||
$(NM) reloc.O |grep ' U '
|
||||
echo "Every symbol listed should be defined in @srcdir@/ppcboot.lds"
|
||||
|
||||
rtems.gz: $(BINARY_LOADED)
|
||||
$(OBJCOPY) $(BINARY_LOADED) rtems -O binary -R .comment -S
|
||||
gzip -vf9 rtems
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
|
||||
#define USE_PPCBUG
|
||||
#undef USE_PPCBUG
|
||||
|
||||
#define MONITOR_ENTER \
|
||||
mfmsr r10 ; \
|
||||
ori r10,r10,MSR_IP ; \
|
||||
mtmsr r10 ; \
|
||||
li r10,0x63 ; \
|
||||
sc
|
||||
|
||||
START_GOT
|
||||
GOT_ENTRY(_GOT2_TABLE_)
|
||||
@@ -50,7 +57,11 @@
|
||||
/* Point the stack into the PreP partition header in the x86 reserved
|
||||
* code area, so that simple C routines can be called.
|
||||
*/
|
||||
start: bl 1f
|
||||
start:
|
||||
#ifdef USE_PPCBUG
|
||||
MONITOR_ENTER
|
||||
#endif
|
||||
bl 1f
|
||||
1: mflr r1
|
||||
li r0,0
|
||||
stwu r0,start-1b-0x400+0x1b0-FRAME_SIZE(r1)
|
||||
@@ -230,11 +241,7 @@ moved: lwz r1,stack(bd)
|
||||
mtspr HID0,r0
|
||||
/* Provisional return to FW, works for PPCBug */
|
||||
#if 0
|
||||
1: mfmsr r10
|
||||
ori r10,r10,MSR_IP
|
||||
mtmsr r10
|
||||
li r10,0x63
|
||||
sc
|
||||
MONITOR_ENTER
|
||||
#else
|
||||
1: bctr
|
||||
#endif
|
||||
@@ -313,21 +320,7 @@ flush_tlb:
|
||||
*/
|
||||
sync
|
||||
blr
|
||||
/* A few utility functions, some copied from arch/ppc/lib/string.S */
|
||||
|
||||
#if 0
|
||||
.globl strnlen
|
||||
.type strnlen,@function
|
||||
strnlen:
|
||||
addi r4,r4,1
|
||||
mtctr r4
|
||||
addi r4,r3,-1
|
||||
1: lbzu r0,1(r4)
|
||||
cmpwi 0,r0,0
|
||||
bdnzf eq,1b
|
||||
subf r3,r3,r4
|
||||
blr
|
||||
#endif
|
||||
.globl codemove
|
||||
codemove:
|
||||
.type codemove,@function
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#undef __assert
|
||||
void __assert (const char *file, int line, const char *msg);
|
||||
extern int close(int fd);
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
@@ -192,8 +195,6 @@ console_initialize(rtems_device_major_number major,
|
||||
} /* console_initialize */
|
||||
|
||||
|
||||
static int console_open_count = 0;
|
||||
|
||||
static int console_last_close(int major, int minor, void *arg)
|
||||
{
|
||||
BSP_remove_rtems_irq_handler (&console_isr_data);
|
||||
@@ -272,9 +273,6 @@ console_read(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg)
|
||||
{
|
||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
|
||||
char *buffer = rw_args->buffer;
|
||||
int count, maximum = rw_args->count;
|
||||
|
||||
return rtems_termios_read (arg);
|
||||
} /* console_read */
|
||||
@@ -290,9 +288,6 @@ console_write(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg)
|
||||
{
|
||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
|
||||
char *buffer = rw_args->buffer;
|
||||
int count, maximum = rw_args->count;
|
||||
|
||||
return rtems_termios_write (arg);
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* consoleLib.S -- console I/O package utility functions.
|
||||
*
|
||||
* Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* A few utility functions, some copied from arch/ppc/lib/string.S */
|
||||
|
||||
#include <libcpu/cpu.h>
|
||||
#include <rtems/score/targopts.h>
|
||||
#include "asm.h"
|
||||
|
||||
.text
|
||||
|
||||
.globl strlen
|
||||
.type strlen,@function
|
||||
strlen:
|
||||
addi r4,r3,-1
|
||||
1: lbzu r0,1(r4)
|
||||
cmpwi 0,r0,0
|
||||
bne 1b
|
||||
subf r3,r3,r4
|
||||
blr
|
||||
@@ -232,10 +232,6 @@ void _IBMPC_keyboard_isr()
|
||||
rtems_boolean
|
||||
_IBMPC_chrdy(char *c)
|
||||
{
|
||||
/* FIX ME!!! It doesn't work without something like the following line.
|
||||
Find out why! */
|
||||
printk("");
|
||||
|
||||
/* Check buffer our ISR builds */
|
||||
if (kbd_first != kbd_last)
|
||||
{
|
||||
|
||||
@@ -406,31 +406,6 @@ extern console_io* curIo;
|
||||
|
||||
unsigned long ticks_per_ms = 1000000; /* Decrementer ticks per ms (true for 601) */
|
||||
|
||||
void * memset(void *p, int c, size_t n) {
|
||||
char *q =p;
|
||||
for(; n>0; --n) *q++=c;
|
||||
return p;
|
||||
}
|
||||
|
||||
void * memcpy(void *dst, const void * src, size_t n) {
|
||||
u_char *d=dst;
|
||||
const u_char *s=src;
|
||||
while(n-- > 0) *d++=*s++;
|
||||
return dst;
|
||||
}
|
||||
|
||||
char * strcat(char * dest, const char * src)
|
||||
{
|
||||
char *tmp = dest;
|
||||
|
||||
while (*dest)
|
||||
dest++;
|
||||
while ((*dest++ = *src++) != '\0')
|
||||
;
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/* The decrementer is present on all processors and the RTC on the 601
|
||||
* has the annoying characteristic of jumping from 1e9 to 0, so we
|
||||
* use the decrementer.
|
||||
@@ -506,7 +481,7 @@ static int global_index = 0;
|
||||
static void *__palloc(int s)
|
||||
{
|
||||
if (global_index ==( STATIC_LOG_DATA_PAGE_NB - 1) ) return (void*) 0;
|
||||
return (void*) log_page_pool [PAGE_SIZE * global_index++];
|
||||
return (void*) &(log_page_pool [PAGE_SIZE * global_index++]);
|
||||
}
|
||||
|
||||
static void pfree(void* p)
|
||||
@@ -848,17 +823,17 @@ vga_console_functions = {
|
||||
kbd_tstc
|
||||
};
|
||||
|
||||
console_io* curIo = &vacuum_console_functions;
|
||||
console_io* curIo = (console_io*) &vacuum_console_functions;
|
||||
|
||||
int select_console(ioType t) {
|
||||
static ioType curType = CONSOLE_VACUUM;
|
||||
|
||||
switch (t) {
|
||||
case CONSOLE_VACUUM : curIo = &vacuum_console_functions; break;
|
||||
case CONSOLE_LOG : curIo = &log_console_functions; break;
|
||||
case CONSOLE_SERIAL : curIo = &serial_console_functions; break;
|
||||
case CONSOLE_VGA : curIo = &vga_console_functions; break;
|
||||
default : curIo = &vacuum_console_functions;break;
|
||||
case CONSOLE_VACUUM : curIo = (console_io*)&vacuum_console_functions; break;
|
||||
case CONSOLE_LOG : curIo = (console_io*)&log_console_functions; break;
|
||||
case CONSOLE_SERIAL : curIo = (console_io*)&serial_console_functions; break;
|
||||
case CONSOLE_VGA : curIo = (console_io*)&vga_console_functions; break;
|
||||
default : curIo = (console_io*)&vacuum_console_functions;break;
|
||||
}
|
||||
if (curType == CONSOLE_LOG) flush_log();
|
||||
curType = t;
|
||||
@@ -882,6 +857,7 @@ static int skip_atoi(const char **s)
|
||||
* bloat has been limited since we basically only need %u, %x, %s and %c.
|
||||
* But we need 64 bit values !
|
||||
*/
|
||||
int vsprintf(char *buf, const char *fmt, va_list args);
|
||||
|
||||
int printk(const char *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
@@ -346,7 +346,7 @@ static int eeget16(unsigned int *ioaddr, int location)
|
||||
st_le32(ioaddr, EE_ENB | dataval); /* Finish EEPROM a clock tick. */
|
||||
for (i3=0; i3<1000; i3++) ;
|
||||
}
|
||||
st_le32(*ioaddr, EE_ENB);
|
||||
st_le32(ioaddr, EE_ENB);
|
||||
|
||||
for (i = 16; i > 0; i--) {
|
||||
st_le32(ioaddr, EE_ENB | EE_SHIFT_CLK);
|
||||
@@ -357,7 +357,7 @@ static int eeget16(unsigned int *ioaddr, int location)
|
||||
}
|
||||
|
||||
/* Terminate the EEPROM access. */
|
||||
st_le32(*ioaddr, EE_ENB & ~EE_CS);
|
||||
st_le32(ioaddr, EE_ENB & ~EE_CS);
|
||||
return ( ((retval<<8)&0xff00) | ((retval>>8)&0xff) );
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
|
||||
sc->arpcom.ac_enaddr[0], sc->arpcom.ac_enaddr[1],
|
||||
sc->arpcom.ac_enaddr[2], sc->arpcom.ac_enaddr[3],
|
||||
sc->arpcom.ac_enaddr[4], sc->arpcom.ac_enaddr[5],
|
||||
sc->irqInfo.name, sc->port, sc->base);
|
||||
sc->irqInfo.name, sc->port, (unsigned) sc->base);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -791,9 +791,6 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config)
|
||||
unsigned char ucSlotNumber, ucFnNumber;
|
||||
unsigned int ulDeviceID, lvalue, tmp;
|
||||
unsigned char cvalue;
|
||||
int value;
|
||||
char interrupt;
|
||||
int diag;
|
||||
|
||||
/*
|
||||
* First, find a DEC board
|
||||
|
||||
@@ -47,6 +47,7 @@ unsigned int BSP_time_base_divisor;
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
extern void BSP_panic(char *s);
|
||||
extern void rtemsReboot(void);
|
||||
extern int printk(const char *, ...) __attribute__((format(printf, 1, 2)));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ static unsigned char mcp750_openpic_initsenses[] = {
|
||||
void isa_bridge_interrupts_setup(void)
|
||||
{
|
||||
pci_isa_bridge_device pci_dev;
|
||||
unsigned long temp;
|
||||
unsigned int temp;
|
||||
unsigned char tmp;
|
||||
unsigned char maxBus;
|
||||
unsigned found = 0;
|
||||
@@ -218,7 +218,6 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
{
|
||||
rtems_raw_except_connect_data vectorDesc;
|
||||
int i;
|
||||
register unsigned int msr;
|
||||
|
||||
/*
|
||||
* First initialize the Interrupt management hardware
|
||||
@@ -264,7 +263,7 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
vectorDesc.exceptIndex = ASM_DEC_VECTOR;
|
||||
vectorDesc.hdl.vector = ASM_DEC_VECTOR;
|
||||
vectorDesc.hdl.raw_hdl = decrementer_exception_vector_prolog_code;
|
||||
vectorDesc.hdl.raw_hdl_size = &decrementer_exception_vector_prolog_code_size;
|
||||
vectorDesc.hdl.raw_hdl_size = (unsigned) &decrementer_exception_vector_prolog_code_size;
|
||||
vectorDesc.on = nop_func;
|
||||
vectorDesc.off = nop_func;
|
||||
vectorDesc.isOn = connected;
|
||||
@@ -274,15 +273,10 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
vectorDesc.exceptIndex = ASM_EXT_VECTOR;
|
||||
vectorDesc.hdl.vector = ASM_EXT_VECTOR;
|
||||
vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code;
|
||||
vectorDesc.hdl.raw_hdl_size = &external_exception_vector_prolog_code_size;
|
||||
vectorDesc.hdl.raw_hdl_size = (unsigned) &external_exception_vector_prolog_code_size;
|
||||
if (!mpc60x_set_exception (&vectorDesc)) {
|
||||
BSP_panic("Unable to initialize RTEMS external raw exception\n");
|
||||
}
|
||||
printk("RTEMS IRQ management is now operationnal\n");
|
||||
printk("Going to enable interrupts at processor level\n");
|
||||
_CPU_MSR_GET(msr);
|
||||
msr = msr |= MSR_EE;
|
||||
_CPU_MSR_SET(msr);
|
||||
printk("Interrupts enabled\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <bsp/consoleIo.h>
|
||||
#include <libcpu/io.h>
|
||||
#include <libcpu/byteorder.h>
|
||||
#include <bsp.h>
|
||||
|
||||
#define NULL 0
|
||||
#define REGISTER_DEBUG
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <bsp/pci.h>
|
||||
#include <bsp/residual.h>
|
||||
#include <bsp/openpic.h>
|
||||
#include <bsp.h>
|
||||
|
||||
#define PCI_CONFIG_ADDR 0xcf8
|
||||
#define PCI_CONFIG_DATA 0xcfc
|
||||
|
||||
@@ -1148,5 +1148,6 @@ pci_write_config_dword(unsigned char bus, unsigned char slot, unsigned char func
|
||||
* Return the number of PCI busses in the system
|
||||
*/
|
||||
extern unsigned char BusCountPCI();
|
||||
extern void InitializePCI();
|
||||
|
||||
#endif /* RTEMS_PCI_H */
|
||||
|
||||
@@ -16,7 +16,7 @@ C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
H_FILES=
|
||||
|
||||
# Assembly source names, if any, go here -- minus the .s
|
||||
S_PIECES=consoleLib
|
||||
S_PIECES=
|
||||
S_FILES=$(S_PIECES:%=%.S)
|
||||
S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ extern unsigned long __bss_start;
|
||||
extern void L1_caches_enables();
|
||||
extern unsigned get_L2CR();
|
||||
extern void set_L2CR(unsigned);
|
||||
extern void bsp_cleanup(void);
|
||||
/*
|
||||
* Copy of residuals passed by firmware
|
||||
*/
|
||||
@@ -121,7 +122,6 @@ void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
rtems_unsigned32 heap_size;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
#include <bsp/vectors.h>
|
||||
#include <libcpu/raw_exception.h>
|
||||
#include <bsp.h>
|
||||
|
||||
static rtems_raw_except_global_settings exception_config;
|
||||
static rtems_raw_except_connect_data exception_table[LAST_VALID_EXC + 1];
|
||||
|
||||
@@ -9,14 +9,14 @@ RTEMS_ROOT = @top_srcdir@
|
||||
PROJECT_ROOT = @PROJECT_ROOT@
|
||||
|
||||
# C source names, if any, go here -- minus the .c
|
||||
C_PIECES=misc pci zlib mm em86 polled_io
|
||||
C_PIECES=misc pci zlib mm em86 polled_io lib
|
||||
C_FILES=$(C_PIECES:%=%.c)
|
||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
|
||||
H_FILES=bootldr.h zlib.h pci.h
|
||||
|
||||
# Assembly source names, if any, go here -- minus the .s
|
||||
S_PIECES=head exception em86real consoleLib
|
||||
S_PIECES=head exception em86real
|
||||
S_FILES=$(S_PIECES:%=%.S)
|
||||
S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
|
||||
|
||||
@@ -57,14 +57,28 @@ IMAGES := rtems.gz
|
||||
# 'make clobber' already includes 'make clean'
|
||||
#
|
||||
|
||||
CLEAN_ADDITIONS += bootloader
|
||||
CLEAN_ADDITIONS += bootloader reloc.O
|
||||
CLOBBER_ADDITIONS += $(IMAGES)
|
||||
|
||||
#
|
||||
# CAUTION :
|
||||
#
|
||||
# As we use very specific compilation options in this directory
|
||||
# we shall not use any other code. This includes the newlib libc.a
|
||||
# as well as other code located in .o files in mcp750 directory.
|
||||
#
|
||||
# NEVER remove lib.c. You have been warned...
|
||||
#
|
||||
bootloader : ${OBJS} $(IMAGES) $(BINARY_LOADED) ppcboot.lds
|
||||
$(LD) -o bootloader $(OBJS) --just-symbols=$(BINARY_LOADED) \
|
||||
-b binary $(IMAGES) -T @srcdir@/ppcboot.lds \
|
||||
-Map bootloader.map
|
||||
|
||||
check_unresolved : ${OBJS}
|
||||
$(LD) -r -o reloc.O ${OBJS}
|
||||
$(NM) reloc.O |grep ' U '
|
||||
echo "Every symbol listed should be defined in @srcdir@/ppcboot.lds"
|
||||
|
||||
rtems.gz: $(BINARY_LOADED)
|
||||
$(OBJCOPY) $(BINARY_LOADED) rtems -O binary -R .comment -S
|
||||
gzip -vf9 rtems
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
|
||||
#define USE_PPCBUG
|
||||
#undef USE_PPCBUG
|
||||
|
||||
#define MONITOR_ENTER \
|
||||
mfmsr r10 ; \
|
||||
ori r10,r10,MSR_IP ; \
|
||||
mtmsr r10 ; \
|
||||
li r10,0x63 ; \
|
||||
sc
|
||||
|
||||
START_GOT
|
||||
GOT_ENTRY(_GOT2_TABLE_)
|
||||
@@ -50,7 +57,11 @@
|
||||
/* Point the stack into the PreP partition header in the x86 reserved
|
||||
* code area, so that simple C routines can be called.
|
||||
*/
|
||||
start: bl 1f
|
||||
start:
|
||||
#ifdef USE_PPCBUG
|
||||
MONITOR_ENTER
|
||||
#endif
|
||||
bl 1f
|
||||
1: mflr r1
|
||||
li r0,0
|
||||
stwu r0,start-1b-0x400+0x1b0-FRAME_SIZE(r1)
|
||||
@@ -230,11 +241,7 @@ moved: lwz r1,stack(bd)
|
||||
mtspr HID0,r0
|
||||
/* Provisional return to FW, works for PPCBug */
|
||||
#if 0
|
||||
1: mfmsr r10
|
||||
ori r10,r10,MSR_IP
|
||||
mtmsr r10
|
||||
li r10,0x63
|
||||
sc
|
||||
MONITOR_ENTER
|
||||
#else
|
||||
1: bctr
|
||||
#endif
|
||||
@@ -313,21 +320,7 @@ flush_tlb:
|
||||
*/
|
||||
sync
|
||||
blr
|
||||
/* A few utility functions, some copied from arch/ppc/lib/string.S */
|
||||
|
||||
#if 0
|
||||
.globl strnlen
|
||||
.type strnlen,@function
|
||||
strnlen:
|
||||
addi r4,r4,1
|
||||
mtctr r4
|
||||
addi r4,r3,-1
|
||||
1: lbzu r0,1(r4)
|
||||
cmpwi 0,r0,0
|
||||
bdnzf eq,1b
|
||||
subf r3,r3,r4
|
||||
blr
|
||||
#endif
|
||||
.globl codemove
|
||||
codemove:
|
||||
.type codemove,@function
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#undef __assert
|
||||
void __assert (const char *file, int line, const char *msg);
|
||||
extern int close(int fd);
|
||||
|
||||
#include <bsp.h>
|
||||
#include <bsp/irq.h>
|
||||
@@ -192,8 +195,6 @@ console_initialize(rtems_device_major_number major,
|
||||
} /* console_initialize */
|
||||
|
||||
|
||||
static int console_open_count = 0;
|
||||
|
||||
static int console_last_close(int major, int minor, void *arg)
|
||||
{
|
||||
BSP_remove_rtems_irq_handler (&console_isr_data);
|
||||
@@ -272,9 +273,6 @@ console_read(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void *arg)
|
||||
{
|
||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
|
||||
char *buffer = rw_args->buffer;
|
||||
int count, maximum = rw_args->count;
|
||||
|
||||
return rtems_termios_read (arg);
|
||||
} /* console_read */
|
||||
@@ -290,9 +288,6 @@ console_write(rtems_device_major_number major,
|
||||
rtems_device_minor_number minor,
|
||||
void * arg)
|
||||
{
|
||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *)arg;
|
||||
char *buffer = rw_args->buffer;
|
||||
int count, maximum = rw_args->count;
|
||||
|
||||
return rtems_termios_write (arg);
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* consoleLib.S -- console I/O package utility functions.
|
||||
*
|
||||
* Copyright (C) 1999 Eric Valette. valette@crf.canon.fr
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* A few utility functions, some copied from arch/ppc/lib/string.S */
|
||||
|
||||
#include <libcpu/cpu.h>
|
||||
#include <rtems/score/targopts.h>
|
||||
#include "asm.h"
|
||||
|
||||
.text
|
||||
|
||||
.globl strlen
|
||||
.type strlen,@function
|
||||
strlen:
|
||||
addi r4,r3,-1
|
||||
1: lbzu r0,1(r4)
|
||||
cmpwi 0,r0,0
|
||||
bne 1b
|
||||
subf r3,r3,r4
|
||||
blr
|
||||
@@ -232,10 +232,6 @@ void _IBMPC_keyboard_isr()
|
||||
rtems_boolean
|
||||
_IBMPC_chrdy(char *c)
|
||||
{
|
||||
/* FIX ME!!! It doesn't work without something like the following line.
|
||||
Find out why! */
|
||||
printk("");
|
||||
|
||||
/* Check buffer our ISR builds */
|
||||
if (kbd_first != kbd_last)
|
||||
{
|
||||
|
||||
@@ -406,31 +406,6 @@ extern console_io* curIo;
|
||||
|
||||
unsigned long ticks_per_ms = 1000000; /* Decrementer ticks per ms (true for 601) */
|
||||
|
||||
void * memset(void *p, int c, size_t n) {
|
||||
char *q =p;
|
||||
for(; n>0; --n) *q++=c;
|
||||
return p;
|
||||
}
|
||||
|
||||
void * memcpy(void *dst, const void * src, size_t n) {
|
||||
u_char *d=dst;
|
||||
const u_char *s=src;
|
||||
while(n-- > 0) *d++=*s++;
|
||||
return dst;
|
||||
}
|
||||
|
||||
char * strcat(char * dest, const char * src)
|
||||
{
|
||||
char *tmp = dest;
|
||||
|
||||
while (*dest)
|
||||
dest++;
|
||||
while ((*dest++ = *src++) != '\0')
|
||||
;
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
/* The decrementer is present on all processors and the RTC on the 601
|
||||
* has the annoying characteristic of jumping from 1e9 to 0, so we
|
||||
* use the decrementer.
|
||||
@@ -506,7 +481,7 @@ static int global_index = 0;
|
||||
static void *__palloc(int s)
|
||||
{
|
||||
if (global_index ==( STATIC_LOG_DATA_PAGE_NB - 1) ) return (void*) 0;
|
||||
return (void*) log_page_pool [PAGE_SIZE * global_index++];
|
||||
return (void*) &(log_page_pool [PAGE_SIZE * global_index++]);
|
||||
}
|
||||
|
||||
static void pfree(void* p)
|
||||
@@ -848,17 +823,17 @@ vga_console_functions = {
|
||||
kbd_tstc
|
||||
};
|
||||
|
||||
console_io* curIo = &vacuum_console_functions;
|
||||
console_io* curIo = (console_io*) &vacuum_console_functions;
|
||||
|
||||
int select_console(ioType t) {
|
||||
static ioType curType = CONSOLE_VACUUM;
|
||||
|
||||
switch (t) {
|
||||
case CONSOLE_VACUUM : curIo = &vacuum_console_functions; break;
|
||||
case CONSOLE_LOG : curIo = &log_console_functions; break;
|
||||
case CONSOLE_SERIAL : curIo = &serial_console_functions; break;
|
||||
case CONSOLE_VGA : curIo = &vga_console_functions; break;
|
||||
default : curIo = &vacuum_console_functions;break;
|
||||
case CONSOLE_VACUUM : curIo = (console_io*)&vacuum_console_functions; break;
|
||||
case CONSOLE_LOG : curIo = (console_io*)&log_console_functions; break;
|
||||
case CONSOLE_SERIAL : curIo = (console_io*)&serial_console_functions; break;
|
||||
case CONSOLE_VGA : curIo = (console_io*)&vga_console_functions; break;
|
||||
default : curIo = (console_io*)&vacuum_console_functions;break;
|
||||
}
|
||||
if (curType == CONSOLE_LOG) flush_log();
|
||||
curType = t;
|
||||
@@ -882,6 +857,7 @@ static int skip_atoi(const char **s)
|
||||
* bloat has been limited since we basically only need %u, %x, %s and %c.
|
||||
* But we need 64 bit values !
|
||||
*/
|
||||
int vsprintf(char *buf, const char *fmt, va_list args);
|
||||
|
||||
int printk(const char *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
@@ -346,7 +346,7 @@ static int eeget16(unsigned int *ioaddr, int location)
|
||||
st_le32(ioaddr, EE_ENB | dataval); /* Finish EEPROM a clock tick. */
|
||||
for (i3=0; i3<1000; i3++) ;
|
||||
}
|
||||
st_le32(*ioaddr, EE_ENB);
|
||||
st_le32(ioaddr, EE_ENB);
|
||||
|
||||
for (i = 16; i > 0; i--) {
|
||||
st_le32(ioaddr, EE_ENB | EE_SHIFT_CLK);
|
||||
@@ -357,7 +357,7 @@ static int eeget16(unsigned int *ioaddr, int location)
|
||||
}
|
||||
|
||||
/* Terminate the EEPROM access. */
|
||||
st_le32(*ioaddr, EE_ENB & ~EE_CS);
|
||||
st_le32(ioaddr, EE_ENB & ~EE_CS);
|
||||
return ( ((retval<<8)&0xff00) | ((retval>>8)&0xff) );
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
|
||||
sc->arpcom.ac_enaddr[0], sc->arpcom.ac_enaddr[1],
|
||||
sc->arpcom.ac_enaddr[2], sc->arpcom.ac_enaddr[3],
|
||||
sc->arpcom.ac_enaddr[4], sc->arpcom.ac_enaddr[5],
|
||||
sc->irqInfo.name, sc->port, sc->base);
|
||||
sc->irqInfo.name, sc->port, (unsigned) sc->base);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -791,9 +791,6 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config)
|
||||
unsigned char ucSlotNumber, ucFnNumber;
|
||||
unsigned int ulDeviceID, lvalue, tmp;
|
||||
unsigned char cvalue;
|
||||
int value;
|
||||
char interrupt;
|
||||
int diag;
|
||||
|
||||
/*
|
||||
* First, find a DEC board
|
||||
|
||||
@@ -47,6 +47,7 @@ unsigned int BSP_time_base_divisor;
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
extern void BSP_panic(char *s);
|
||||
extern void rtemsReboot(void);
|
||||
extern int printk(const char *, ...) __attribute__((format(printf, 1, 2)));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ static unsigned char mcp750_openpic_initsenses[] = {
|
||||
void isa_bridge_interrupts_setup(void)
|
||||
{
|
||||
pci_isa_bridge_device pci_dev;
|
||||
unsigned long temp;
|
||||
unsigned int temp;
|
||||
unsigned char tmp;
|
||||
unsigned char maxBus;
|
||||
unsigned found = 0;
|
||||
@@ -218,7 +218,6 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
{
|
||||
rtems_raw_except_connect_data vectorDesc;
|
||||
int i;
|
||||
register unsigned int msr;
|
||||
|
||||
/*
|
||||
* First initialize the Interrupt management hardware
|
||||
@@ -264,7 +263,7 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
vectorDesc.exceptIndex = ASM_DEC_VECTOR;
|
||||
vectorDesc.hdl.vector = ASM_DEC_VECTOR;
|
||||
vectorDesc.hdl.raw_hdl = decrementer_exception_vector_prolog_code;
|
||||
vectorDesc.hdl.raw_hdl_size = &decrementer_exception_vector_prolog_code_size;
|
||||
vectorDesc.hdl.raw_hdl_size = (unsigned) &decrementer_exception_vector_prolog_code_size;
|
||||
vectorDesc.on = nop_func;
|
||||
vectorDesc.off = nop_func;
|
||||
vectorDesc.isOn = connected;
|
||||
@@ -274,15 +273,10 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
vectorDesc.exceptIndex = ASM_EXT_VECTOR;
|
||||
vectorDesc.hdl.vector = ASM_EXT_VECTOR;
|
||||
vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code;
|
||||
vectorDesc.hdl.raw_hdl_size = &external_exception_vector_prolog_code_size;
|
||||
vectorDesc.hdl.raw_hdl_size = (unsigned) &external_exception_vector_prolog_code_size;
|
||||
if (!mpc60x_set_exception (&vectorDesc)) {
|
||||
BSP_panic("Unable to initialize RTEMS external raw exception\n");
|
||||
}
|
||||
printk("RTEMS IRQ management is now operationnal\n");
|
||||
printk("Going to enable interrupts at processor level\n");
|
||||
_CPU_MSR_GET(msr);
|
||||
msr = msr |= MSR_EE;
|
||||
_CPU_MSR_SET(msr);
|
||||
printk("Interrupts enabled\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <bsp/consoleIo.h>
|
||||
#include <libcpu/io.h>
|
||||
#include <libcpu/byteorder.h>
|
||||
#include <bsp.h>
|
||||
|
||||
#define NULL 0
|
||||
#define REGISTER_DEBUG
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <bsp/pci.h>
|
||||
#include <bsp/residual.h>
|
||||
#include <bsp/openpic.h>
|
||||
#include <bsp.h>
|
||||
|
||||
#define PCI_CONFIG_ADDR 0xcf8
|
||||
#define PCI_CONFIG_DATA 0xcfc
|
||||
|
||||
@@ -1148,5 +1148,6 @@ pci_write_config_dword(unsigned char bus, unsigned char slot, unsigned char func
|
||||
* Return the number of PCI busses in the system
|
||||
*/
|
||||
extern unsigned char BusCountPCI();
|
||||
extern void InitializePCI();
|
||||
|
||||
#endif /* RTEMS_PCI_H */
|
||||
|
||||
@@ -16,7 +16,7 @@ C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||
H_FILES=
|
||||
|
||||
# Assembly source names, if any, go here -- minus the .s
|
||||
S_PIECES=consoleLib
|
||||
S_PIECES=
|
||||
S_FILES=$(S_PIECES:%=%.S)
|
||||
S_O_FILES=$(S_FILES:%.S=${ARCH}/%.o)
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ extern unsigned long __bss_start;
|
||||
extern void L1_caches_enables();
|
||||
extern unsigned get_L2CR();
|
||||
extern void set_L2CR(unsigned);
|
||||
extern void bsp_cleanup(void);
|
||||
/*
|
||||
* Copy of residuals passed by firmware
|
||||
*/
|
||||
@@ -121,7 +122,6 @@ void bsp_libc_init( void *, unsigned32, int );
|
||||
|
||||
void bsp_pretasking_hook(void)
|
||||
{
|
||||
extern int end;
|
||||
rtems_unsigned32 heap_start;
|
||||
rtems_unsigned32 heap_size;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
#include <bsp/vectors.h>
|
||||
#include <libcpu/raw_exception.h>
|
||||
#include <bsp.h>
|
||||
|
||||
static rtems_raw_except_global_settings exception_config;
|
||||
static rtems_raw_except_connect_data exception_table[LAST_VALID_EXC + 1];
|
||||
|
||||
Reference in New Issue
Block a user