summaryrefslogtreecommitdiffstats
path: root/libgloss/mips/cma101.c
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>2001-10-18 02:24:30 +0000
committerMichael Meissner <gnu@the-meissners.org>2001-10-18 02:24:30 +0000
commitb5b5b0d4de4679b658df1708c9a3caa58ffab9a1 (patch)
treebbfd1df14ad74a333fcd6657297de98762a784fa /libgloss/mips/cma101.c
parentbd71a776e8811f2c4cb52c1fcb3df91c5f0f6394 (diff)
downloadcygnal-b5b5b0d4de4679b658df1708c9a3caa58ffab9a1.tar.gz
cygnal-b5b5b0d4de4679b658df1708c9a3caa58ffab9a1.tar.bz2
cygnal-b5b5b0d4de4679b658df1708c9a3caa58ffab9a1.zip
Add ddb-kseg0.ld and switch to kseg1 if sizing memory from kseg0
Diffstat (limited to 'libgloss/mips/cma101.c')
-rw-r--r--libgloss/mips/cma101.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libgloss/mips/cma101.c b/libgloss/mips/cma101.c
index 0a70440ab..83fa4d5ac 100644
--- a/libgloss/mips/cma101.c
+++ b/libgloss/mips/cma101.c
@@ -1,7 +1,7 @@
/*
* cma101.c -- lo-level support for Cogent CMA101 development board.
*
- * Copyright (c) 1996 Cygnus Support
+ * Copyright (c) 1996, 2001 Cygnus Support
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
@@ -187,8 +187,14 @@ __sizemem ()
unsigned int baseorig;
unsigned int sr;
extern void *end;
+ char *endptr = (char *)&end;
int extra;
+ /* If we are running in kernel segment 0 (possibly cached), try sizing memory
+ in kernel segment 1 (uncached) to avoid some problems with monitors. */
+ if (endptr >= K0BASE_ADDR && endptr < K1BASE_ADDR)
+ endptr = (endptr - K0BASE_ADDR) + K1BASE_ADDR;
+
INTDISABLE(sr,baseorig); /* disable all interrupt masks */
__default_buserr_handler();
@@ -200,8 +206,8 @@ __sizemem ()
for an int pointer, so we adjust the address to make sure it is safe.
We use void * arithmetic to avoid accidentally truncating the pointer. */
- extra = ((int) &end & (sizeof (int) - 1));
- base = ((void *) &end + sizeof (int) - extra);
+ extra = ((int) endptr & (sizeof (int) - 1));
+ base = ((void *) endptr + sizeof (int) - extra);
baseorig = *base;
*base = SM_PATTERN;