Chameleon

Chameleon Commit Details

Date:2010-02-16 22:22:22 (9 years 7 months ago)
Author:Rekursor
Commit:80
Parents: 79
Message:Implemented acpi search path caching and reordered the search dirs to match from the most common (Extra dirs) to the least common. Should gain even more perf when custom acpi loading algos will be in place. Reset debug pci flag to 0. changed the version to pre9,not released yet.
Changes:
M/trunk/i386/libsaio/dsdt_patcher.c
M/trunk/version
M/trunk/i386/libsaio/pci.c

File differences

trunk/version
1
1
2.0-RC5pre7
2.0-RC5pre9
trunk/i386/libsaio/dsdt_patcher.c
7878
7979
8080
81
8182
8283
8384
......
8586
8687
8788
88
89
8990
9091
9192
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
93114
94
115
116
95117
96118
97119
98
120
99121
100122
101123
102
124
103125
104126
105127
106
128
107129
108130
109131
110132
111133
112134
135
113136
114137
115138
139
116140
117141
118142
int fd=0;
const char * overriden_pathname=NULL;
static char dirspec[512]="";
static bool first_time =true;
int len=0;
/// Take in accound user overriding if it's DSDT only
getValueForKey(kDSDT, &overriden_pathname, &len,
&bootInfo->bootConfig))
{
sprintf(dirspec, "%s", overriden_pathname); // start searching root
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;
}
}
// Start searching any potential location for ACPI Table
sprintf(dirspec, "/%s", filename); // start searching root
// search the Extra folders first
sprintf(dirspec,"/Extra/%s",filename);
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
sprintf(dirspec, "%s", filename); // start current dir
sprintf(dirspec,"bt(0,0)/Extra/%s",filename);
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
sprintf(dirspec,"/Extra/%s",filename);
sprintf(dirspec, "%s", filename); // search current dir
fd=open (dirspec,0);
if (fd>=0) goto success_fd;
sprintf(dirspec,"bt(0,0)/Extra/%s",filename);
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);
if (outDirspec) *outDirspec = "";
first_time = false;
return -1;
// FOUND
success_fd:
first_time = false;
if (outDirspec) *outDirspec = dirspec;
return fd;
}
trunk/i386/libsaio/pci.c
1010
1111
1212
13
13
1414
1515
1616
#include "pci_root.h"
#ifndef DEBUG_PCI
#define DEBUG_PCI 1
#define DEBUG_PCI 0
#endif
#if DEBUG_PCI

Archive Download the corresponding diff file

Revision: 80