summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/Makefile10
-rw-r--r--mdk-stage1/dietlibc/include/sys/file.h11
-rw-r--r--mdk-stage1/dietlibc/include/sys/io.h41
-rw-r--r--mdk-stage1/dietlibc/syscalls.s/ioperm.S3
-rw-r--r--mdk-stage1/pcmcia/cardmgr.c2
5 files changed, 62 insertions, 5 deletions
diff --git a/mdk-stage1/Makefile b/mdk-stage1/Makefile
index 96eade486..48830638f 100644
--- a/mdk-stage1/Makefile
+++ b/mdk-stage1/Makefile
@@ -113,7 +113,7 @@ INIT_LIBC = $(DIETLIBC_LIBC)
endif
-BINS = init #stage1-full
+BINS = init stage1-full
ifeq (i386, $(ARCH))
BINS += stage1-cdrom stage1-disk stage1-network
@@ -127,7 +127,9 @@ endif
ifeq (i386,$(ARCH))
-PCMCIA_LIB = pcmcia/libpcmcia.a
+GLIBC_PCMCIA_LIB = pcmcia/libpcmcia.a
+DIETLIBC_PCMCIA_LIB = $(subst .a,-DIET.a,$(GLIBC_PCMCIA_LIB))
+PCMCIA_LIB = $($(L)_PCMCIA_LIB)
PCMCIA_DEFS = -DENABLE_PCMCIA
endif
@@ -155,7 +157,7 @@ stage1-network: $(STAGE1OBJS-NETWORK) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS)
$(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
-stage1-full: $(STAGE1OBJS) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(PCMCIA_LIB)
+stage1-full: $(STAGE1OBJS) $(STAGE1_OWN_LIBS) $(STAGE1_NETWORK_LIBS) $(FRONTEND_LINK) $(PCMCIA_LIB) $(STAGE1_LIBC)
$(CC) $(LDFLAGS_STAGE1) -o $@ $^
$(STRIPCMD) $@
@@ -173,7 +175,7 @@ $(INITOBJS): %.o: %.c
$(COMPILE) $(INIT_DEFS) -c $<
.c.o: .depend
- $(COMPILE) $(GLIBC_INCLUDES) $(PCMCIA_DEFS) -c $<
+ $(COMPILE) $(INCLUDES) $(PCMCIA_DEFS) -c $<
clean:
diff --git a/mdk-stage1/dietlibc/include/sys/file.h b/mdk-stage1/dietlibc/include/sys/file.h
index 91b6b547e..93787fd42 100644
--- a/mdk-stage1/dietlibc/include/sys/file.h
+++ b/mdk-stage1/dietlibc/include/sys/file.h
@@ -4,5 +4,16 @@
#include <sys/cdefs.h>
extern int fcntl(int fd, int cmd, ...) __THROW;
+extern int flock(int fd, int operation) __THROW;
+
+/* Operations for the `flock' call. */
+#define LOCK_SH 1 /* Shared lock. */
+#define LOCK_EX 2 /* Exclusive lock. */
+#define LOCK_UN 8 /* Unlock. */
+
+/* Can be OR'd in to one of the above. */
+#define LOCK_NB 4 /* Don't block when locking. */
+
+
#endif /* _SYS_FILE_H */
diff --git a/mdk-stage1/dietlibc/include/sys/io.h b/mdk-stage1/dietlibc/include/sys/io.h
new file mode 100644
index 000000000..cce841735
--- /dev/null
+++ b/mdk-stage1/dietlibc/include/sys/io.h
@@ -0,0 +1,41 @@
+#ifndef _IO_H
+#define _IO_H
+
+int ioperm(unsigned long from, unsigned long num, int turn_on) __THROW;
+
+#ifdef __i386__
+
+static __inline void
+outb (unsigned char value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
+}
+
+static __inline unsigned char
+inb (unsigned short int port)
+{
+ unsigned char _v;
+
+ __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline unsigned short int
+inw (unsigned short int port)
+{
+ unsigned short _v;
+
+ __asm__ __volatile__ ("inw %w1,%0":"=a" (_v):"Nd" (port));
+ return _v;
+}
+
+static __inline void
+outw (unsigned short int value, unsigned short int port)
+{
+ __asm__ __volatile__ ("outw %w0,%w1": :"a" (value), "Nd" (port));
+
+}
+
+#endif
+
+#endif
diff --git a/mdk-stage1/dietlibc/syscalls.s/ioperm.S b/mdk-stage1/dietlibc/syscalls.s/ioperm.S
new file mode 100644
index 000000000..0acfde07a
--- /dev/null
+++ b/mdk-stage1/dietlibc/syscalls.s/ioperm.S
@@ -0,0 +1,3 @@
+#include "syscalls.h"
+
+syscall(ioperm,ioperm)
diff --git a/mdk-stage1/pcmcia/cardmgr.c b/mdk-stage1/pcmcia/cardmgr.c
index f461ed180..40b5e6a0f 100644
--- a/mdk-stage1/pcmcia/cardmgr.c
+++ b/mdk-stage1/pcmcia/cardmgr.c
@@ -683,7 +683,7 @@ static void adjust_resources(void)
sprintf(tmp, "irq %u", al->adj.resource.irq.IRQ);
break;
}
- log_message("CM: could not adjust resource: %s: %m", tmp);
+ log_message("CM: could not adjust resource: %s: %s", tmp, strerror(errno));
}
}
}