changeset 3e932649220c in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=3e932649220c
description:
Added platfrom_m5 - Our hacked up tsunami palcode and modified palcode
makefile to that end. Additionally made a change in console to
preserve t7 on call back because linux uses it for the "current"
pointer.
console/Makefile:
Changed makefile back to using gcc and gas rather then trying to
cross-compile for now
console/console.c:
Put code in to save t7 on CallBackFixup() call and changed the
system type to Tsunami
palcode/Makefile:
updated palcode makefile to have targets for tlaser and tsunami
diffstat:
system/alpha/console/Makefile | 14 +-
system/alpha/console/console.c | 23 +-
system/alpha/palcode/Makefile | 14 +-
system/alpha/palcode/platform_m5.s | 2658 ++++++++++++++++++++++++++++++++++++
4 files changed, 2693 insertions(+), 16 deletions(-)
diffs (truncated from 2775 to 300 lines):
diff -r 0f75de05c240 -r 3e932649220c system/alpha/console/Makefile
--- a/system/alpha/console/Makefile Thu Jan 15 02:59:57 2004 -0500
+++ b/system/alpha/console/Makefile Mon Feb 02 17:40:11 2004 -0500
@@ -7,10 +7,8 @@
SOURDIR = ./
PALCODE = ../palcode
INCLUDEH = ../h
-AS=alpha-elf-as
-CC=alpha-elf-gcc
-CXX=alpha-elf-$(CXX)
-
+CC=gcc
+AS=gas
dbmentry.o: dbmentry.s
$(AS) $(INCLUDES) -nointrinsics -o $*.o $*.s
@@ -22,12 +20,12 @@
$(CC) -g3 $(INCLUDES) -nointrinsics -o $*.o -c $*.c
paljtokern.s.o: paljtokern.s
- $(CXX) -I ../palcode -E -P -nostdinc -nostdinc++ -x c++ paljtokern.s | \
- $(AS) -m 21164 -o paljtokern.s.o
+ g++ -I ../palcode -E -P -nostdinc -nostdinc++ -x c++ paljtokern.s | \
+ gas -m 21164 -o paljtokern.s.o
paljtoslave.s.o: paljtoslave.s
- $(CXX) -I ../palcode -E -P -nostdinc -nostdinc++ -x c++ paljtoslave.s |
\
- $(AS) -m 21164 -o paljtoslave.s.o
+ g++ -I ../palcode -E -P -nostdinc -nostdinc++ -x c++ paljtoslave.s | \
+ gas -m 21164 -o paljtoslave.s.o
paljtokern.c: paljtokern.s.o
echo 'unsigned int palJToKern[] = {' > paljtokern.c
diff -r 0f75de05c240 -r 3e932649220c system/alpha/console/console.c
--- a/system/alpha/console/console.c Thu Jan 15 02:59:57 2004 -0500
+++ b/system/alpha/console/console.c Mon Feb 02 17:40:11 2004 -0500
@@ -27,7 +27,6 @@
#include "rpb.h"
#include "cserve.h"
-
#define CONS_INT_TX 0x01 /* interrupt enable / state bits */
#define CONS_INT_RX 0x02
@@ -206,8 +205,8 @@
#if 0
0x12, /* 050: system type - masquarade as some random 21064 */
#endif
- 12, /* masquerade a DEC_3000_500 (bugnion) */
- (2<<1), /* 058: system variation */
+ 34, /* masquerade a Tsunami RGD */
+ (1<<10), /* 058: system variation */
'c'|('o'<<8)|('o'<<16)|('l'<< 24), /* 060: system revision */
1024*4096, /* 068: scaled interval clock intr freq OVERRIDEN*/
0, /* 070: cycle counter frequency */
@@ -1184,7 +1183,23 @@
long CallBackFixup(int a0, int a1, int a2)
{
- printf("CallbackFixup %x %x \n",a0,a1);
+ long temp;
+ /* Linux uses r8 for the current pointer (pointer to data structure
+ contating info about currently running process). It is set when the
+ kernel starts and is expected to remain there... Problem is that the
+ unlike the kernel, the console does not prevent the assembler from
+ using r8. So here is a work around. So far this has only been a problem
+ in CallBackFixup() but any other call back functions could cause a
problem
+ at some point */
+
+ /* save off the current pointer to a temp variable */
+ asm("bis $8, $31, %0" : "=r" (temp));
+
+ /* call original code */
+ printf("CallbackFixup %x %x, t7=%x\n",a0,a1,temp);
+
+ /* restore the current pointer */
+ asm("bis %0, $31, $8" : : "r" (temp) : "$8");
#if 0
if (first[FIRST(a1)]==0) {
diff -r 0f75de05c240 -r 3e932649220c system/alpha/palcode/Makefile
--- a/system/alpha/palcode/Makefile Thu Jan 15 02:59:57 2004 -0500
+++ b/system/alpha/palcode/Makefile Mon Feb 02 17:40:11 2004 -0500
@@ -11,9 +11,10 @@
GASFLAGS=-m21164
LDFLAGS=-Ttext 0x4000
-SOURCES=osfpal.s platform_tlaser.s
+SOURCES=osfpal.s platform_tlaser.s platform_m5.s
PREPROC := $(SOURCES:.s=.i)
-OBJS := $(SOURCES:.s=.o)
+TLOBJS = osfpal.o platform_tlaser.o
+TSOBJS = osfpal.o platform_m5.o
%.i: %.s
$(CC) $(CFLAGS) $< > $@
@@ -21,9 +22,14 @@
%.o: %.i
$(GAS) $(GASFLAGS) -o $@ $<
+all: tlaser tsunami
+
+tlaser: $(PREPROC) $(TLOBJS)
+ $(LD) $(LDFLAGS) -o tl_osfpal $(TLOBJS)
-all: $(PREPROC) $(OBJS)
- $(LD) $(LDFLAGS) -o osfpal $(OBJS)
+tsunami: $(PREPROC) $(TSOBJS)
+ $(LD) $(LDFLAGS) -o ts_osfpal $(TSOBJS)
clean:
rm -f *.o *.i osfpal
+
diff -r 0f75de05c240 -r 3e932649220c system/alpha/palcode/platform_m5.s
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/system/alpha/palcode/platform_m5.s Mon Feb 02 17:40:11 2004 -0500
@@ -0,0 +1,2658 @@
+// build_fixed_image: not sure what means
+// real_mm to be replaced during rewrite
+// remove_save_state remove_restore_state can be remooved to save space ??
+
+
+#define egore 0
+#define acore 0
+#define beh_model 0
+#define ev5_p2 1
+#define ev5_p1 0
+#define ldvpte_bug_fix 1
+#define spe_fix 0
+#define osf_chm_fix 0
+#define build_fixed_image 0
+#define enable_p4_fixups 0
+#define osf_svmin 1
+#define enable_physical_console 0
+#define fill_err_hack 0
+#define icflush_on_tbix 0
+#define max_cpuid 1
+#define perfmon_debug 0
+#define rax_mode 0
+
+#define hw_rei_spe hw_rei
+
+#include "ev5_defs.h"
+#include "ev5_impure.h"
+#include "ev5_alpha_defs.h"
+#include "ev5_paldef.h"
+#include "ev5_osfalpha_defs.h"
+#include "fromHudsonMacros.h"
+#include "fromHudsonOsf.h"
+#include "dc21164FromGasSources.h"
+#include "cserve.h"
+#include "tlaserreg.h"
+//#include "simos.h"
+
+
+#define ldlp ldl_p
+#define ldqp ldq_p
+
+#define stlp stl_p
+#define stqp stq_p
+#define stqpc stqp
+
+#ifdef SIMOS
+#define ldqpl ldq_p
+#define sdqpl sdq_p
+#else
+<--bomb>
+#endif
+
+#define pt_entInt pt_entint
+#define pt_entArith pt_entarith
+#define mchk_size ((mchk_cpu_base + 7 + 8) &0xfff8)
+#define mchk_flag CNS_Q_FLAG
+#define mchk_sys_base 56
+#define mchk_cpu_base (CNS_Q_LD_LOCK + 8)
+#define mchk_offsets CNS_Q_EXC_ADDR
+#define mchk_mchk_code 8
+#define mchk_ic_perr_stat CNS_Q_ICPERR_STAT
+#define mchk_dc_perr_stat CNS_Q_DCPERR_STAT
+#define mchk_sc_addr CNS_Q_SC_ADDR
+#define mchk_sc_stat CNS_Q_SC_STAT
+#define mchk_ei_addr CNS_Q_EI_ADDR
+#define mchk_bc_tag_addr CNS_Q_BC_TAG_ADDR
+#define mchk_fill_syn CNS_Q_FILL_SYN
+#define mchk_ei_stat CNS_Q_EI_STAT
+#define mchk_exc_addr CNS_Q_EXC_ADDR
+#define mchk_ld_lock CNS_Q_LD_LOCK
+#define osfpcb_q_Ksp pcb_q_ksp
+#define pal_impure_common_size ((0x200 + 7) & 0xfff8)
+
+#define ALIGN_BLOCK \
+ .align 5
+
+#define ALIGN_BRANCH \
+ .align 3
+
+#define EXPORT(_x) \
+ .align 5; \
+ .globl _x; \
+_x:
+
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// XXX the following is 'made up'
+// XXX bugnion
+
+// XXX bugnion not sure how to align 'quad'
+#define ALIGN_QUAD \
+ .align 3
+
+#define ALIGN_128 \
+ .align 7
+
+
+#define GET_IMPURE(_r) mfpr _r,pt_impure
+#define GET_ADDR(_r1,_off,_r2) lda _r1,_off(_r2)
+
+
+#define BIT(_x) (1<<(_x))
+
+
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// XXX back to original code
+
+// .sbttl "System specific code - beh model version"
+
+//
+// Entry points
+// SYS$CFLUSH - Cache flush
+// SYS$CSERVE - Console service
+// SYS$WRIPIR - interprocessor interrupts
+// SYS$HALT_INTERRUPT - Halt interrupt
+// SYS$PASSIVE_RELEASE - Interrupt, passive release
+// SYS$INTERRUPT - Interrupt
+// SYS$RESET - Reset
+// SYS$ENTER_CONSOLE
+
+//
+// Macro to read TLINTRSUMx
+//
+// Based on the CPU_NUMBER, read either the TLINTRSUM0 or TLINTRSUM1 register
+//
+// Assumed register usage:
+// rsum TLINTRSUMx contents
+// raddr node space address
+// scratch scratch register
+
+
+// .macro Read_TLINTRSUMx rsum, raddr, scratch, ?label1, ?label2
+//
+// nop
+// mfpr 'scratch', pt_whami // Get our whami (VID)
+//
+// extbl 'scratch', #1, 'scratch' // shift down to bit 0
+// lda 'raddr', ^xff88(r31) // Get base node space address
bits
+//
+// sll 'raddr', #24, 'raddr' // Shift up to proper position
+// srl 'scratch', #1, 'rsum' // Shift off the cpu number
+//
+// sll 'rsum', #22, 'rsum' // Get our node offset
+// addq 'raddr', 'rsum', 'raddr' // Get our base node space
address
+//
+// blbs 'scratch', label1
+// lda 'raddr', <tlep$tlintrsum0_offset>('raddr')
+//
+// br r31, label2
+//label1: lda 'raddr', <tlep$tlintrsum1_offset>('raddr')
+//
+//label2: ldlp 'rsum', 0('raddr') // read the right
tlintrsum reg
+//.endm
+
+#define Read_TLINTRSUMx(_rsum,_raddr,_scratch) \
+ nop; \
+ mfpr _scratch,pt_whami; \
+ extbl _scratch,1,_scratch; \
+ lda _raddr,0xff88(zero); \
+ sll _raddr,24,_raddr; \
+ srl _scratch,1,_rsum; \
+ sll _rsum,22,_rsum; \
+ addq _raddr,_rsum,_raddr; \
+ blbs _scratch,1f; \
+ lda _raddr,0x1180(_raddr); \
+ br r31,2f; \
+1: \
+ lda _raddr,0x11c0(_raddr); \
+2: ldlp _rsum,0(_raddr)
+
+
+
+//
+// Macro to write TLINTRSUMx
+//
+// Based on the CPU_NUMBER, write either the TLINTRSUM0 or TLINTRSUM1 register
+//
+// Assumed register usage:
+// rsum TLINTRSUMx write data
+// raddr node space address
+// scratch scratch register
+
+// .macro Write_TLINTRSUMx rsum, raddr, whami, ?label1, ?label2
+//
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev