From 04d5e09efb476750aa8dad8a8f95b8a8af817f98 Mon Sep 17 00:00:00 2001 From: Philippe Vachon Date: Wed, 24 Dec 2008 21:14:49 -0500 Subject: [PATCH] Added fix to SR[BEV] in kcopy. Fixed backspace in c3600 promlib. Miscellaneous fixes to the mipsregs header and top-level Makefiles. --- Makefile | 4 ++-- include/asm/mipsregs.h | 13 ------------- mach/c3600/promlib.c | 3 +++ second/Makefile | 2 +- second/kcopy.S | 9 +++++++++ 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index e1ef689..6a2b84e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Configuration for the Cisco 3620/3640 Routers +#Configuration for the Cisco 3620/3640 Routers TARGET=c3600 MACHCODE=0x1e TEXTADDR=0x80008000 @@ -45,7 +45,7 @@ INCLUDE=-Iinclude/ -Imach/${TARGET} -Iinclude/mach/${TARGET} CFLAGS=-fno-builtin -fomit-frame-pointer -fno-pic -mno-abicalls \ -Wall -ASFLAGS=-xassembler-with-cpp -traditional-cpp +ASFLAGS=-D__ASSEMBLY__-xassembler-with-cpp -traditional-cpp LDFLAGS=--omagic -nostartfiles -nostdlib --discard-all --strip-all \ -Ttext ${TEXTADDR} --entry _start diff --git a/include/asm/mipsregs.h b/include/asm/mipsregs.h index b3e2a7b..fd4dcce 100644 --- a/include/asm/mipsregs.h +++ b/include/asm/mipsregs.h @@ -180,19 +180,6 @@ #endif -/* - * Default page size for a given kernel configuration - */ -#ifdef CONFIG_PAGE_SIZE_4KB -#define PM_DEFAULT_MASK PM_4K -#elif defined(CONFIG_PAGE_SIZE_16KB) -#define PM_DEFAULT_MASK PM_16K -#elif defined(CONFIG_PAGE_SIZE_64KB) -#define PM_DEFAULT_MASK PM_64K -#else -#error Bad page size configuration! -#endif - /* * Values used for computation of new tlb entries diff --git a/mach/c3600/promlib.c b/mach/c3600/promlib.c index 8e44e4d..3665466 100644 --- a/mach/c3600/promlib.c +++ b/mach/c3600/promlib.c @@ -94,6 +94,9 @@ int c_gets(char *b, int n) if (b[i - 1] == '\n' || b[i-1] == '\r') { break; } + else if (b[i - 1] == 0x8) { + i--; + } } while (i < n); b[i - 1] = '\0'; diff --git a/second/Makefile b/second/Makefile index dee8ecd..3af6052 100644 --- a/second/Makefile +++ b/second/Makefile @@ -26,7 +26,7 @@ INCLUDE=-I../include CFLAGS=$(INCLUDE) -fno-builtin -fomit-frame-pointer -fno-pic -mno-abicalls -Wall -ASFLAGS=-xassembler-with-cpp -traditional-cpp +ASFLAGS=-D__ASSEMBLY__ -xassembler-with-cpp -traditional-cpp LDFLAGS= -nostartfiles -nostdlib --discard-all --strip-all --omagic \ -Ttext ${TEXTADDR} --entry _start diff --git a/second/kcopy.S b/second/kcopy.S index 3fe3312..4837732 100644 --- a/second/kcopy.S +++ b/second/kcopy.S @@ -8,6 +8,7 @@ * source distribution for more details. */ +#include #include #include @@ -54,6 +55,14 @@ LEAF(_start) ble k0, k1, 2b addi k0, CACHE_LINE_LEN + /* set SR(BEV) = 0 */ + mfc0 k0, CP0_STATUS + nop + /* fix... me... please */ + li k1, 0xFFBFFFFF + and k0, k1 + mtc0 k0, CP0_STATUS + /* jump to the kernel, setting up the firmware args appropriately */ move a0, v0 li a1, KSEG0