Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/libsaio/device_inject.h

Source at commit 406 created 13 years 10 months ago.
By azimutz, Consolidating this position: while testing the new theme and boot-log function, i realized that when it comes to verbose boot, using the -v flag on Boot.plist (or typed at boot prompt) and using the Menu (Boot Verbose), doesn't produce the exact same output; using the Menu displays all the messages, while typing -v causes some of the first messages to disappear. So, moving this to an early stage isn't anymore a question of what is printed to screen or not! Tests also showed another diff: when using -v flag typed, the Boot Banner is cleared and messages start to print right away, while using Boot Verbose on the Menu, keeps the Banner, prints the first 2 or 3 messages right below it and the rest are only printed, when this code runs and does it's thing. Moving the code to this position fixes this glitch.
1/*
2 *Copyright 2009 Jasmin Fazlic All rights reserved.
3 */
4/*
5 *Cleaned and merged by iNDi
6 */
7
8#ifndef __LIBSAIO_DEVICE_INJECT_H
9#define __LIBSAIO_DEVICE_INJECT_H
10
11#define DP_ADD_TEMP_VAL(dev, val) devprop_add_value(dev, (char*)val[0], (uint8_t*)val[1], strlen(val[1]) + 1)
12#define DP_ADD_TEMP_VAL_DATA(dev, val) devprop_add_value(dev, (char*)val.name, (uint8_t*)val.data, val.size)
13#define MAX_PCI_DEV_PATHS 4
14
15extern struct DevPropString *string;
16extern uint8_t *stringdata;
17extern uint32_t stringlength;
18
19extern void setupDeviceProperties(Node *node);
20
21struct ACPIDevPath {
22uint8_ttype;// = 2 ACPI device-path
23uint8_tsubtype;// = 1 ACPI Device-path
24uint16_tlength;// = 0x0c
25uint32_t_HID;// = 0xD041030A ?
26uint32_t_UID;// = 0x00000000 PCI ROOT
27};
28
29struct PCIDevPath {
30uint8_ttype;// = 1 Hardware device-path
31uint8_tsubtype;// = 1 PCI
32uint16_tlength;// = 6
33uint8_tfunction;// pci func number
34uint8_tdevice;// pci dev number
35};
36
37struct DevicePathEnd {
38uint8_ttype;// = 0x7f
39uint8_tsubtype;// = 0xff
40uint16_tlength;// = 4;
41};
42
43struct DevPropDevice {
44uint32_t length;
45uint16_t numentries;
46uint16_t WHAT2;// 0x0000 ?
47struct ACPIDevPath acpi_dev_path;// = 0x02010c00 0xd041030a
48struct PCIDevPath pci_dev_path[MAX_PCI_DEV_PATHS]; // = 0x01010600 func dev
49struct DevicePathEnd path_end;// = 0x7fff0400
50uint8_t *data;
51
52// ------------------------
53uint8_t num_pci_devpaths;
54struct DevPropString *string;
55// ------------------------
56};
57
58struct DevPropString {
59uint32_t length;
60uint32_t WHAT2;// 0x01000000 ?
61uint16_t numentries;
62uint16_t WHAT3;// 0x0000 ?
63struct DevPropDevice **entries;
64};
65
66char*efi_inject_get_devprop_string(uint32_t *len);
67intdevprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id);
68struct DevPropString*devprop_create_string(void);
69struct DevPropDevice*devprop_add_device(struct DevPropString *string, char *path);
70intdevprop_add_value(struct DevPropDevice *device, char *nm, uint8_t *vl, uint32_t len);
71char*devprop_generate_string(struct DevPropString *string);
72voiddevprop_free_string(struct DevPropString *string);
73
74#endif /* !__LIBSAIO_DEVICE_INJECT_H */
75

Archive Download this file

Revision: 406