From: Philip Homburg Date: Wed, 15 Feb 2006 14:21:56 +0000 (+0000) Subject: Moved PCI driver to the ramdisk. X-Git-Tag: v3.1.2a~358 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-dsfromkey.html?a=commitdiff_plain;h=7034c0795dfa9b18e36f4facfed1ba583dba4776;p=minix.git Moved PCI driver to the ramdisk. --- diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile index ff9f0de6a..d1e17d225 100644 --- a/drivers/memory/Makefile +++ b/drivers/memory/Makefile @@ -48,6 +48,7 @@ clean: depend: /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend + cd ramdisk && make depend # Include generated dependencies. include .depend diff --git a/drivers/memory/ramdisk/Makefile b/drivers/memory/ramdisk/Makefile index 209578d71..c33446014 100644 --- a/drivers/memory/ramdisk/Makefile +++ b/drivers/memory/ramdisk/Makefile @@ -1,7 +1,7 @@ # Makefile for ramdisk image PROGRAMS=at_wini bios_wini cdprobe dev2name floppy loadramdisk newroot \ - sh service sysenv + pci sh service sysenv all: image.c @@ -37,6 +37,12 @@ floppy: ../../floppy/floppy ../../floppy/floppy: cd ../../floppy && make +pci: ../../pci/pci + install -s ../../$@/$@ $@ + +../../pci/pci: + cd ../../pci && make + cdprobe: ../../../commands/simple/cdprobe install -s ../../../commands/simple/$@ $@ @@ -79,3 +85,9 @@ service: ../../../servers/rs/service ../../../servers/rs/service: cd ../../../servers/rs && make service +depend: + /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend + +# Include generated dependencies. +include .depend + diff --git a/drivers/memory/ramdisk/proto b/drivers/memory/ramdisk/proto index de7de55b4..34d2f2055 100644 --- a/drivers/memory/ramdisk/proto +++ b/drivers/memory/ramdisk/proto @@ -1,5 +1,5 @@ boot -200 100 +240 100 d--755 0 0 bin d--755 0 0 at_wini ---755 0 0 at_wini @@ -9,6 +9,7 @@ d--755 0 0 floppy ---755 0 0 floppy loadramdisk ---755 0 0 loadramdisk newroot ---755 0 0 newroot + pci ---755 0 0 pci sh ---755 0 0 sh service ---755 0 0 service sysenv ---755 0 0 sysenv diff --git a/drivers/memory/ramdisk/rc b/drivers/memory/ramdisk/rc index 2aefa961e..081cfa5ef 100644 --- a/drivers/memory/ramdisk/rc +++ b/drivers/memory/ramdisk/rc @@ -1,5 +1,6 @@ #!/bin/sh set -e +/bin/service up /bin/pci /bin/service up /bin/floppy -dev /dev/fd0 if [ X`/bin/sysenv bios_wini` = Xyes ] then diff --git a/include/minix/com.h b/include/minix/com.h index 484179750..22a9a12f6 100755 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -38,8 +38,7 @@ #define LOG_PROC_NR 4 /* log device driver */ #define TTY_PROC_NR 5 /* terminal (TTY) driver */ #define DS_PROC_NR 6 /* data store server */ -#define PCI_PROC_NR 7 /* driver for PCI controllers */ -#define INIT_PROC_NR 8 /* init -- goes multiuser */ +#define INIT_PROC_NR 7 /* init -- goes multiuser */ /* Number of processes contained in the system image. */ #define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1) diff --git a/kernel/table.c b/kernel/table.c index cf23259fa..c4c3ff38d 100755 --- a/kernel/table.c +++ b/kernel/table.c @@ -109,8 +109,8 @@ PUBLIC struct boot_image image[] = { { LOG_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M, DRV_C, "log" }, #if 0 { DRVR_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M, DRV_C, "driver"}, -#endif { PCI_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M, PCI_C, "pci"}, +#endif { INIT_PROC_NR, 0, USR_F, 8, USER_Q, 0, USR_T, USR_M, 0, "init" }, }; diff --git a/lib/syslib/pci.h b/lib/syslib/pci.h new file mode 100644 index 000000000..08dd2ffd0 --- /dev/null +++ b/lib/syslib/pci.h @@ -0,0 +1 @@ +extern int pci_procnr; diff --git a/lib/syslib/pci_attr_r16.c b/lib/syslib/pci_attr_r16.c index b5fae6088..6aff1aa5a 100644 --- a/lib/syslib/pci_attr_r16.c +++ b/lib/syslib/pci_attr_r16.c @@ -2,6 +2,7 @@ pci_attr_r16.c */ +#include "pci.h" #include "syslib.h" #include @@ -19,7 +20,7 @@ int port; m.m2_i1= devind; m.m2_i2= port; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_attr_r16: can't talk to PCI", r); diff --git a/lib/syslib/pci_attr_r32.c b/lib/syslib/pci_attr_r32.c index b9b53a679..aa9bd7a91 100644 --- a/lib/syslib/pci_attr_r32.c +++ b/lib/syslib/pci_attr_r32.c @@ -2,6 +2,7 @@ pci_attr_r32.c */ +#include "pci.h" #include "syslib.h" #include @@ -19,7 +20,7 @@ int port; m.m2_i1= devind; m.m2_i2= port; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_attr_r32: can't talk to PCI", r); diff --git a/lib/syslib/pci_attr_r8.c b/lib/syslib/pci_attr_r8.c index 616390ab4..95f4ce27e 100644 --- a/lib/syslib/pci_attr_r8.c +++ b/lib/syslib/pci_attr_r8.c @@ -2,6 +2,7 @@ pci_attr_r8.c */ +#include "pci.h" #include "syslib.h" #include @@ -19,7 +20,7 @@ int port; m.m2_i1= devind; m.m2_i2= port; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_attr_r8: can't talk to PCI", r); diff --git a/lib/syslib/pci_attr_w16.c b/lib/syslib/pci_attr_w16.c index c2c8e2eb2..7c13ed6a1 100644 --- a/lib/syslib/pci_attr_w16.c +++ b/lib/syslib/pci_attr_w16.c @@ -2,6 +2,7 @@ pci_attr_w16.c */ +#include "pci.h" #include "syslib.h" #include @@ -21,7 +22,7 @@ u16_t value; m.m2_i2= port; m.m2_l1= value; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_attr_w16: can't talk to PCI", r); diff --git a/lib/syslib/pci_attr_w32.c b/lib/syslib/pci_attr_w32.c index bf1110ad2..887dd0752 100644 --- a/lib/syslib/pci_attr_w32.c +++ b/lib/syslib/pci_attr_w32.c @@ -2,6 +2,7 @@ pci_attr_w32.c */ +#include "pci.h" #include "syslib.h" #include @@ -21,7 +22,7 @@ u32_t value; m.m2_i2= port; m.m2_l1= value; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_attr_w32: can't talk to PCI", r); diff --git a/lib/syslib/pci_attr_w8.c b/lib/syslib/pci_attr_w8.c index 7385d9505..a764d3a51 100644 --- a/lib/syslib/pci_attr_w8.c +++ b/lib/syslib/pci_attr_w8.c @@ -2,6 +2,7 @@ pci_attr_w8.c */ +#include "pci.h" #include "syslib.h" #include @@ -21,7 +22,7 @@ u8_t value; m.m2_i2= port; m.m2_l1= value; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_attr_w8: can't talk to PCI", r); diff --git a/lib/syslib/pci_dev_name.c b/lib/syslib/pci_dev_name.c index 5200e9f1c..0757d3976 100644 --- a/lib/syslib/pci_dev_name.c +++ b/lib/syslib/pci_dev_name.c @@ -2,6 +2,7 @@ pci_dev_name.c */ +#include "pci.h" #include "syslib.h" #include @@ -23,7 +24,7 @@ u16_t did; m.m1_i3= sizeof(name); m.m1_p1= name; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_dev_name: can't talk to PCI", r); diff --git a/lib/syslib/pci_find_dev.c b/lib/syslib/pci_find_dev.c index 0e6437631..c498ddec6 100644 --- a/lib/syslib/pci_find_dev.c +++ b/lib/syslib/pci_find_dev.c @@ -2,6 +2,7 @@ pci_find_dev.c */ +#include "pci.h" #include "syslib.h" #include @@ -22,7 +23,7 @@ int *devindp; m.m1_i2= dev; m.m1_i3= func; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_find_dev: can't talk to PCI", r); diff --git a/lib/syslib/pci_first_dev.c b/lib/syslib/pci_first_dev.c index b1c408efb..6f3b3b894 100644 --- a/lib/syslib/pci_first_dev.c +++ b/lib/syslib/pci_first_dev.c @@ -2,6 +2,7 @@ pci_first_dev.c */ +#include "pci.h" #include "syslib.h" #include @@ -17,7 +18,7 @@ u16_t *didp; message m; m.m_type= BUSC_PCI_FIRST_DEV; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_first_dev: can't talk to PCI", r); if (m.m_type == 1) diff --git a/lib/syslib/pci_ids.c b/lib/syslib/pci_ids.c index c05e05aaf..33f839fd2 100644 --- a/lib/syslib/pci_ids.c +++ b/lib/syslib/pci_ids.c @@ -2,6 +2,7 @@ pci_ids.c */ +#include "pci.h" #include "syslib.h" #include @@ -19,7 +20,7 @@ u16_t *didp; m.m_type= BUSC_PCI_IDS; m.m1_i1= devind; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_ids: can't talk to PCI", r); diff --git a/lib/syslib/pci_init1.c b/lib/syslib/pci_init1.c index 76df3e572..a56516476 100644 --- a/lib/syslib/pci_init1.c +++ b/lib/syslib/pci_init1.c @@ -2,10 +2,14 @@ pci_init1.c */ +#include "pci.h" #include "syslib.h" #include +#include #include +int pci_procnr= ANY; + /*===========================================================================* * pci_init1 * *===========================================================================*/ @@ -16,6 +20,11 @@ char *name; size_t len; message m; + r= findproc("pci", &pci_procnr); + if (r != 0) + panic("pci", "pci_init1: findproc failed for 'pci'", r); + printf("'pci' is at %d\n", pci_procnr); + m.m_type= BUSC_PCI_INIT; len= strlen(name); if (len+1 <= sizeof(m.m3_ca1)) @@ -26,7 +35,7 @@ char *name; memcpy(m.m3_ca1, name, len); m.m3_ca1[len]= '\0'; } - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_init1: can't talk to PCI", r); if (m.m_type != 0) diff --git a/lib/syslib/pci_next_dev.c b/lib/syslib/pci_next_dev.c index 2cb6d9fc0..adf499d5b 100644 --- a/lib/syslib/pci_next_dev.c +++ b/lib/syslib/pci_next_dev.c @@ -2,6 +2,7 @@ pci_next_dev.c */ +#include "pci.h" #include "syslib.h" #include @@ -19,7 +20,7 @@ u16_t *didp; m.m_type= BUSC_PCI_NEXT_DEV; m.m1_i1= *devindp; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_next_dev: can't talk to PCI", r); diff --git a/lib/syslib/pci_rescan_bus.c b/lib/syslib/pci_rescan_bus.c index 1e0c3387e..7542b202d 100644 --- a/lib/syslib/pci_rescan_bus.c +++ b/lib/syslib/pci_rescan_bus.c @@ -2,6 +2,7 @@ pci_rescan_bus.c */ +#include "pci.h" #include "syslib.h" #include @@ -17,7 +18,7 @@ u8_t busnr; m.m_type= BUSC_PCI_RESCAN; m.m1_i1= busnr; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_rescan_bus: can't talk to PCI", r); diff --git a/lib/syslib/pci_reserve.c b/lib/syslib/pci_reserve.c index 3cf638188..84d7ad0d1 100644 --- a/lib/syslib/pci_reserve.c +++ b/lib/syslib/pci_reserve.c @@ -2,6 +2,7 @@ pci_reserve.c */ +#include "pci.h" #include "syslib.h" #include @@ -17,7 +18,7 @@ int devind; m.m_type= BUSC_PCI_RESERVE; m.m1_i1= devind; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_reserve: can't talk to PCI", r); diff --git a/lib/syslib/pci_slot_name.c b/lib/syslib/pci_slot_name.c index 0591d2572..d8dff2103 100644 --- a/lib/syslib/pci_slot_name.c +++ b/lib/syslib/pci_slot_name.c @@ -2,6 +2,7 @@ pci_slot_name.c */ +#include "pci.h" #include "syslib.h" #include @@ -21,7 +22,7 @@ int devind; m.m1_i2= sizeof(name); m.m1_p1= name; - r= sendrec(PCI_PROC_NR, &m); + r= sendrec(pci_procnr, &m); if (r != 0) panic("pci", "pci_slot_name: can't talk to PCI", r); diff --git a/tools/Makefile b/tools/Makefile index de7eae873..9b2e78d7e 100755 --- a/tools/Makefile +++ b/tools/Makefile @@ -19,7 +19,6 @@ PROGRAMS= ../kernel/kernel \ ../drivers/tty/tty \ ../drivers/memory/memory \ ../drivers/log/log \ - ../drivers/pci/pci \ ../servers/init/init usage: