changeset 4a735b172989 in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=4a735b172989 description: The palcode will now build by simply typing make in this directory. Most of the changes were to fix broken macros in platfrom_tlaser.s
palcode/Makefile: Completly new makefile to build palcode palcode/ev5_alpha_defs.h: fixed a broken define palcode/ev5_impure.h: macro fixes palcode/platform_srcmax.s: manual macro expansion of broken macros... this file isn't needed to build tlaser palcode palcode/platform_tlaser.s: lots of fixups to make the code assemble diffstat: system/alpha/palcode/Makefile | 170 ++++---------------------------- system/alpha/palcode/ev5_alpha_defs.h | 2 +- system/alpha/palcode/ev5_impure.h | 33 ++++++- system/alpha/palcode/platform_srcmax.s | 133 +++++++++++++++++++------ system/alpha/palcode/platform_tlaser.s | 39 ++++--- system/alpha/palcode/tlaserreg.h | 171 +++++++++++++++++++++++++++++++++ 6 files changed, 349 insertions(+), 199 deletions(-) diffs (truncated from 715 to 300 lines): diff -r 681283db9634 -r 4a735b172989 system/alpha/palcode/Makefile --- a/system/alpha/palcode/Makefile Wed Dec 17 21:39:42 2003 -0500 +++ b/system/alpha/palcode/Makefile Fri Dec 19 14:24:01 2003 -0500 @@ -1,157 +1,29 @@ -# -# $Id: Makefile,v 1.2 1997/12/16 01:18:38 bugnion Exp $ -# -# Revision History: -# -# $Log: Makefile,v $ -# Revision 1.2 1997/12/16 01:18:38 bugnion -# Removed bogus TLASER offsets from palcode build. -- roll over -# simultaneously with the simulation tree -# -# Revision 1.1.1.1 1997/10/30 23:27:18 verghese -# current 10/29/97 -# -# -# Set environment variables to point to various things: -# -# EB_TOOLBOX - Where your toolset is located -# +#Makefile for palcode +#Works on alpha-linux and builds elf executable -EB_TOOLBOX = /wrl/proj/simos/bin/tools/osf -CPP = /usr/bin/cpp -AS = $(EB_TOOLBOX)/gas -LD = $(EB_TOOLBOX)/gld -DIS = $(EB_TOOLBOX)/alist -STRIP = $(EB_TOOLBOX)/astrip -PVC = $(EB_TOOLBOX)/pvc -MAKEDEP = $(CPP) -MM +#19 December 2003 - Ali Saidi -# -# Define KDEBUG if you want a special unprivileged CALL_PAL -# breakpoint trap handler for remote kernel debugging. -# -# Define CONSOLE_ENTRY to change the sys$enter_console -# transfer address. Default CONSOLE_ENTRY value is 0x10000. -# -# Define DISABLE_CRD to disable CRD. Note that reset sets MCES so that -# correctable errors are ignored anyway, but this actually stops the -# interrupt. -# +GAS = as +CC = g++ +LD = ld +#CFLAGS=-I ../h -E -P -D SIMOS -nostdinc -nostdinc++ -x c++ +CFLAGS=-I . -E -P -D SIMOS -D BUILD_PALCODE -nostdinc -nostdinc++ -x c++ +GASFLAGS=-m21164 +LDFLAGS=-Ttext 0x4000 -DEFINES = -DDISABLE_CRD -DSIMOS -DBUILD_PALCODE -DEFINES += -I$(SIMTOOLS)/cpus-alpha/simos +SOURCES=platform_tlaser.s osfpal.s +PREPROC := $(SOURCES:.s=.i) +OBJS := $(SOURCES:.s=.o) + +%.i: %.s + $(CC) $(CFLAGS) $< > $@ -CPPFLAGS = -ASFLAGS = -21164 -#LDFLAGS = -Tstrip 0 -Thdr -N -#LDFLAGS = -Tstrip 2000 -Thdr -N # removed bugnion -LDFLAGS = -Tstrip 4000 -Thdr -N -# Source files: -# -# This is the only block in which the list of source files should change. -# -# SFILES - assembler source files -# HFILES - header files -# +%.o: %.i + $(GAS) $(GASFLAGS) -o $@ $< -SFILES = osfpal.s platform.s -HFILES = dc21164.h \ - osf.h \ - macros.h \ - ev5_impure.h \ - cserve.h \ - platform.h - -# Intermediate files: -# -# This block should not change. -# - -IFILES = $(SFILES:.s=.i) - -# Object files: -# -# This block should not change. -# - -OFILES = $(IFILES:.i=.o) - -.DEFAULT: - co -u $< - -.SUFFIXES: -.SUFFIXES: .s .i .o - -.s.i: - $(CPP) $(CPPFLAGS) $(DEFINES) $< $*.i - -osfpal.nh: osfpal - $(STRIP) -a osfpal $@ - $(DIS) osfpal >osfpal.dis - -osfpal: $(OFILES) - echo '$OFILES= ' $(OFILES) - $(LD) $(LDFLAGS) -o $@ $(OFILES) - -osfpal.o: osfpal.i - $(AS) $(ASFLAGS) -o $@ osfpal.i - -platform.o: platform.i - $(AS) $(ASFLAGS) -o $@ platform.i - -pvc: osfpal.lis osfpal.nh osfpal.ent osfpal.map - (export PVC_PAL PVC_ENTRY PVC_MAP PVC_CPU; \ - PVC_PAL=osfpal.nh; \ - PVC_ENTRY=osfpal.ent; \ - PVC_MAP=osfpal.map; \ - PVC_CPU=ev5; \ - $(PVC);) - -osfpal.lis: osfpal - $(DIS) osfpal > $@ - -osfpal.map: osfpal - $(DIS) -m osfpal > $@ - -depend: - @cat < /dev/null > makedep - @(for i in $(SFILES); do echo $$i; \ - $(MAKEDEP) $(DEFINES) $$i | \ - awk '{ if ($$1 != prev) {if (rec != "") print rec; \ - rec = $$0; prev = $$1; } \ - else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ - else rec = rec " " $$2 } } \ - END { print rec }' | sed 's/\.o/\.i/' \ - >> makedep; done) - @echo '/^# DO NOT DELETE THIS LINE/+1,$$d' > eddep - @echo '$$r makedep' >> eddep - @echo 'w' >> eddep - @cp Makefile Makefile.bak - @ed - Makefile < eddep - @rm -f eddep makedep - @echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile - @echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile - @echo '# see make depend above' >> Makefile +all: $(PREPROC) $(OBJS) + ld $(LDFLAGS) -o osfpal $(OBJS) clean: - rm -f core $(OFILES) $(IFILES) - -clobber: clean - rm -f osfpal.lis osfpal.nh osfpal.map osfpal - -rcsinfo: - rlog RCS/* - -rcsget: - co -u $(HFILES) $(SFILES) - -# DO NOT DELETE THIS LINE -osfpal.i: osfpal.s -platform.i: platform.s ./cserve.h ./platform.h -# DEPENDENCIES MUST END AT END OF FILE -# IF YOU PUT STUFF HERE IT WILL GO AWAY -# see make depend above - - - + rm -f *.o *.i osfpal diff -r 681283db9634 -r 4a735b172989 system/alpha/palcode/ev5_alpha_defs.h --- a/system/alpha/palcode/ev5_alpha_defs.h Wed Dec 17 21:39:42 2003 -0500 +++ b/system/alpha/palcode/ev5_alpha_defs.h Fri Dec 19 14:24:01 2003 -0500 @@ -314,7 +314,7 @@ #define mces_m_pce (1<<mces_v_pce) #define mces_m_dpc (1<<mces_v_dpc) #define mces_m_dsc (1<<mces_v_dsc) -#define mces_m_all ((1<<mces_v_mchk) | (1<<mces_v_sce) | (1<<mces_v_pce) | (1<<mces_v_dpc) ! (1<<mces_v_dsc)) +#define mces_m_all ((1<<mces_v_mchk) | (1<<mces_v_sce) | (1<<mces_v_pce) | (1<<mces_v_dpc) | (1<<mces_v_dsc)) // _defend mces,_gbl,def // .endm diff -r 681283db9634 -r 4a735b172989 system/alpha/palcode/ev5_impure.h --- a/system/alpha/palcode/ev5_impure.h Wed Dec 17 21:39:42 2003 -0500 +++ b/system/alpha/palcode/ev5_impure.h Fri Dec 19 14:24:01 2003 -0500 @@ -51,7 +51,7 @@ ** macros will auto-magically adjust the offsets accordingly. ** */ - +#if 0 #define SAVE_GPR(reg,offset,base) \ stq_p reg, ((offset-0x200)&0x3FF)(base) @@ -78,7 +78,38 @@ #define RESTORE_SHADOW(reg,offset,base)\ ldq_p reg, ((offset-CNS_Q_IPR)&0x3FF)(base) +#else +//#define SEXT10(X) (((X) & 0x200) ? ((X) | 0xfffffffffffffc00) : (X)) +#define SEXT10(X) ((X) & 0x3ff) +//#define SEXT10(X) (((X) << 55) >> 55) +#define SAVE_GPR(reg,offset,base) \ + stq_p reg, (SEXT10(offset-0x200))(base) + +#define RESTORE_GPR(reg,offset,base) \ + ldq_p reg, (SEXT10(offset-0x200))(base) + + +#define SAVE_FPR(reg,offset,base) \ + stt reg, (SEXT10(offset-0x200))(base) + +#define RESTORE_FPR(reg,offset,base) \ + ldt reg, (SEXT10(offset-0x200))(base) + +#define SAVE_IPR(reg,offset,base) \ + mfpr v0, reg; \ + stq_p v0, (SEXT10(offset-CNS_Q_IPR))(base) + +#define RESTORE_IPR(reg,offset,base) \ + ldq_p v0, (SEXT10(offset-CNS_Q_IPR))(base); \ + mtpr v0, reg + +#define SAVE_SHADOW(reg,offset,base) \ + stq_p reg, (SEXT10(offset-CNS_Q_IPR))(base) + +#define RESTORE_SHADOW(reg,offset,base)\ + ldq_p reg, (SEXT10(offset-CNS_Q_IPR))(base) +#endif /* orig Structure of the processor-specific impure area */ /* orig aggregate impure struct prefix "" tag ""; diff -r 681283db9634 -r 4a735b172989 system/alpha/palcode/platform_srcmax.s --- a/system/alpha/palcode/platform_srcmax.s Wed Dec 17 21:39:42 2003 -0500 +++ b/system/alpha/palcode/platform_srcmax.s Fri Dec 19 14:24:01 2003 -0500 @@ -1258,14 +1258,33 @@ mfpr r25, regName ; \ stqp r25, CNS_Q_/**/regOff(r14) - mchk_logout(mm_stat, MM_STAT) - mchk_logout(va, VA) // Unlocks VA and MM_STAT - mchk_logout(isr, ISR) - mchk_logout(icsr, ICSR) - mchk_logout(pal_base, PAL_BASE) - mchk_logout(exc_mask, EXC_MASK) - mchk_logout(exc_sum, EXC_SUM) +// mchk_logout(mm_stat, MM_STAT) +// mchk_logout(va, VA) // Unlocks VA and MM_STAT +// mchk_logout(isr, ISR) +// mchk_logout(icsr, ICSR) +// mchk_logout(pal_base, PAL_BASE) +// mchk_logout(exc_mask, EXC_MASK) +// mchk_logout(exc_sum, EXC_SUM) + mfpr r25, mm_stat + stqp r25, CNS_Q_MM_STAT(r14) + mfpr r25, va + stqp r25, CNS_Q_VA(r14) + mfpr r25, isr + stqp r25, CNS_Q_ISR(r14) + mfpr r25, icsr + stqp r25, CNS_Q_ICSR(r14) + mfpr r25, pal_base + stqp r25, CNS_Q_PAL_BASE(r14) + mfpr r25, exc_mask + stqp r25, CNS_Q_EXC_MASK(r14) + mfpr r25, exc_sum + stqp r25, CNS_Q_EXC_SUM(r14) + + + + + ldah r13, 0xfff0(r31) zap r13, 0xE0, r13 // Get Cbox IPR base ldqp r13, ld_lock(r13) // Get ld_lock IPR @@ -1278,31 +1297,81 @@ mfpr r25, pt/**/n ;\ stqp r25, CNS_Q_PT+(8*n)(r14) - svpt(0) - svpt(1) - svpt(2) - svpt(3) - svpt(4) - svpt(5) - svpt(6) _______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev