changeset 2dfcde2e9998 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=2dfcde2e9998
description:
        Major system code cleanup and formatting
        remove unused code

        console/Makefile:
            cleanup Makefile.  Remove unneeded -D options
        console/console.c:
            Major cleanup and formatting
            remove unused #ifdef code
            remove unused #includes
            rename xxm -> m5
            rename simos -> m5
        console/dbmentry.S:
        console/paljtokern.S:
        console/paljtoslave.S:
        console/printf.c:
            Major cleanup and formatting
            remove unused #ifdef code
            remove unused #includes
            rename __start -> _start to get rid of warning.
        h/cserve.h:
        h/dc21164FromGasSources.h:
        h/ev5_alpha_defs.h:
        h/ev5_defs.h:
        h/ev5_osfalpha_defs.h:
        h/ev5_paldef.h:
        h/fromHudsonMacros.h:
        h/fromHudsonOsf.h:
        h/rpb.h:
            Major cleanup and formatting
        h/ev5_impure.h:
            Major cleanup and formatting
            remove unused #ifdef code
        palcode/Makefile:
            cleanup Makefile
            remove unused -D options
            unify platform_tlaser.S and platform_tsunami.S into platform.S and
            generate multiple .o files using various #defines
            unify osfpal.S osfpal_cache_copy.S and 
osfpal_cache_copy_unaligned.S into
            osfpal.S and generate multiple .o files using various #defines
        palcode/osfpal.S:
            Major cleanup and formatting
            remove unused #defines
            remove unused #if code
            merge copy code into this file.
        palcode/platform.S:
            Major cleanup and formatting
            remove unused #defines
            remove unused #if code
            merge platform code into this file.

diffstat:

 system/alpha/console/Makefile                      |    65 +-
 system/alpha/console/console.c                     |  1733 ++---
 system/alpha/console/dbmentry.S                    |   183 +-
 system/alpha/console/paljtokern.S                  |   203 +-
 system/alpha/console/paljtoslave.S                 |   179 +-
 system/alpha/console/printf.c                      |   478 +-
 system/alpha/h/cia.h                               |   456 -
 system/alpha/h/cserve.h                            |   101 +-
 system/alpha/h/dc21164FromGasSources.h             |   119 +-
 system/alpha/h/eb164.h                             |   184 -
 system/alpha/h/ev5_alpha_defs.h                    |   201 +-
 system/alpha/h/ev5_defs.h                          |    67 +-
 system/alpha/h/ev5_impure.h                        |   485 +-
 system/alpha/h/ev5_osfalpha_defs.h                 |   154 +-
 system/alpha/h/ev5_paldef.h                        |   101 +-
 system/alpha/h/fromHudsonMacros.h                  |    97 +-
 system/alpha/h/fromHudsonOsf.h                     |   113 +-
 system/alpha/h/lib.h                               |   517 -
 system/alpha/h/platform.h                          |   244 -
 system/alpha/h/regdefs.h                           |    81 -
 system/alpha/h/rpb.h                               |   293 +-
 system/alpha/palcode/Makefile                      |   110 +-
 system/alpha/palcode/osfpal.S                      |  1879 +-----
 system/alpha/palcode/osfpal_cache_copy.S           |  5309 --------------------
 system/alpha/palcode/osfpal_cache_copy_unaligned.S |  5305 -------------------
 system/alpha/palcode/platform.S                    |  2341 ++++++++
 system/alpha/palcode/platform_m5.S                 |  2802 ----------
 system/alpha/palcode/platform_tlaser.S             |  2872 ----------
 28 files changed, 4764 insertions(+), 21908 deletions(-)

diffs (truncated from 29305 to 300 lines):

diff -r 2f71125bf413 -r 2dfcde2e9998 system/alpha/console/Makefile
--- a/system/alpha/console/Makefile     Sat Jun 04 18:59:06 2005 -0400
+++ b/system/alpha/console/Makefile     Mon Jun 27 17:25:54 2005 -0400
@@ -1,44 +1,41 @@
-#Copyright (c) 2005 
-#The Regents of The University of Michigan
-#All Rights Reserved
+# Copyright (c) 2005 
+# The Regents of The University of Michigan
+# All Rights Reserved
 #
-#This code is part of the M5 simulator, developed by Nathan Binkert,
-#Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions
-#from Ron Dreslinski, Dave Greene, Lisa Hsu, Ali Saidi, and Andrew
-#Schultz.
+# This code is part of the M5 simulator, developed by Nathan Binkert,
+# Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions
+# from Ron Dreslinski, Dave Greene, Lisa Hsu, Ali Saidi, and Andrew
+# Schultz.
 #
-#Permission is granted to use, copy, create derivative works and
-#redistribute this software and such derivative works for any purpose,
-#so long as the copyright notice above, this grant of permission, and
-#the disclaimer below appear in all copies made; and so long as the
-#name of The University of Michigan is not used in any advertising or
-#publicity pertaining to the use or distribution of this software
-#without specific, written prior authorization.
+# Permission is granted to use, copy, create derivative works and
+# redistribute this software and such derivative works for any purpose,
+# so long as the copyright notice above, this grant of permission, and
+# the disclaimer below appear in all copies made; and so long as the
+# name of The University of Michigan is not used in any advertising or
+# publicity pertaining to the use or distribution of this software
+# without specific, written prior authorization.
 #
-#THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
-#UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
-#WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
-#IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
-#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
-#THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
-#INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-#DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
-#WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
-#ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-DBMENTRY       = fffffc0000010000
-CFLAGS=-I . -I ../h -I$(M5)/dev -nostdinc++ -Wa,-m21164
-
-ARCHNAME=$(shell uname -m)
+# THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
+# UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
+# WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
+# IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
+# THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
+# INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+# DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 
 ### If we are not compiling on an alpha, we must use cross tools ###    
-ifneq ($(ARCHNAME), alpha)
+ifneq ($(shell uname -m), alpha)
 CROSS_COMPILE?=alpha-unknown-linux-gnu-
 endif
 CC=$(CROSS_COMPILE)gcc
 AS=$(CROSS_COMPILE)as
 LD=$(CROSS_COMPILE)ld
 
+DBMENTRY= fffffc0000010000
+CFLAGS=-I . -I ../h -I$(M5)/dev -fno-builtin -Wa,-m21164
 OBJS=dbmentry.o printf.o paljtokern.o paljtoslave.o
 TLOBJS+=$(OBJS) console_tl.o
 TSOBJS+=$(OBJS) console_ts.o
@@ -54,19 +51,19 @@
        $(CC) $(CFLAGS) -nostdinc -o $@ -c $<
 
 console_ts.o: console.c
-       $(CC)  -g3 $(CFLAGS) -D _TIME_T -D TSUNAMI -o $@ -c $<
+       $(CC)  -g3 $(CFLAGS) -D TSUNAMI -o $@ -c $<
 
 console_tl.o: console.c
-       $(CC)  -g3 $(CFLAGS) -D _TIME_T -D TLASER  -o $@ -c $< 
+       $(CC)  -g3 $(CFLAGS) -D TLASER  -o $@ -c $< 
 
 printf.o: printf.c 
        $(CC)  -g3 $(CFLAGS) -o $@ -c $<
 
 console_ts: $(TSOBJS)
-       $(LD) -o console_ts  -N -Ttext $(DBMENTRY) -non_shared $(TSOBJS) -lc
+       $(LD) -o console_ts -N -Ttext $(DBMENTRY) -non_shared $(TSOBJS) -lc
 
 console_tl: $(TLOBJS)
-       $(LD) -o console_tl  -N -Ttext $(DBMENTRY) -non_shared $(TLOBJS) -lc
+       $(LD) -o console_tl -N -Ttext $(DBMENTRY) -non_shared $(TLOBJS) -lc
 
 clean:
        rm -f *.o console_t?
diff -r 2f71125bf413 -r 2dfcde2e9998 system/alpha/console/console.c
--- a/system/alpha/console/console.c    Sat Jun 04 18:59:06 2005 -0400
+++ b/system/alpha/console/console.c    Mon Jun 27 17:25:54 2005 -0400
@@ -1,85 +1,77 @@
 /*
-Copyright (c) 2003, 2004
-The Regents of The University of Michigan
-All Rights Reserved
+ * Copyright (c) 2003, 2004
+ * The Regents of The University of Michigan
+ * All Rights Reserved
+ *
+ * This code is part of the M5 simulator, developed by Nathan Binkert,
+ * Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions
+ * from Ron Dreslinski, Dave Greene, Lisa Hsu, Ali Saidi, and Andrew
+ * Schultz.
+ *
+ * Permission is granted to use, copy, create derivative works and
+ * redistribute this software and such derivative works for any purpose,
+ * so long as the copyright notice above, this grant of permission, and
+ * the disclaimer below appear in all copies made; and so long as the
+ * name of The University of Michigan is not used in any advertising or
+ * publicity pertaining to the use or distribution of this software
+ * without specific, written prior authorization.
+ *
+ * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
+ * UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
+ * WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
+ * IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
+ * THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
+ * INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+ * DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
 
-This code is part of the M5 simulator, developed by Nathan Binkert,
-Erik Hallnor, Steve Raasch, and Steve Reinhardt, with contributions
-from Ron Dreslinski, Dave Greene, Lisa Hsu, Ali Saidi, and Andrew
-Schultz.
+/*
+ * Copyright 1993 Hewlett-Packard Development Company, L.P.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
 
-Permission is granted to use, copy, create derivative works and
-redistribute this software and such derivative works for any purpose,
-so long as the copyright notice above, this grant of permission, and
-the disclaimer below appear in all copies made; and so long as the
-name of The University of Michigan is not used in any advertising or
-publicity pertaining to the use or distribution of this software
-without specific, written prior authorization.
-
-THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
-UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND WITHOUT
-WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER EXPRESS OR
-IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE REGENTS OF
-THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE FOR ANY DAMAGES,
-INCLUDING DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WITH RESPECT TO ANY CLAIM ARISING OUT OF OR IN CONNECTION
-WITH THE USE OF THE SOFTWARE, EVEN IF IT HAS BEEN OR IS HEREAFTER
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-*/
-/*
-Copyright 1993 Hewlett-Packard Development Company, L.P.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
 /* ******************************************
- * SimOS SRM  Console
- *
- * Derived from Lance Berc's SRM console
- * for the SRC XXM Machine
+ * M5 Console
  * ******************************************/
 
-
-typedef unsigned long long uint64_t;
-typedef unsigned long long uint64;
-typedef unsigned int uint32_t;
-typedef unsigned int uint32;
+#include <linux/stddef.h>
+#include <sys/types.h>
 
 #define CONSOLE
 #include "alpha_access.h"
-
-#if 0
-#include "new_aouthdr.h"
-#include "srcmax.h"
-#endif
-
-/* from ../h */
-#include "lib.h"
+#include "cserve.h"
 #include "rpb.h"
-#include "cserve.h"
 
 #define CONS_INT_TX   0x01  /* interrupt enable / state bits */
 #define CONS_INT_RX   0x02
 
+#define PAGE_SIZE (8192)
+
 #define KSEG   0xfffffc0000000000
 #define K1BASE 0xfffffc8000000000
-#define KSEG_TO_PHYS(x)(((ul)x) & ~KSEG)
+#define KSEG_TO_PHYS(x) (((ulong)x) & ~KSEG)
 
 #ifdef TSUNAMI
 #define ALPHA_ACCESS_BASE 0xfffffd0200000000
@@ -89,295 +81,258 @@
 #error TSUNAMI/TLASER not defined.
 #endif
 
-#define PHYS_TO_K1(_x) (K1BASE|(_x))
+#define ROUNDUP8(x) ((ulong)(((ulong)x)+7) & ~7)
+#define ROUNDUP128(x) ((ulong)(((ulong)x) + 127) & ~127)
+#define ROUNDUP8K(x) ((ulong)(((ulong)(x)) + 8191) & ~8191)
 
-#define AOUT_LOAD_ADDR (KSEG|0xf000)
-
-#define ROUNDUP8(x) ((ul)(((ul)x)+7) & ~7)
-#define ROUNDUP128(x) ((ul)(((ul)x)+127) & ~127)
-#define ROUNDUP8K(x) ((ul)(((ul)(x))+8191) & ~8191)
-
-#define FIRST(x)  ((((ul)(x)) >> 33) & 0x3ff)
-#define SECOND(x) ((((ul)(x)) >> 23) & 0x3ff)
-#define THIRD(x) ((((ul)(x)) >> 13) & 0x3ff)
-#define THIRD_XXX(x)  ((((ul)(x)) >> 13) & 0xfff)
-#define PFN(x)  ((((ul)(x) & ~KSEG) >> 13))
+#define FIRST(x)  ((((ulong)(x)) >> 33) & 0x3ff)
+#define SECOND(x) ((((ulong)(x)) >> 23) & 0x3ff)
+#define THIRD(x) ((((ulong)(x)) >> 13) & 0x3ff)
+#define THIRD_XXX(x)  ((((ulong)(x)) >> 13) & 0xfff)
+#define PFN(x)  ((((ulong)(x) & ~KSEG) >> 13))
 
 /* Kernel write | kernel read | valid */
-#define KPTE(x) ((ul)((((ul)(x)) << 32) | 0x1101))
+#define KPTE(x) ((ulong)((((ulong)(x)) << 32) | 0x1101))
 
 #define HWRPB_PAGES 16
 #define MDT_BITMAP_PAGES  4
 
-#define CSERVE_K_JTOKERN       0x18
-
 #define NUM_KERNEL_THIRD (4)
 
-#define printf_lock(args...)  \
-    do { \
-    SpinLock(&theLock); \
-    printf(args); \
-    SpinUnlock(&theLock); \
+#define printf_lock(args...)           \
+    do {                               \
+        SpinLock(&theLock);            \
+        printf(args);                  \
+        SpinUnlock(&theLock);          \
     } while (0)
 
 
-static unixBoot(int go, int argc, char **argv);
-void jToPal(ul bootadr);
+void unixBoot(int go, int argc, char **argv);
+void JToKern(char *bootadr, ulong rpb_percpu, ulong free_pfn, ulong k_argc,
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to