PCMCIA on Ultra
Hi!
If anyone has the hardware to play with PCMCIA, I have made this short patch which will make you able to at least compile the PCMCIA package. There are still some issues to be done, e.g. irq has to be always stored in an int and not in a char and stuff like that, but as I don't know if anybody is going to at least try it, I'm stopping here. Another issue is whether we want 32bit programs to work with the PCMCIA ioctls or not. If we just allow 64bit cardmgr etc., it will be much easier.
The patch is against pcmcia-cs-3.0.5:
modules/Makefile renamed from modules/Makefile.jj +13 -0
@@ -16,6 +16,19 @@ ifeq ($(ARCH),ppc) CC := $(CC) -fno-builtin -msoft-float endif +ifeq ($(ARCH),sparc64) +IS_EGCS := $(shell if $(KERN_CC) --version 2>&1 | grep 'egcs' > /dev/null; then echo y; else echo n; fi) +NEW_GAS := $(shell if $(KERN_LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) +ifneq ($(IS_EGCS),y) +CC := $(KERN_CC) -mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +else +CC := $(KERN_CC) -m64 -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +endif +ifeq ($(NEW_GAS),y) +LD := $(KERN_LD) -m elf64_sparc +endif +endif + CPPFLAGS = $(PCDEBUG) -D__KERNEL__ -DMODULE -I../include \ -I$(LINUX)/include -I$(LINUX) COFLAGS = -kv
modules/rsrc_mgr.c renamed from modules/rsrc_mgr.c.jj +1 -1
@@ -464,7 +464,7 @@ void validate_mem(int (*is_valid)(u_longstatic int done =0 ;int pass; -if (!probe_mem || done++) +if (done++)return ;for (pass =0 ; pass <2 ; pass++) {for (m = mem_db.next; m != &mem_db; m = m->next)
modules/i82365.c renamed from modules/i82365.c.jj +2 -0
@@ -984,7 +984,9 @@ static void cb_get_state(u_short s) }#endif #endif +#ifndef __sparc__if (t->cap.pci_irq >=NR_IRQS ) t->cap.pci_irq =0 ; +#endif }static void cb_set_state (u_short s)
clients/Makefile renamed from clients/Makefile.jj +13 -0
@@ -16,6 +16,19 @@ ifeq ($(ARCH),ppc) CC := $(CC) -fno-builtin -msoft-float endif +ifeq ($(ARCH),sparc64) +IS_EGCS := $(shell if $(KERN_CC) --version 2>&1 | grep 'egcs' > /dev/null; then echo y; else echo n; fi) +NEW_GAS := $(shell if $(KERN_LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi) +ifneq ($(IS_EGCS),y) +CC := $(KERN_CC) -mno-fpu -mtune=ultrasparc -mmedlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +else +CC := $(KERN_CC) -m64 -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare +endif +ifeq ($(NEW_GAS),y) +LD := $(KERN_LD) -m elf64_sparc +endif +endif + CPPFLAGS = $(PCDEBUG) -D__KERNEL__ -DMODULE -I../include \ -I$(LINUX)/include -I$(LINUX) COFLAGS = -kv
Configure renamed from Configure.jj +8 -2
@@ -181,9 +181,15 @@ echo "" ask_str "Alternate target install directory" PREFIX +if [ `uname -m` = "sparc64" ]; then +ask_str "C compiler for userland utilities" CC +ask_str "C compiler for kernel modules" KERN_CC +ask_str "Linker name for userland utilities" LD +ask_str "Linker name for kernel modules" KERN_LD +else ask_str "C compiler name" CC - ask_str "Linker name" LD +fi ask_str "Compiler flags for debugging" PCDEBUG
@@ -375,7 +381,7 @@ fi ARCH=`uname -m` echo "ARCH=$ARCH" >> $CONFIG_MK -if [ $ARCH = "ppc" ] ; then CONFIG_ISA=n ; else CONFIG_ISA=y ; fi +if [ $ARCH = "ppc" -o $ARCH = "sparc64" ] ; then CONFIG_ISA=n ; else CONFIG_ISA=y ; fi write_bool CONFIG_ISA if [ $src != "1" -a "$CONFIG_MODVERSIONS" = "y" ] ; then
Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | [email protected] | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
Ultralinux - first 64bit OS to take full power of the UltraSparc Linux version 2.1.125 on a sparc64 machine (498.80 BogoMips).
___________________________________________________________________