From d1e063beb43e595680c65e3804d1f8ddff53373b Mon Sep 17 00:00:00 2001 From: Guido Guenther Date: Sat, 18 Nov 2006 23:48:07 +0100 Subject: Imported Debian version 0.3.8.8 --- common/.cvsignore | 1 + common/Makefile | 16 +++++++++++++++ common/print_loadaddr.c | 30 ++++++++++++++++++++++++++++ common/print_outputformat | 9 +++++++++ common/subarch.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++ common/version.h | 1 + 6 files changed, 108 insertions(+) create mode 100644 common/.cvsignore create mode 100644 common/Makefile create mode 100644 common/print_loadaddr.c create mode 100755 common/print_outputformat create mode 100644 common/subarch.h create mode 100644 common/version.h (limited to 'common') diff --git a/common/.cvsignore b/common/.cvsignore new file mode 100644 index 0000000..d2b1118 --- /dev/null +++ b/common/.cvsignore @@ -0,0 +1 @@ +print_loadaddr diff --git a/common/Makefile b/common/Makefile new file mode 100644 index 0000000..2f160e3 --- /dev/null +++ b/common/Makefile @@ -0,0 +1,16 @@ +SUBARCH ?= IP22 + +CFLAGS += -Wall -O2 -I. -I../arclib -DSUBARCH=${SUBARCH} + +HOSTCC = $(CC) +HOSTCFLAGS += -Wall -O2 -DSUBARCH=$(SUBARCH) + +all: print_loadaddr + +print_loadaddr: print_loadaddr.c subarch.h version.h + $(HOSTCC) $(HOSTCFLAGS) -o $@ $< + +install: print_loadaddr + +clean: + rm -f print_loadaddr *~ tags diff --git a/common/print_loadaddr.c b/common/print_loadaddr.c new file mode 100644 index 0000000..17d648d --- /dev/null +++ b/common/print_loadaddr.c @@ -0,0 +1,30 @@ +/* small helper to get the current subarch's loaddr */ + +#include +#include +#include + +#include "subarch.h" + +int main(int argc, char *argv[]) +{ + int subarch = SUBARCH; + + if (argc == 2) { + if (!strcasecmp(argv[1], "ip22")) + subarch = IP22; + else if (!strcasecmp(argv[1], "ip32")) + subarch = IP32; + else { + fprintf(stderr, + "Unknown subarchitecture %s requested\n", + argv[1]); + return 1; + } + } + + printf("%#08x\n", kernel_load[subarch].base + + kernel_load[subarch].reserved); + + return 0; +} diff --git a/common/print_outputformat b/common/print_outputformat new file mode 100755 index 0000000..5593a3c --- /dev/null +++ b/common/print_outputformat @@ -0,0 +1,9 @@ +#!/bin/sh + +# default to ecoff + +case $1 in + ip32 | IP32) echo "elf32-tradbigmips" ;; + ip22 | IP22) echo "ecoff-bigmips" ;; + *) echo "ecoff-bigmips" ;; +esac diff --git a/common/subarch.h b/common/subarch.h new file mode 100644 index 0000000..eba5ef0 --- /dev/null +++ b/common/subarch.h @@ -0,0 +1,51 @@ +/* + * subarch specific definitions + */ + +#ifndef SUBARCH_H +#define SUBARCH_H + +#include + +#define PAGE_SIZE 4096 +#define STACK_PAGES 16 + +/* supported subarches */ +#define IP22 0 +#define IP32 1 + +/* + * Reserve this memory for loading kernel + * Don't put loader structures there because they would be overwritten + * + * We put the loader right after the kernel so you won't have the + * full reserved space since the prom puts the stack right below + * the loader. + */ +struct kernel_load_block { + uint32_t base; + uint32_t reserved; +}; + +struct kernel_load_block kernel_load[] = { + { /* IP22 */ + .base = 0x88002000, + .reserved = 0x800000, + }, + { /* IP32 */ + .base = 0x80004000, + .reserved = 0x1400000, + }, +}; + +/* we filter these out of the command line */ +char* env_vars[] = { "ConsoleIn=", + "ConsoleOut=", + "OSLoader=", + "OSLoadPartition=", + "OSLoadFilename=", + "OSLoadOptions=", + }; +#define NENTS(foo) ((sizeof((foo)) / (sizeof((foo[0]))))) + +#endif diff --git a/common/version.h b/common/version.h new file mode 100644 index 0000000..c144648 --- /dev/null +++ b/common/version.h @@ -0,0 +1 @@ +#define __ARCSBOOT_VERSION__ "0.3.8.8" -- cgit v1.2.3