PERFORCE change 44440 for review
Juli Mallett
jmallett at FreeBSD.org
Sun Dec 28 04:13:23 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=44440
Change 44440 by jmallett at jmallett_oingo on 2003/12/28 04:12:46
A quick ARCS frontend to provide console and other basic
things. Still *need* to add the tree walking stuff to get the
system ID crap. This is good enough for what I need right
at this moment, and works with the new ABI by way of nasty
contortions that would make bde blush and full of me sticking
my fingers in my ears and yelling "la la la I can't use a packed
structure" twice as loud as phk ever has done. I feel dirty.
Affected files ...
.. //depot/projects/mips/sys/conf/Makefile.mips#11 edit
.. //depot/projects/mips/sys/conf/files.mips#23 edit
.. //depot/projects/mips/sys/conf/options.mips#11 edit
.. //depot/projects/mips/sys/dev/arcs/arcs.c#1 add
.. //depot/projects/mips/sys/dev/arcs/arcs.h#1 add
.. //depot/projects/mips/sys/dev/arcs/arcs_console.c#1 add
.. //depot/projects/mips/sys/mips/conf/INDY#3 edit
.. //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#25 edit
Differences ...
==== //depot/projects/mips/sys/conf/Makefile.mips#11 (text+ko) ====
@@ -41,7 +41,7 @@
.include "$S/conf/kern.pre.mk"
MIPSOPTS?= -mips3
-COPTS+= ${MIPSOPTS} -mno-abicalls -fno-pic -msoft-float -mabi=o64 -mlong64
+COPTS+= ${MIPSOPTS} -mno-abicalls -fno-pic -msoft-float
CFLAGS+= -D${PLATFORM}
==== //depot/projects/mips/sys/conf/files.mips#23 (text+ko) ====
@@ -50,6 +50,9 @@
dev/arcbios/arcbios.c optional arcbios
dev/arcbios/arcbios_tty.c optional arcbios
+dev/arcs/arcs.c optional arcs
+dev/arcs/arcs_console.c optional arcs
+
libkern/bcmp.c standard
libkern/divdi3.c standard
libkern/ffs.c standard
==== //depot/projects/mips/sys/conf/options.mips#11 (text+ko) ====
==== //depot/projects/mips/sys/mips/conf/INDY#3 (text+ko) ====
@@ -17,9 +17,7 @@
options IP22 #IP22 (Indy, Indigo2, ...)
# Hardware support
-device arcbios #ARCBIOS
-#options ARCBIOS64 #ARCBIOS uses 64-bit pointers in
- #structures. Disable for IP22.
+device arcs #ARCS Firmware + Console
# Debugging for use in -current
options DDB #Enable the kernel debugger
==== //depot/projects/mips/sys/mips/sgimips/machdep_sgimips.c#25 (text+ko) ====
@@ -43,8 +43,7 @@
#include <platform/models.h>
#include <platform/sysconf.h>
-#include <dev/arcbios/arcbios.h>
-#include <dev/arcbios/arcbiosvar.h>
+#include <dev/arcs/arcs.h>
#include "opt_model.h"
@@ -67,19 +66,19 @@
void
platform_halt(void)
{
- ARCBIOS->EnterInteractiveMode();
+ ARCS_EnterInteractiveMode();
}
void
platform_reset(void)
{
- ARCBIOS->Reboot();
+ ARCS_Reboot();
}
void
platform_start(int argc, char **argv)
{
- struct arcbios_mem *mem;
+ struct ARCS_Mem *mem;
struct machine_type *mtp;
const char *cpufreq;
int first, i, j, last, size;
@@ -88,16 +87,14 @@
kend = 0;
/*
- * Initialise the ARCBIOS stuff.
+ * Initialise the ARCS stuff.
*/
- arcbios_init(MIPS_PHYS_TO_KSEG1(0x00001000));
- arcbios_cnattach();
+ arcs_attach((void *)MIPS_PHYS_TO_KSEG1(0x00001000));
+ arcs_cnattach();
bootverbose = 1; /* XXX */
- ARCBIOS->FlushAllCaches();
-
- cpufreq = ARCBIOS->GetEnvironmentVariable("cpufreq");
+ cpufreq = ARCS_GetEnvironmentVariable("cpufreq");
if (cpufreq == NULL)
panic("$cpufreq not set");
@@ -105,7 +102,7 @@
init_param1();
for (mtp = machines; mtp->identifier != NULL; mtp++) {
- if (strcmp(mtp->identifier, arcbios_system_identifier) == 0)
+ if (strcmp(mtp->identifier, arcs_systemid()) == 0)
break;
}
if (mtp->identifier == NULL)
@@ -116,26 +113,26 @@
}
printf("%s (IP%d), subtype %x, board rev. %x at %sMHz\n",
- arcbios_system_identifier, mach_type, mach_subtype, mach_boardrev, cpufreq);
+ arcs_systemid(), mach_type, mach_subtype, mach_boardrev, cpufreq);
mem = NULL;
j = 0;
for (i = 0;; i++) {
- mem = ARCBIOS->GetMemoryDescriptor(mem);
+ mem = ARCS_GetMemoryDescriptor(mem);
if (mem == NULL)
break;
- first = round_page(mem->BasePage * ARCBIOS_PAGESIZE);
- last = trunc_page(first + mem->PageCount * ARCBIOS_PAGESIZE);
+ first = round_page(mem->BasePage << ARCS_PAGESHIFT);
+ last = trunc_page(first + (mem->PageCount << ARCS_PAGESHIFT));
size = last - first;
switch (mem->Type) {
- case ARCBIOS_MEM_FirmwareTemporary:
- case ARCBIOS_MEM_FirmwarePermanent:
+ case ARCS_Mem_Type_FirmwareTemporary:
+ case ARCS_Mem_Type_FirmwarePermanent:
arcsmem += btoc(size);
break;
- case ARCBIOS_MEM_LoadedProgram:
+ case ARCS_Mem_Type_LoadedProgram:
/* XXX does not allow for kernels loaded
* at the very end of the available space.
* XXX assumes sorted memory, but it is?
@@ -150,13 +147,13 @@
kend = MIPS_PHYS_TO_KSEG0(last);
lpmem += btoc(size);
break;
- case ARCBIOS_MEM_FreeContiguous:
- case ARCBIOS_MEM_FreeMemory:
+ case ARCS_Mem_Type_FreeContiguous:
+ case ARCS_Mem_Type_FreeMemory:
availmem += btoc(size);
phys_avail[j + 0] = first;
phys_avail[j + 1] = last;
if (bootverbose)
- printf("ARCBIOS MEM %#x -> %#x\n", first, last);
+ printf("ARCS MEM %#x -> %#x\n", first, last);
j += 2;
break;
default:
@@ -174,7 +171,7 @@
void
platform_identify(void)
{
- printf("machine: %s\n", arcbios_system_identifier);
+ printf("machine: %s\n", arcs_systemid());
printf("ARCS memory = %d (%d KB)\n", ctob(arcsmem),
ctob(arcsmem) / 1024);
printf("Loaded program memory = %d (%d KB)\n", ctob(lpmem),
More information about the p4-projects
mailing list