Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/libsaio/pci_setup.c

Source at commit 519 created 13 years 7 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
7extern void set_eth_builtin(pci_dt_t *eth_dev);
8extern void notify_usb_dev(pci_dt_t *pci_dev);
9extern void force_enable_hpet(pci_dt_t *lpc_dev);
10
11extern pci_dt_t *dram_controller_dev;
12
13void setup_pci_devs(pci_dt_t *pci_dt)
14{
15bool do_eth_devprop, do_enable_hpet;
16pci_dt_t *current = pci_dt;
17
18do_eth_devprop = do_enable_hpet = false;
19
20getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
21getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
22
23while (current)
24{
25switch (current->class_id)
26{
27case PCI_CLASS_BRIDGE_HOST:
28dram_controller_dev = current;
29break;
30
31case PCI_CLASS_NETWORK_ETHERNET:
32if (do_eth_devprop)
33set_eth_builtin(current);
34break;
35
36case PCI_CLASS_DISPLAY_VGA:
37execute_hook("GraphicsEnabler", current, NULL, NULL, NULL);
38break;
39
40case PCI_CLASS_SERIAL_USB:
41notify_usb_dev(current);
42break;
43
44case PCI_CLASS_BRIDGE_ISA:
45if (do_enable_hpet)
46force_enable_hpet(current);
47break;
48}
49
50setup_pci_devs(current->children);
51current = current->next;
52}
53}
54

Archive Download this file

Revision: 519