Root/
Source at commit 519 created 13 years 6 months ago. By meklort, Moved GraphicsEnabler into a module. Untested | |
---|---|
1 | #include "libsaio.h"␊ |
2 | #include "boot.h"␊ |
3 | #include "bootstruct.h"␊ |
4 | #include "pci.h"␊ |
5 | #include "modules.h"␊ |
6 | ␊ |
7 | extern void set_eth_builtin(pci_dt_t *eth_dev);␊ |
8 | extern void notify_usb_dev(pci_dt_t *pci_dev);␊ |
9 | extern void force_enable_hpet(pci_dt_t *lpc_dev);␊ |
10 | ␊ |
11 | extern pci_dt_t *dram_controller_dev;␊ |
12 | ␊ |
13 | void setup_pci_devs(pci_dt_t *pci_dt)␊ |
14 | {␊ |
15 | ␉bool do_eth_devprop, do_enable_hpet;␊ |
16 | ␉pci_dt_t *current = pci_dt;␊ |
17 | ␊ |
18 | ␉do_eth_devprop = do_enable_hpet = false;␊ |
19 | ␊ |
20 | ␉getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);␊ |
21 | ␉getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);␊ |
22 | ␊ |
23 | ␉while (current)␊ |
24 | ␉{␊ |
25 | ␉␉switch (current->class_id)␊ |
26 | ␉␉{␊ |
27 | ␉␉␉case PCI_CLASS_BRIDGE_HOST:␊ |
28 | ␉␉␉␉␉dram_controller_dev = current;␊ |
29 | ␉␉␉␉break;␊ |
30 | ␉␉␉␉␊ |
31 | ␉␉␉case PCI_CLASS_NETWORK_ETHERNET: ␊ |
32 | ␉␉␉␉if (do_eth_devprop)␊ |
33 | ␉␉␉␉␉set_eth_builtin(current);␊ |
34 | ␉␉␉␉break;␊ |
35 | ␉␉␉␉␊ |
36 | ␉␉␉case PCI_CLASS_DISPLAY_VGA:␊ |
37 | ␉␉␉␉execute_hook("GraphicsEnabler", current, NULL, NULL, NULL);␊ |
38 | ␉␉␉␉break;␊ |
39 | ␊ |
40 | ␉␉␉case PCI_CLASS_SERIAL_USB:␊ |
41 | ␉␉␉␉notify_usb_dev(current);␊ |
42 | ␉␉␉␉break;␊ |
43 | ␊ |
44 | ␉␉␉case PCI_CLASS_BRIDGE_ISA:␊ |
45 | ␉␉␉␉if (do_enable_hpet)␊ |
46 | ␉␉␉␉␉force_enable_hpet(current);␊ |
47 | ␉␉␉␉break;␊ |
48 | ␉␉}␊ |
49 | ␉␉␊ |
50 | ␉␉setup_pci_devs(current->children);␊ |
51 | ␉␉current = current->next;␊ |
52 | ␉}␊ |
53 | }␊ |
54 |