Chameleon

Chameleon Commit Details

Date:2010-05-21 16:04:28 (13 years 11 months ago)
Author:Tamás Kosárszky
Commit:157
Parents: 156
Message:DSDT option overrides the default file lookup behaviour. Reverted back boot0/boot1h to print verbose messages.
Changes:
M/trunk/i386/boot0/boot0.s
M/trunk/i386/libsaio/dsdt_patcher.c
M/trunk/i386/boot1/boot1.s

File differences

trunk/i386/libsaio/dsdt_patcher.c
7575
7676
7777
78
79
80
81
82
78
79
80
81
8382
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
83
84
85
86
87
88
11389
114
115
116
117
118
90
91
92
93
94
95
96
97
98
99
100
101
119102
120
121
122
103
104
105
106
123107
124
125
126
127
128
129
130
131
132108
133
109
110
134111
135
136112
113
137114
138115
139
140116
141117
142118
......
168144
169145
170146
171
172147
173148
174149
/** The folowing ACPI Table search algo. should be reused anywhere needed:*/
int search_and_get_acpi_fd(const char * filename, const char ** outDirspec)
{
int fd=0;
const char * overriden_pathname=NULL;
static char dirspec[512]="";
static bool first_time =true;
int len=0;
int fd = 0;
const char * override_name = NULL;
static char dirspec[512] = "";
int len = 0;
/// Take in accound user overriding if it's DSDT only
if (strstr(filename, "DSDT") &&
getValueForKey(kDSDT, &overriden_pathname, &len,
&bootInfo->bootConfig))
{
sprintf(dirspec, "%s", overriden_pathname);
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
}
// Check that dirspec is not already assigned with a path
if (!first_time && *dirspec)
{ // it is so start searching this cached patch first
//extract path
for (len=strlen(dirspec)-1; len; len--)
if (dirspec[len]=='/' || len==0)
{
dirspec[len]='\0';
break;
}
// now concat with the filename
strncat(dirspec, "/", sizeof(dirspec));
strncat(dirspec, filename, sizeof(dirspec));
// and test to see if we don't have our big boy here:
fd=open (dirspec,0);
if (fd>=0)
{
// printf("ACPI file search cache hit: file found at %s\n", dirspec);
goto success_fd;
}
// Try using the file specified with the DSDT option
if (getValueForKey(kDSDT, &override_name, &len, &bootInfo->bootConfig))
{
sprintf(dirspec, "%s", override_name);
fd = open(dirspec, 0);
if (fd >= 0) goto success_fd;
}
// Start searching any potential location for ACPI Table
// search the Extra folders first
sprintf(dirspec,"/Extra/%s",filename);
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
// Try finding 'filename' in the usual places
else
{
// Start searching any potential location for ACPI Table
// search the Extra folders first
sprintf(dirspec, "/Extra/%s", filename);
fd = open(dirspec, 0);
if (fd >= 0) goto success_fd;
sprintf(dirspec, "/%s", filename); // search root
fd = open(dirspec, 0);
if (fd >= 0) goto success_fd;
sprintf(dirspec,"bt(0,0)/Extra/%s",filename);
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
sprintf(dirspec, "bt(0,0)/Extra/%s", filename);
fd = open(dirspec, 0);
if (fd >= 0) goto success_fd;
}
sprintf(dirspec, "%s", filename); // search current dir
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
sprintf(dirspec, "/%s", filename); // search root
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
// NOT FOUND:
verbose("ACPI Table not found: %s\n", filename);
verbose("ACPI Table not found\n");
if (outDirspec) *outDirspec = "";
first_time = false;
return -1;
// FOUND
success_fd:
first_time = false;
if (outDirspec) *outDirspec = dirspec;
return fd;
}
close (fd);
printf("Couldn't allocate memory for table \n", dirspec);
}
printf("Couldn't find table %s\n", filename);
return NULL;
}
trunk/i386/boot0/boot0.s
5555
5656
5757
58
58
5959
6060
6161
;
; Set to 1 to enable verbose mode
;
VERBOSEEQU 0
VERBOSEEQU 1
;
; Various constants.
trunk/i386/boot1/boot1.s
5252
5353
5454
55
55
5656
5757
5858
;
; Set to 1 to enable verbose mode.
;
VERBOSEEQU0
VERBOSEEQU1
;
; Various constants.

Archive Download the corresponding diff file

Revision: 157