Chameleon

Chameleon Commit Details

Date:2015-03-05 21:23:55 (9 years 1 month ago)
Author:ErmaC
Commit:2593
Parents: 2592
Message:Typo.
Changes:
M/trunk/i386/modules/Keylayout/Keylayout.c
M/trunk/i386/libsaio/convert.h
M/trunk/i386/libsaio/spd.c
M/trunk/i386/boot2/gui.c
M/trunk/i386/modules/Keylayout/layouts/cham-mklayout.c
M/trunk/i386/modules/AcpiCodec/acpi_codec.c
M/trunk/i386/libsaio/disk.c
M/trunk/i386/boot2/modules.c
M/trunk/i386/libsaio/saio_internal.h
M/trunk/i386/libsaio/fake_efi.h
M/trunk/i386/libsaio/convert.c
M/trunk/i386/libsaio/device_inject.h
M/trunk/i386/libsaio/hfs.c
M/trunk/i386/libsaio/xml.c

File differences

trunk/i386/libsaio/fake_efi.h
2929
3030
3131
32
32
3333
3434
3535
#define __LIBSAIO_FAKE_EFI_H
/* Set up space for up to 10 configuration table entries */
#define MAX_CONFIGURATION_TABLE_ENTRIES 10
#define MAX_CONFIGURATION_TABLE_ENTRIES (uint32_t)10
extern void setupFakeEfi(void);
trunk/i386/libsaio/xml.c
6464
6565
6666
67
67
6868
6969
7070
tmp = tmp->next;
}
//verbose("Unable to locate Ref String %d\n", id);
return "";
return "Unknown";
}
struct Module {
trunk/i386/libsaio/hfs.c
10001000
10011001
10021002
1003
1003
10041004
10051005
10061006
}
// Return error if the file was not found.
if (result != 0)
if (result != 0 || !recordData)
{
free(nodeBuf);
return -1;
trunk/i386/libsaio/spd.c
126126
127127
128128
129
129
130130
131131
132132
......
232232
233233
234234
235
235
236236
237237
238238
......
296296
297297
298298
299
299
300300
301301
302302
#define READ_SPD(spd, base, slot, x) spd[x] = smb_read_byte_intel(base, 0x50 + slot, x)
/** Read from spd *used* values only*/
static void init_spd(char * spd, uint32_t base, int slot)
static void init_spd(char *spd, uint32_t base, int slot)
{
int i;
for (i = 0; i < SPD_INDEXES_SIZE; i++)
#define SLST(a) ((uint8_t)(spd[a] & 0x0f))
/* Get DDR3 or DDR2 serial number, 0 most of the times, always return a valid ptr */
const char *getDDRSerial(const char* spd)
const char *getDDRSerial(const char *spd)
{
static char asciiSerial[17];
inti, speed;
uint8_tspd_size, spd_type;
uint32_tbase, mmio, hostc;
uint16_tcmd;// Command
uint16_tcmd;
//booldump = false;
RamSlotInfo_t*slot;
trunk/i386/libsaio/device_inject.h
5252
5353
5454
55
55
5656
5757
5858
// ------------------------
uint8_t num_pci_devpaths;
struct DevPropString *string;
// ------------------------
// ------------------------
};
typedef struct DevPropDevice DevPropDevice;
trunk/i386/libsaio/disk.c
844844
845845
846846
847
847
848848
849849
850850
// same as Apple ZFS
//EFI_GUID const GPT_ZFS_GUID= { 0x6A898CC3, 0x1DD2, 0x11B2, { 0x99, 0xA6, 0x08, 0x00, 0x20, 0x73, 0x66, 0x31 } }; // 0xBF01 "Solaris /usr & Apple ZFS
BVRef newGPTBVRef( int biosdev,
static BVRef newGPTBVRef( int biosdev,
int partno,
unsigned int blkoff,
const gpt_ent *part,
trunk/i386/libsaio/convert.c
88
99
1010
11
11
1212
1313
1414
......
2121
2222
2323
24
25
24
25
2626
2727
2828
......
100100
101101
102102
103
104
105
106
107
108
103109
104110
105111
......
119125
120126
121127
122
128
123129
124130
125131
......
149155
150156
151157
152
158
153159
154160
155161
......
165171
166172
167173
168
174
169175
170176
#include "convert.h"
/** Transform a 16 bytes hexadecimal value UUID to a string */
const char * getStringFromUUID(const EFI_CHAR8* eUUID)
const char *getStringFromUUID(const EFI_CHAR8 *eUUID)
{
static char msg[UUID_LEN*2 + 8] = "";
if (!eUUID) return "";
return msg ;
}
/** Parse an UUID string into an (EFI_CHAR8*) buffer */
EFI_CHAR8* getUUIDFromString(const char *source)
/** Parse an UUID string into an (EFI_CHAR8 *) buffer */
EFI_CHAR8 *getUUIDFromString(const char *source)
{
if (!source)
{
{
// the resulting binary will be the half size of the input hex string
binStr = malloc(len / 2);
if (!binStr)
{
*outLength = 0;
return NULL;
}
bzero(binStr,len / 2 );
binStrIdx = 0;
hexNibbleIdx = 0;
{
binChar = 0;
for (hexNibbleIdx = 0; hexNibbleIdx < sizeof(hexByte); hexNibbleIdx++)
for (hexNibbleIdx = 0; (unsigned)hexNibbleIdx < sizeof(hexByte); hexNibbleIdx++)
{
if (hexNibbleIdx > 0)
{
// FIXME: can't use my original code here,
// Ironically, trying to reuse convertHexStr2Binary() would RESET the system!
/*
static EFI_CHAR8* getUUIDFromString2(const char * szInUUID)
static EFI_CHAR8 *getUUIDFromString2(const char * szInUUID)
{
char szUUID[UUID_LEN+1], *p=szUUID;
int size=0;
verbose("UUID: cannot convert string <%s> to valid UUID.\n", szUUID);
return (EFI_CHAR8*) 0;
}
return (EFI_CHAR8*) ret; // new allocated buffer containing the converted string to bin
return (EFI_CHAR8 *) ret; // new allocated buffer containing the converted string to bin
}
*/
trunk/i386/libsaio/convert.h
1111
1212
1313
14
15
16
17
14
15
16
17
1818
1919
2020
#define UUID_LEN16
const char * getStringFromUUID(const EFI_CHAR8* uuid);
EFI_CHAR8* getUUIDFromString(const char *source);
void *convertHexStr2Binary(const char *hexStr, int *outLength);
uint32_t ascii_hex_to_int(char *buff);
const char*getStringFromUUID(const EFI_CHAR8* uuid);
EFI_CHAR8*getUUIDFromString(const char *source);
void*convertHexStr2Binary(const char *hexStr, int *outLength);
uint32_tascii_hex_to_int(char *buff);
static inline uint16_t dp_swap16(uint16_t toswap)
{
trunk/i386/libsaio/saio_internal.h
134134
135135
136136
137
137
138138
139139
140140
/* memory.c */
long AllocateKernelMemory( long inSize );
long AllocateMemoryRange(char * rangeName, long start, long length, long type);
long AllocateMemoryRange(char *rangeName, long start, long length, long type);
/* misc.c */
extern void enableA20(void);
trunk/i386/boot2/modules.c
10691069
10701070
10711071
1072
10731072
10741073
10751074
......
11061105
11071106
11081107
1109
1110
11111108
11121109
11131110
return 0;
}
/*
*execute_hook( const char* name )
*name - Name of the module hook
}
}
/*
*register_hook_callback( const char* name, void(*callback)())
*name - Name of the module hook to attach to.
trunk/i386/boot2/gui.c
538538
539539
540540
541
541
542542
543543
544544
......
547547
548548
549549
550
550
551551
552552
553553
......
564564
565565
566566
567
567
568568
569569
570570
......
573573
574574
575575
576
576
577577
578578
579579
......
935935
936936
937937
938
938
939939
940940
941941
......
10001000
10011001
10021002
1003
1003
10041004
10051005
10061006
gui.backbuffer = malloc(sizeof(pixmap_t));
if(!gui.backbuffer)
{
//DBG("Unable to allocate memory for gui.backbuffer");
DBG("Unable to allocate memory for gui.backbuffer");
return 1;
}
{
free(gui.backbuffer);
gui.backbuffer = 0;
//DBG("Unable to allocate memory for gui.backbuffer->pixels");
DBG("Unable to allocate memory for gui.backbuffer->pixels");
return 1;
}
window->pixmap = malloc(sizeof(pixmap_t));
if(!window->pixmap)
{
//DBG("Unable to allocate memory for window->pixmap");
DBG("Unable to allocate memory for window->pixmap");
return 1;
}
{
free(window->pixmap);
window->pixmap = 0;
//DBG("Unable to allocate memory for window->pixmap->pixels");
DBG("Unable to allocate memory for window->pixmap->pixels");
return 1;
}
}
#else
//DBG("Unable to load %s theme plist.\n",theme_name);
DBG("Unable to load %s theme plist.\n",theme_name);
return 1;
DBG("Loading error occurred, reseting...\n",theme_name);
// not available memory, freeing resources
// Loading error occurred, freeing resources
freeWindowBuffer(&gui.menu);
freeWindowBuffer(&gui.infobox);
freeWindowBuffer(&gui.bootprompt);
trunk/i386/modules/Keylayout/layouts/cham-mklayout.c
365365
366366
367367
368
369
370
368
369
370
371371
372372
373373
struct keyboard_layout* new_layout = create_keylayout(in);
if (new_layout) {
write_layout(new_layout, out);
free(new_layout);
new_layout = NULL;
}
free(new_layout);
new_layout = NULL;
}
fclose(out);
fclose(in);
trunk/i386/modules/Keylayout/Keylayout.c
145145
146146
147147
148
149
148
150149
151150
152151
if (!load_keyboard_layout_file(layoutPath))
{
DBG("Can't load %s keyboard layout file. Keylayout will not be used !\n",
layoutPath);
DBG("Can't load %s keyboard layout file. Keylayout will not be used !\n", layoutPath);
sleep(2);
}
else if (!replace_function("_getchar", &getchar_replacement))
trunk/i386/modules/AcpiCodec/acpi_codec.c
10051005
10061006
10071007
1008
1008
10091009
10101010
10111011
10121012
10131013
10141014
1015
1016
1015
1016
1017
10171018
10181019
10191020
10201021
1021
1022
1022
1023
10231024
10241025
10251026
......
10271028
10281029
10291030
1030
1031
10311032
10321033
10331034
1034
1035
1035
1036
10361037
10371038
10381039
10391040
10401041
1041
1042
10421043
10431044
10441045
......
10551056
10561057
10571058
1058
1059
10591060
1060
1061
1062
10611063
10621064
10631065
10641066
1065
1067
10661068
1067
1069
10681070
10691071
10701072
......
10771079
10781080
10791081
1080
1082
10811083
10821084
1083
1085
10841086
10851087
10861088
10871089
1088
1090
10891091
10901092
10911093
10921094
10931095
10941096
1095
1097
10961098
1097
1099
10981100
1099
1101
11001102
11011103
11021104
......
11041106
11051107
11061108
1107
1109
11081110
11091111
11101112
......
11181120
11191121
11201122
1121
1123
11221124
11231125
11241126
......
11311133
11321134
11331135
1134
1136
11351137
11361138
11371139
11381140
11391141
11401142
1141
1143
11421144
11431145
11441146
11451147
1146
1148
11471149
11481150
11491151
1150
11511152
1152
1153
1154
11531155
11541156
11551157
......
11661168
11671169
11681170
1169
1171
11701172
1173
1174
11711175
1172
1173
11741176
11751177
11761178
......
11781180
11791181
11801182
1181
1183
11821184
1183
1185
11841186
11851187
11861188
11871189
11881190
11891191
1190
1192
11911193
11921194
11931195
1194
1196
11951197
11961198
1197
1199
11981200
11991201
1200
1202
12011203
1202
1203
1204
12041205
12051206
12061207
......
13111312
13121313
13131314
1314
13151315
13161316
1317
1318
1319
1320
1321
1322
1317
1318
13231319
1320
1321
1322
1323
13241324
13251325
1326
1326
13271327
13281328
13291329
boolean_tfine_grain_clock_mod = 0;
#if BUILD_ACPI_TSS || pstate_power_support
if (Platform.CPU.CPUID[CPUID_0][0] >= 0x5) {
if (Platform.CPU.CPUID[CPUID_0][0] >= 0x5) {
/*
* Extract the Monitor/Mwait Leaf info:
*/
sub_Cstates = Platform.CPU.CPUID[CPUID_5][3];
extensions = Platform.CPU.CPUID[CPUID_5][2];
}
if (Platform.CPU.CPUID[CPUID_0][0] >= 6) {
if (Platform.CPU.CPUID[CPUID_0][0] >= 6)
{
dynamic_acceleration = bitfield(Platform.CPU.CPUID[CPUID_6][0], 1, 1); // "Dynamic Acceleration Technology (Turbo Mode)"
invariant_APIC_timer = bitfield(Platform.CPU.CPUID[CPUID_6][0], 2, 2); // "Invariant APIC Timer"
fine_grain_clock_mod = bitfield(Platform.CPU.CPUID[CPUID_6][0], 4, 4);
}
cpu->turbo_available = (U32)dynamic_acceleration;
cpu->turbo_available = (U32)dynamic_acceleration;
{
U32 temp32 = 0;
U64 temp64= 0;
if (getIntForKey("TDP", &tdp, &bootInfo->chameleonConfig))
{
temp32 = (U32) (tdp*8) ;
int tdc;
if (getIntForKey("TDC", &tdc, &bootInfo->chameleonConfig))
{
temp32 = (U32) (temp32) | tdc<<16 ;
temp32 = (U32) (temp32) | tdc<<16 ;
}
else if (tdp)
{
temp32 = (U32) (temp32) | ((tdp)*8)<<16 ;
}
}
else if (!is_sandybridge() && !is_jaketown())
{
// in your boot.plist
temp32 = (U32)0x02a802f8;
}
}
if (temp32) {
if (temp32)
{
cpu->tdp_limit = ( temp32 & 0x7fff );
cpu->tdc_limit = ( (temp32 >> 16) & 0x7fff );
}
}
#endif
switch (Platform.CPU.Family)
{
case 0x06:
case CPUID_MODEL_PENRYN: // Penryn
case CPUID_MODEL_ATOM: // Intel Atom (45nm)
{
cpu->core_c1_supported = ((sub_Cstates >> 4) & 0xf) ? 1 : 0;
cpu->core_c4_supported = ((sub_Cstates >> 16) & 0xf) ? 1 : 0;
if (Platform.CPU.Model == CPUID_MODEL_ATOM)
{
cpu->core_c2_supported = cpu->core_c3_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0;
cpu->core_c6_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0;
}
else
{
cpu->core_c3_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0;
cpu->core_c2_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0;
cpu->core_c6_supported = 0;
}
cpu->core_c7_supported = 0;
#if BETA
GetMaxRatio(&cpu->max_ratio_as_mfg);
U64 msr = rdmsr64(MSR_IA32_PERF_STATUS);
U16 idhi = (msr >> 32) & 0xffff;
cpu->min_ratio = (U32) (idlo >> 8) & 0xff;
cpu->max_ratio_as_cfg = (U32) (idhi >> 8) & 0xff;
#else
if (Platform.CPU.MaxCoef)
{
}
}
#endif
break;
}
case CPUID_MODEL_FIELDS:
case CPUID_MODEL_SANDYBRIDGE:
case CPUID_MODEL_JAKETOWN:
{
cpu->core_c1_supported = ((sub_Cstates >> 4) & 0xf) ? 1 : 0;
cpu->core_c3_supported = ((sub_Cstates >> 8) & 0xf) ? 1 : 0;
cpu->core_c6_supported = ((sub_Cstates >> 12) & 0xf) ? 1 : 0;
cpu->core_c7_supported = ((sub_Cstates >> 16) & 0xf) ? 1 : 0;
cpu->core_c2_supported = 0;
cpu->core_c4_supported = 0;
GetMaxRatio(&cpu->max_ratio_as_mfg);
U64 platform_info = rdmsr64(MSR_PLATFORM_INFO);
cpu->max_ratio_as_cfg = (U32) ((U32)platform_info >> 8) & 0xff;
cpu->min_ratio = (U32) ((platform_info >> 40) & 0xff);
cpu->tdc_tdp_limits_for_turbo_flag = (platform_info & (1ULL << 29)) ? 1 : 0;
cpu->ratio_limits_for_turbo_flag = (platform_info & (1ULL << 28)) ? 1 : 0;
cpu->xe_available = cpu->tdc_tdp_limits_for_turbo_flag | cpu->ratio_limits_for_turbo_flag;
if (is_sandybridge() || is_jaketown())
{
cpu->package_power_limit = rdmsr64(MSR_PKG_RAPL_POWER_LIMIT);
default:
break;
}
cpu->mwait_supported = (extensions & (1UL << 0)) ? 1 : 0;
cpu->invariant_apic_timer_flag = (U32)invariant_APIC_timer;
cpu->invariant_apic_timer_flag = (U32)invariant_APIC_timer;
#if DEBUG_ACPI
printf("CPU INFO : \n");
#if BETA
#endif
printf("max_ratio_as_cfg : %d\n", cpu->max_ratio_as_cfg);
printf("max_ratio_as_mfg : %d\n", cpu->max_ratio_as_mfg);
printf("turbo_available : %d\n",cpu->turbo_available);
printf("core_c1_supported : %d\n",cpu->core_c1_supported);
printf("core_c2_supported : %d\n",cpu->core_c1_supported);
printf("core_c3_supported : %d\n",cpu->core_c3_supported);
printf("core_c6_supported : %d\n",cpu->core_c6_supported);
printf("core_c7_supported : %d\n",cpu->core_c7_supported);
printf("mwait_supported : %d\n",cpu->mwait_supported);
#if BUILD_ACPI_TSS || pstate_power_support
if (is_sandybridge() || is_jaketown())
{
printf("package_power_limit : %d\n",cpu->package_power_limit);
printf("package_power_sku_unit : %d\n",cpu->package_power_sku_unit);
}
#endif
DBG("invariant_apic_timer_flag : %d\n",cpu->invariant_apic_timer_flag);
#endif
}
//-----------------------------------------------------------------------------
static U32 BuildPstateInfo(CPU_DETAILS * cpu)
{
struct p_state p_states[32];
U8 p_states_count = 0;
if (!cpu)
{
return (0);
}
if (!cpu)
{
return (0);
}
{
#if UNUSED
struct p_state initial;
#endif
#endif
struct p_state maximum, minimum;
// Retrieving P-States, ported from code by superhai (c)
switch (Platform.CPU.Family)

Archive Download the corresponding diff file

Revision: 2593