Add ddb-kseg0.ld and switch to kseg1 if sizing memory from kseg0

This commit is contained in:
Michael Meissner 2001-10-18 02:24:30 +00:00
parent bd71a776e8
commit b5b5b0d4de
6 changed files with 212 additions and 22 deletions

View File

@ -1,3 +1,18 @@
2001-10-17 Michael Meissner <meissner@redhat.com>
* regs.S (K0BASE_ADDR,K1BASE_ADDR): Define as addresses to
identify if a program is running in kernel segment 0.
* cma101.c (__sizemem): If we are running in kernel segment 0,
instead of kernel segment 1, use kernel segment 0 addresses which
are uncached when sizing memory.
* ddb-kseg0.ld: New file, clone of ddb.ld, except it links the
program to run in kernel segment 0, instead of kernel segment 1.
* configure.in: Treat ddb-kseg0.ld like ddb.ld.
* configure: Regenerate.
2001-09-15 Eric Christopher <echristo@redhat.com>
* mips/configure.in (LIB_AC_PROG_CC): Fix typo in mipsisa32 to

View File

@ -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;

View File

@ -28,6 +28,7 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
sitefile=
srcdir=
target=NONE
verbose=
@ -142,6 +143,7 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
--site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@ -312,6 +314,11 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
-site-file | --site-file | --site-fil | --site-fi | --site-f)
ac_prev=sitefile ;;
-site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
sitefile="$ac_optarg" ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@ -477,12 +484,16 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
else
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
if test -z "$sitefile"; then
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
else
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
fi
else
CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@ -583,7 +594,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:587: checking host system type" >&5
echo "configure:598: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@ -604,7 +615,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6
echo $ac_n "checking target system type""... $ac_c" 1>&6
echo "configure:608: checking target system type" >&5
echo "configure:619: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@ -622,7 +633,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$target" 1>&6
echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:626: checking build system type" >&5
echo "configure:637: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@ -676,7 +687,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:680: checking for a BSD compatible install" >&5
echo "configure:691: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -740,7 +751,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:744: checking for $ac_word" >&5
echo "configure:755: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -770,7 +781,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:774: checking for $ac_word" >&5
echo "configure:785: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -819,7 +830,7 @@ fi
fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:823: checking whether we are using GNU C" >&5
echo "configure:834: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -828,7 +839,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:843: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@ -843,7 +854,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:847: checking whether ${CC-cc} accepts -g" >&5
echo "configure:858: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -879,7 +890,7 @@ LD=${LD-ld}
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:883: checking for $ac_word" >&5
echo "configure:894: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -926,7 +937,7 @@ case "${target}" in
mips64vr5*-*-*)
part_specific_obj="vr5xxx.o cma101.o"
part_specific_defines=-DR5000
script_list="idt pmon ddb lsi idtecoff nullmon"
script_list="idt pmon ddb ddb-kseg0 lsi idtecoff nullmon"
bsp_list="libidt.a libpmon.a liblsi.a libnullmon.a"
;;
mipsisa32*-*-*)
@ -938,7 +949,7 @@ case "${target}" in
*)
part_specific_obj="vr4300.o cma101.o"
part_specific_defines=
script_list="idt pmon ddb lsi idtecoff nullmon"
script_list="idt pmon ddb ddb-kseg0 lsi idtecoff nullmon"
bsp_list="libidt.a libpmon.a liblsi.a libnullmon.a"
;;
esac

View File

@ -101,7 +101,7 @@ case "${target}" in
mips64vr5*-*-*)
part_specific_obj="vr5xxx.o cma101.o"
part_specific_defines=-DR5000
script_list="idt pmon ddb lsi idtecoff nullmon"
script_list="idt pmon ddb ddb-kseg0 lsi idtecoff nullmon"
bsp_list="libidt.a libpmon.a liblsi.a libnullmon.a"
;;
mipsisa32*-*-*)
@ -113,7 +113,7 @@ case "${target}" in
*)
part_specific_obj="vr4300.o cma101.o"
part_specific_defines=
script_list="idt pmon ddb lsi idtecoff nullmon"
script_list="idt pmon ddb ddb-kseg0 lsi idtecoff nullmon"
bsp_list="libidt.a libpmon.a liblsi.a libnullmon.a"
;;
esac

154
libgloss/mips/ddb-kseg0.ld Normal file
View File

@ -0,0 +1,154 @@
/* The following TEXT start address leaves space for the monitor
workspace. */
ENTRY(_start)
OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips")
GROUP(-lc -lpmon -lgcc)
SEARCH_DIR(.)
__DYNAMIC = 0;
/*
* Allocate the stack to be at the top of memory, since the stack
* grows down
*/
PROVIDE (__stack = 0);
/* PROVIDE (__global = 0); */
/*
* Initalize some symbols to be zero so we can reference them in the
* crt0 without core dumping. These functions are all optional, but
* we do this so we can have our crt0 always use them if they exist.
* This is so BSPs work better when using the crt0 installed with gcc.
* We have to initalize them twice, so we multiple object file
* formats, as some prepend an underscore.
*/
PROVIDE (hardware_init_hook = 0);
PROVIDE (software_init_hook = 0);
SECTIONS
{
. = 0x80100000;
.text : {
_ftext = . ;
*(.init)
eprol = .;
*(.text)
*(.text.*)
*(.gnu.linkonce.t*)
*(.mips16.fn.*)
*(.mips16.call.*)
PROVIDE (__runtime_reloc_start = .);
*(.rel.sdata)
PROVIDE (__runtime_reloc_stop = .);
*(.fini)
etext = .;
_etext = .;
}
.ctors :
{
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
doesn't matter if the user does not
actually link against crtbegin.o; the
linker won't look for a file to match a
wildcard. The wildcard also means that it
doesn't matter which directory crtbegin.o
is in. */
KEEP (*crtbegin.o(.ctors))
/* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the
end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
}
.dtors :
{
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
}
. = .;
.rdata : {
*(.rdata)
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r*)
}
_fdata = ALIGN(16);
.data : {
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
}
. = ALIGN(8);
_gp = . + 0x8000;
__global = _gp;
.lit8 : {
*(.lit8)
}
.lit4 : {
*(.lit4)
}
.sdata : {
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s*)
}
. = ALIGN(4);
edata = .;
_edata = .;
_fbss = .;
.sbss : {
*(.sbss)
*(.scommon)
}
.bss : {
_bss_start = . ;
*(.bss)
*(COMMON)
}
end = .;
_end = .;
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to
the beginning of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}

View File

@ -56,8 +56,12 @@
#define K0BASE 0x80000000
#ifndef __mips64
#define K1BASE 0xA0000000
#define K0BASE_ADDR ((char *)K0BASE)
#define K1BASE_ADDR ((char *)K1BASE)
#else
#define K1BASE 0xFFFFFFFFA0000000LL
#define K0BASE_ADDR ((char *)0xFFFFFFFF80000000LL)
#define K1BASE_ADDR ((char *)K1BASE)
#endif
#define PHYS_TO_K1(a) ((unsigned)(a) | K1BASE)