Chameleon

Chameleon Commit Details

Date:2015-03-13 12:54:57 (9 years 1 month ago)
Author:zenith432
Commit:2629
Parents: 2628
Message:Sync with trunk (r.2628)
Changes:
M/branches/zenith432/i386/libsaio/table.c
M/branches/zenith432/i386/boot2/gui.c
M/branches/zenith432/i386/libsaio/cpu.c
M/branches/zenith432/i386/libsaio/disk.c
M/branches/zenith432/i386/libsaio/misc.c
M/branches/zenith432/i386/libsaio/device_inject.c
M/branches/zenith432/i386/boot2/options.c
M/branches/zenith432/i386/libsaio/xml.c
M/branches/zenith432/i386/modules/Keylayout/Keylayout.c
M/branches/zenith432/i386/libsaio/gma.c
M/branches/zenith432
M/branches/zenith432/i386/boot2/boot.c
M/branches/zenith432/i386/libsa/libsa.h
M/branches/zenith432/i386/util/machOconv.c
M/branches/zenith432/i386/libsaio/bootstruct.c
M/branches/zenith432/i386/libsaio/gma.h
M/branches/zenith432/i386/modules/AcpiCodec/acpi_codec.c
M/branches/zenith432/i386/libsaio/nvidia.c
M/branches/zenith432/i386/boot2/boot.h
M/branches/zenith432/CHANGES
M/branches/zenith432/i386/libsaio/ati.c
M/branches/zenith432/i386/libsaio/device_tree.c
M/branches/zenith432/i386/libsa/string.c
M/branches/zenith432/i386/libsaio/sys.c
M/branches/zenith432/i386/libsaio/load.c
M/branches/zenith432/i386/libsaio/nbp.c
M/branches/zenith432/i386/libsaio/convert.c
M/branches/zenith432/i386/boot2/drivers.c
M/branches/zenith432/i386/libsaio/ati.h

File differences

branches/zenith432/i386/libsaio/xml.c
4141
4242
4343
44
44
4545
4646
4747
4848
4949
50
50
5151
52
52
5353
5454
5555
......
133133
134134
135135
136
136
137137
138138
139139
......
152152
153153
154154
155
155
156156
157157
158158
......
255255
256256
257257
258
258
259
260
261
262
259263
260
261
262
263
264
265
266
264
267265
268
269
270
271
272
273
274
266
267
268
269
270
271
272
273
275274
275
276
277
276278
277279
278280
......
372374
373375
374376
377
375378
376
377
378
379379
380380
381381
......
390390
391391
392392
393
393
394394
395395
396396
......
403403
404404
405405
406
406
407407
408408
409409
410410
411411
412
412
413413
414414
415415
......
478478
479479
480480
481
481
482482
483483
484484
......
533533
534534
535535
536
537
538
539
540
536541
537542
538543
......
552557
553558
554559
555
560
556561
557562
558563
559564
560565
561
566
562567
563568
564569
......
570575
571576
572577
573
578
574579
575580
576581
......
578583
579584
580585
581
586
587
582588
583589
584590
......
587593
588594
589595
590
591
596
597
598
592599
593600
594601
......
596603
597604
598605
599
606
600607
601608
602609
......
605612
606613
607614
608
615
609616
610617
611618
......
624631
625632
626633
627
634
628635
629636
630637
......
641648
642649
643650
644
651
645652
646653
647654
......
657664
658665
659666
660
667
661668
662669
663670
......
698705
699706
700707
701
708
702709
703710
704711
705712
706713
707714
708
715
709716
710717
711718
......
738745
739746
740747
741
748
742749
743750
744751
745752
746753
747
754
748755
749756
750757
......
752759
753760
754761
755
756
762
763
757764
758765
759766
......
858865
859866
860867
861
868
862869
863
870
864871
865872
866873
......
884891
885892
886893
887
894
888895
889896
890897
......
897904
898905
899906
900
907
901908
902909
903
910
904911
905912
906913
......
922929
923930
924931
925
932
926933
927934
928935
......
931938
932939
933940
934
935
936
941
942
943
937944
938945
939946
......
949956
950957
951958
952
959
953960
954961
955962
956963
957964
958
959
960
965
966
967
961968
962969
970
963971
964972
965973
......
973981
974982
975983
976
984
977985
978986
979987
......
10521060
10531061
10541062
1055
1056
1063
10571064
10581065
10591066
10601067
10611068
1062
1069
10631070
10641071
1065
1072
10661073
1067
1074
10681075
10691076
10701077
......
10921099
10931100
10941101
1095
1102
10961103
10971104
10981105
......
11071114
11081115
11091116
1110
1111
1117
1118
11121119
11131120
11141121
......
11301137
11311138
11321139
1133
1140
11341141
11351142
11361143
......
11451152
11461153
11471154
1148
1155
11491156
11501157
1151
1152
1158
1159
11531160
11541161
11551162
......
11801187
11811188
11821189
1183
1190
11841191
11851192
11861193
1187
1194
11881195
11891196
11901197
......
11981205
11991206
12001207
1201
1208
12021209
12031210
12041211
......
12191226
12201227
12211228
1229
1230
1231
1232
1233
12221234
1223
1235
12241236
12251237
12261238
......
12331245
12341246
12351247
1236
1248
12371249
12381250
12391251
if(tmp->id == id)
{
tmp->string = malloc(strlen(string)+1);
sprintf(tmp->string, "%s", string);
snprintf(tmp->string, strlen(string)+1,"%s", string);
return;
}
tmp = tmp->next;
}
string_ref* new_ref = malloc(sizeof(string_ref));
string_ref *new_ref = malloc(sizeof(string_ref));
new_ref->string = malloc(strlen(string)+1);
sprintf(new_ref->string, "%s", string);
snprintf(new_ref->string, (strlen(string)+1)* sizeof(char),"%s", string);
new_ref->id = id;
new_ref->next = ref_strings;
ref_strings = new_ref;
if (dict->type != kTagTypeDict)
{
return 0;
return NULL;
}
tag = 0;
return tag->tag;
}
}
return 0;
return NULL;
}
//==========================================================================
return tmp;
}
/* Function for basic XML character entities parsing */
typedef const struct XMLEntity {
const char *name;
size_t nameLen;
char value;
} XMLEntity;
char *XMLDecode(const char* src)
{
typedef const struct XMLEntity {
const char *name;
size_t nameLen;
char value;
} XMLEntity;
/* This is ugly, but better than specifying the lengths by hand */
/* This is ugly, but better than specifying the lengths by hand */
#define _e(str,c) {str,sizeof(str)-1,c}
const XMLEntity ents[] = {
_e("quot;",'"'), _e("apos;",'\''),
_e("lt;", '<'), _e("gt;", '>'),
_e("amp;", '&')
};
#define _e(str,c) {str,sizeof(str)-1,c}
const XMLEntity ents[] = {
_e("quot;",'"'), // double quotation mark
_e("apos;",'\''), // ampersand
_e("lt;", '<'), // apostrophe (apostrophe-quote)
_e("gt;", '>'), // less-than sign
_e("amp;", '&') // greater-than sign
};
/* Function for basic XML character entities parsing */
char *XMLDecode(const char *src)
{
size_t len;
const char *s;
char *out, *o;
{
longlength = 0;
longpos = 0;
char*tagName = NULL;
char*tagName;
length = GetNextTag(buffer, &tagName, 0);
if (length == -1)
{
// return-via-reference tag should be left alone
}
/***** dict ****/
else if (!strcmp(tagName, kXMLTagDict))
else if (!strncmp(tagName, kXMLTagDict, sizeof(kXMLTagDict)))
{
length = ParseTagList(buffer + pos, tag, kTagTypeDict, 0);
}
length = ParseTagList(buffer + pos, tag, kTagTypeDict, 0);
}
/***** key ****/
else if (!strcmp(tagName, kXMLTagKey))
else if (!strncmp(tagName, kXMLTagKey, sizeof(kXMLTagKey)))
{
length = ParseTagKey(buffer + pos, tag);
}
/***** string ****/
else if (!strcmp(tagName, kXMLTagString))
else if (!strncmp(tagName, kXMLTagString, sizeof(kXMLTagString)))
{
length = ParseTagString(buffer + pos, tag);
}
}
/***** integer ****/
else if (!strcmp(tagName, kXMLTagInteger))
else if (!strncmp(tagName, kXMLTagInteger, sizeof(kXMLTagInteger)))
{
length = ParseTagInteger(buffer + pos, tag);
}
int integer = (int)GetRefString(id);
TagPtr tmpTag = NewTag();
if (tmpTag == 0)
{
return -1;
}
tmpTag->type = kTagTypeInteger;
tmpTag->string = (char*) integer;
tmpTag->tag = 0;
/***** false ****/
else if (!strcmp(tagName, kXMLTagFalse))
else if (!strncmp(tagName, kXMLTagFalse, sizeof(kXMLTagFalse)))
{
length = ParseTagBoolean(buffer + pos, tag, kTagTypeFalse);
}
/***** true ****/
else if (!strcmp(tagName, kXMLTagTrue))
else if (!strncmp(tagName, kXMLTagTrue, sizeof(kXMLTagTrue)))
{
length = ParseTagBoolean(buffer + pos, tag, kTagTypeTrue);
}
/***** data ****/
else if (!strcmp(tagName, kXMLTagData))
else if (!strncmp(tagName, kXMLTagData, sizeof(kXMLTagData)))
{
length = ParseTagData(buffer + pos, tag);
}
{
length = ParseTagData(buffer + pos, tag);
}
else if (!strcmp(tagName, kXMLTagDate))
else if (!strncmp(tagName, kXMLTagDate, sizeof(kXMLTagDate)))
{
length = ParseTagDate(buffer + pos, tag);
}
else if (!strncmp(tagName, kXMLTagDate " ", strlen(kXMLTagDate " ")))
{
length = ParseTagDate(buffer + pos, tag);
}/***** array ****/
else if (!strcmp(tagName, kXMLTagArray))
}
/***** array ****/
else if (!strncmp(tagName, kXMLTagArray, sizeof(kXMLTagArray) ))
{
length = ParseTagList(buffer + pos, tag, kTagTypeArray, 0);
}
{
length = ParseTagList(buffer + pos, tag, kTagTypeArray, 0);
}
else if (!strcmp(tagName, kXMLTagArray "/"))
else if (!strncmp(tagName, kXMLTagArray "/", strlen(kXMLTagArray "/")))
{
length = ParseTagList(buffer + pos, tag, kTagTypeArray, 1);
}
else
{
// it wasn't parsed so we consumed no additional characters
*tag = 0;
*tag = NULL;
length = 0;
}
{
longpos = 0;
longlength = 0;
TagPtrtagList = 0;
TagPtrtagList = NULL;
TagPtrtmpTag;
pos += length;
// detect end of list
if (tmpTag == 0)
if (tmpTag == NULL)
{
break;
}
}
tmpTag = NewTag();
if (tmpTag == 0)
if (tmpTag == NULL)
{
XMLFreeTag(tagList);
return -1;
}
tmpTag = NewTag();
if (tmpTag == 0)
if (tmpTag == NULL)
{
XMLFreeTag(subTag);
return -1;
}
string = NewSymbol(buffer);
if (string == 0)
if (string == NULL)
{
XMLFreeTag(subTag);
XMLFreeTag(tmpTag);
}
TagPtr tmpTag = NewTag();
if (tmpTag == 0)
if (tmpTag == NULL)
{
return -1;
}
string = NewSymbol(buffer);
if (string == 0)
if (string == NULL)
{
XMLFreeTag(tmpTag);
return -1;
tmpTag->type = kTagTypeString;
tmpTag->string = string;
tmpTag->tag = 0;
tmpTag->tagNext = 0;
tmpTag->tag = NULL;
tmpTag->tagNext = NULL;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
*tag = tmpTag;
tmpTag->type = kTagTypeInteger;
tmpTag->string = (char *)integer;
tmpTag->tag = 0;
tmpTag->tag = NULL;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
tmpTag->tagNext = NULL;
*tag = tmpTag;
}
tmpTag = NewTag();
if (tmpTag == 0)
if (tmpTag == NULL)
{
return -1;
}
tmpTag->type = kTagTypeData;
tmpTag->string = string;
tmpTag->tag = 0;
tmpTag->tag = NULL;
tmpTag->offset = actuallen; // buffer_start ? buffer - buffer_start: 0;
tmpTag->tagNext = 0;
tmpTag->tagNext = NULL;
*tag = tmpTag;
}
tmpTag = NewTag();
if (tmpTag == 0)
if (tmpTag == NULL)
{
return -1;
}
getchar();
tmpTag->type = kTagTypeDate;
tmpTag->string = 0;
tmpTag->tag = 0;
tmpTag->tagNext = 0;
tmpTag->string = NULL;
tmpTag->tag = NULL;
tmpTag->tagNext = NULL;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
*tag = tmpTag;
TagPtr tmpTag;
tmpTag = NewTag();
if (tmpTag == 0)
if (tmpTag == NULL)
{
return -1;
}
tmpTag->type = type;
tmpTag->string = 0;
tmpTag->tag = 0;
tmpTag->tagNext = 0;
tmpTag->string = NULL;
tmpTag->tag = NULL;
tmpTag->tagNext = NULL;
tmpTag->offset = buffer_start ? buffer - buffer_start: 0;
*tag = tmpTag;
return 0;
longcnt;
longcnt2;
if (tag == 0)
if (tag == NULL)
{
return -1;
}
#define kTagsPerBlock (0x1000)
static TagPtr gTagsFree;
static TagPtr gTagsFree= NULL;
static TagPtr NewTag( void )
{
longcnt;
TagPtrtag;
if (gTagsFree == 0)
if (gTagsFree == NULL)
{
tag = (TagPtr)malloc(kTagsPerBlock *sizeof(Tag));
if (tag == 0)
if (tag == NULL)
{
return 0;
return NULL;
}
// Initalize the new tags.
void XMLFreeTag( TagPtr tag )
{
#if DOFREE
if (tag == 0)
if (tag == NULL)
{
return;
}
// Clear and free the tag.
tag->type = kTagTypeNone;
tag->string = 0;
tag->tag = 0;
tag->string = NULL;
tag->tag = NULL;
tag->offset = 0;
tag->tagNext = gTagsFree;
gTagsFree = tag;
static SymbolPtr FindSymbol(char *string, SymbolPtr *prevSymbol);
static SymbolPtr gSymbolsHead;
static SymbolPtr gSymbolsHead= NULL;
//==========================================================================
// NewSymbol
symbol = FindSymbol(string, 0);
// Add the new symbol.
if (symbol == 0)
if (symbol == NULL)
{
symbol = (SymbolPtr)malloc(sizeof(Symbol) + 1 + strlen(string));
if (symbol == 0)
{//return 0;
if (symbol == NULL)
{
stop("NULL symbol!");
}
static void FreeSymbol( char *string )
{
SymbolPtr symbol, prev;
prev = 0;
prev = NULL;
// Look for string in the list of symbols.
symbol = FindSymbol(string, &prev);
if (symbol == 0)
if (symbol == NULL)
{
return;
}
}
// Remove the symbol from the list.
if (prev != 0)
if (prev != NULL)
{
prev->next = symbol->next;
}
{
SymbolPtr symbol, prev;
if (string == NULL)
{
return NULL;
}
symbol = gSymbolsHead;
prev = 0;
prev = NULL;
while (symbol != NULL)
{
symbol = symbol->next;
}
if ((symbol != 0) && (prevSymbol != 0))
if ((symbol != NULL) && (prevSymbol != NULL))
{
*prevSymbol = prev;
}
branches/zenith432/i386/libsaio/bootstruct.c
119119
120120
121121
122
122
123123
124
125
126
127
128
129
130
124131
125132
126133
127134
128135
129
130
131
132
133
134
135
136136
137137
138138
void reserveKernBootStruct(void)
{
if ( MacOSVerCurrent >= MacOSVer2Int("10.7") ) // OS X 10.7 and newer
if ( TIGER || LEOPARD || SNOW_LEOPARD )
{
// for 10.4 10.5 10.6
void *oldAddr = bootArgsPreLion;
bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion));
bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion));
}
else
{
// for 10.7 10.8 10.9 10.10
void *oldAddr = bootArgs;
bootArgs = (boot_args *)AllocateKernelMemory(sizeof(boot_args));
bcopy(oldAddr, bootArgs, sizeof(boot_args));
}
else
{
// for 10.4 10.5 10.6
void *oldAddr = bootArgsPreLion;
bootArgsPreLion = (boot_args_pre_lion *)AllocateKernelMemory(sizeof(boot_args_pre_lion));
bcopy(oldAddr, bootArgsPreLion, sizeof(boot_args_pre_lion));
}
}
//==============================================================================
branches/zenith432/i386/libsaio/device_tree.c
353353
354354
355355
356
357
358
359
360
356361
357362
358363
......
379384
380385
381386
382
387
383388
384389
385390
......
497502
498503
499504
500
505
501506
502507
503508
{
buf = *buffer_p;
}
if (!buf)
{
*length = 0;
return;
}
bzero(buf, totalSize);
for (prop = node->properties; prop; prop = prop->next)
{
//DPRINTF("Prop '%s'\n", prop->name);
if (strcmp(prop->name, "name") == 0)
if (strncmp(prop->name, "name", sizeof("name")) == 0)
{
return prop->value;
}
for (prop = node->properties; prop; prop = prop->next)
{
char c = *((char *)prop->value);
if (prop->length < 64 && (strcmp(prop->name, "name") == 0 || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'))
if (prop->length < 64 && (strncmp(prop->name, "name", sizeof("name") ) == 0 || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'))
{
printf("%s Property '%s' [%d] = '%s'\n", spaces, prop->name, prop->length, prop->value);
}
branches/zenith432/i386/libsaio/gma.c
272272
273273
274274
275
276
277
278
279
280
281
282
283
275
276
277
278
279
280
281
282
283
284284
285285
286286
287287
288288
289
289
290290
291
292
291
292
293293
294
295
296
297
298
299
300
301
294
295
296
297
298
299
300
301
302302
303
304
305
306
307
303
304
305
306
307
308308
309309
310
311
312
313
314
315
310
311
312
313
314
315
316316
317317
318318
319
319
320320
321321
322322
......
324324
325325
326326
327
328
329
330
331
327332
328
333
329334
335
330336
331337
332338
333339
334340
335
341
336342
337343
338
344
339345
340346
341
342
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
343376
344377
345378
......
676709
677710
678711
712
679713
680714
681715
// 010E /* ??? */
/* Ivy */
{GMA_IVYBRIDGE_M_GT1,HD_GRAPHICS_2500 },
{GMA_IVYBRIDGE_M_GT2,HD_GRAPHICS_4000 },
{GMA_IVYBRIDGE_D_GT1,HD_GRAPHICS_2500 },
{GMA_IVYBRIDGE_D_GT2,HD_GRAPHICS_4000 },
{GMA_IVYBRIDGE_S_GT1,HD_GRAPHICS },
{GMA_IVYBRIDGE_S_GT2,"HD Graphics P4000" },
{GMA_IVYBRIDGE_S_GT3, HD_GRAPHICS },// 015e
{GMA_IVYBRIDGE_S_GT4,HD_GRAPHICS_2500 },// 0172 /* HD Graphics 2500 Mobile */
{GMA_IVYBRIDGE_S_GT5,HD_GRAPHICS_2500 },// 0176 /* HD Graphics 2500 Mobile */
{GMA_IVYBRIDGE_M_GT1,HD_GRAPHICS_2500 },/* 0156 */
{GMA_IVYBRIDGE_M_GT2,HD_GRAPHICS_4000 },/* 0166 */
{GMA_IVYBRIDGE_D_GT1,HD_GRAPHICS_2500 },/* 0152 */
{GMA_IVYBRIDGE_D_GT2,HD_GRAPHICS_4000 },/* 0162 */
{GMA_IVYBRIDGE_S_GT1,HD_GRAPHICS },/* 015a */
{GMA_IVYBRIDGE_S_GT2,"HD Graphics P4000" }, /* 016a */
{GMA_IVYBRIDGE_S_GT3, HD_GRAPHICS },/* 015e */
{GMA_IVYBRIDGE_S_GT4,HD_GRAPHICS_2500 },/* 0172 */
{GMA_IVYBRIDGE_S_GT5,HD_GRAPHICS_2500 },/* 0176 */
/* Haswell */
// 0090 /* ??? */
// 0091 /* ??? */
// 0092 /* ??? */
{GMA_HASWELL_D_GT1,HD_GRAPHICS },
{GMA_HASWELL_D_GT1,HD_GRAPHICS },/* 0422 */
{GMA_HASWELL_D_GT2,HD_GRAPHICS_4600 },/* 0412 */
{GMA_HASWELL_D_GT3,HD_GRAPHICS_5000 },/* ??? */
{GMA_HASWELL_M_GT1,HD_GRAPHICS },
{GMA_HASWELL_D_GT3,HD_GRAPHICS_5000 },/* 0422 */
{GMA_HASWELL_M_GT1,HD_GRAPHICS },/* 0426 */
{GMA_HASWELL_M_GT2,HD_GRAPHICS_4600 },/* 0416 */
{GMA_HASWELL_M_GT3,HD_GRAPHICS_5000 },/* ??? */
{GMA_HASWELL_S_GT1,HD_GRAPHICS },
{GMA_HASWELL_S_GT2,"HD Graphics P4600/P4700" },
{GMA_HASWELL_S_GT3,HD_GRAPHICS_5000 },/* ??? */
{GMA_HASWELL_B_GT1,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_B_GT2,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_B_GT3,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_E_GT1,HD_GRAPHICS },
{GMA_HASWELL_M_GT3,HD_GRAPHICS_5000 },/* 0426 */
{GMA_HASWELL_S_GT1,HD_GRAPHICS },/* 040a */
{GMA_HASWELL_S_GT2,"HD Graphics P4600/P4700" }, /* 041a */
{GMA_HASWELL_S_GT3,HD_GRAPHICS_5000 },/* 042a */
{GMA_HASWELL_B_GT1,HD_GRAPHICS },/* 040b */
{GMA_HASWELL_B_GT2,HD_GRAPHICS },/* 041b */
{GMA_HASWELL_B_GT3,HD_GRAPHICS },/* 042b */
{GMA_HASWELL_E_GT1,HD_GRAPHICS },/* 040e */
{GMA_HASWELL_E_GT2,HD_GRAPHICS_4400 },/* 041e */
{GMA_HASWELL_E_GT3,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_D_GT1,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_D_GT2,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_D_GT3,IRIS_5100 },
{GMA_HASWELL_ULT_M_GT1,HD_GRAPHICS },
{GMA_HASWELL_E_GT3,HD_GRAPHICS },/* 042e */
{GMA_HASWELL_ULT_D_GT1,HD_GRAPHICS },/* 0a02 */
{GMA_HASWELL_ULT_D_GT2,HD_GRAPHICS },/* 0a12 */
{GMA_HASWELL_ULT_D_GT3,IRIS_5100 },/* 0a22 */
{GMA_HASWELL_ULT_M_GT1,HD_GRAPHICS },/* 0a06 */
{GMA_HASWELL_ULT_M_GT2,HD_GRAPHICS_4400 },/* 0a16 */
{GMA_HASWELL_ULT_M_GT3,HD_GRAPHICS_5000 },/* 0a26 */
{GMA_HASWELL_ULT_S_GT1,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_S_GT2,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_S_GT3,IRIS_5100 },
{GMA_HASWELL_ULT_B_GT1,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_B_GT2,HD_GRAPHICS },/* ??? */
{GMA_HASWELL_ULT_B_GT3,IRIS_5100 },
{GMA_HASWELL_ULT_S_GT1,HD_GRAPHICS },/* 0a0a */
{GMA_HASWELL_ULT_S_GT2,HD_GRAPHICS },/* 0a1a */
{GMA_HASWELL_ULT_S_GT3,IRIS_5100 },/* 0a2a */
{GMA_HASWELL_ULT_B_GT1,HD_GRAPHICS },/* 0a0b */
{GMA_HASWELL_ULT_B_GT2,HD_GRAPHICS },/* 0a1b */
{GMA_HASWELL_ULT_B_GT3,IRIS_5100 },/* 0a2b */
{GMA_HASWELL_ULT_E_GT1,HD_GRAPHICS_4400 },/* 0a0e */
{GMA_HASWELL_ULT_E_GT2,HD_GRAPHICS_4200 },/* 0a1e */
// 0A2A /* ??? */
{GMA_HASWELL_ULT_E_GT3,IRIS_5100 },
{GMA_HASWELL_ULT_E_GT3,IRIS_5100 },/* 0a2e */
{GMA_HASWELL_SDV_D_GT1_IG,HD_GRAPHICS },// 0C02 /* Intel Haswell HD Graphics - GTL */
// 0C04 /* DRAM Controller */
{GMA_HASWELL_SDV_M_GT1_IG,HD_GRAPHICS },// 0C06 /* Intel Haswell HD Graphics - GTL */
{GMA_HASWELL_SDV_M_GT2_IG,HD_GRAPHICS },// 0C16 /* Intel Haswell HD Graphics - GTH */
{GMA_HASWELL_SDV_D_GT2_PLUS_IG,HD_GRAPHICS },// 0C22 /* Intel Haswell HD Graphics - GTH */
{GMA_HASWELL_SDV_M_GT2_PLUS_IG,HD_GRAPHICS },// 0C26 /* Intel Haswell HD Graphics - GTH */
//{GMA_HASWELL_SDV_S_GT1_IG,HD_GRAPHICS }, /* 0c0a */
//{GMA_HASWELL_SDV_S_GT2_IG,HD_GRAPHICS }, /* 0c1a */
//{GMA_HASWELL_SDV_S_GT2_PLUS_IG,HD_GRAPHICS }, /* 0c2a */
{GMA_HASWELL_CRW_D_GT1,HD_GRAPHICS },/* 0d02 */
{GMA_HASWELL_CRW_D_GT2,HD_GRAPHICS_4600 },
{GMA_HASWELL_CRW_D_GT2,HD_GRAPHICS_4600 },/* 0d12 */
{GMA_HASWELL_CRW_D_GT3,IRIS_5200 },/* 0d22 */
//{GMA_HASWELL_CRW_D_GT2_PLUS_IG,HD_GRAPHICS },/* 0d32 */
{GMA_HASWELL_CRW_M_GT1,HD_GRAPHICS },/* 0d06 */
{GMA_HASWELL_CRW_M_GT2,HD_GRAPHICS_4600 },/* 0d16 */
{GMA_HASWELL_CRW_M_GT3,IRIS_5200 },/* 0d26 */
{GMA_HASWELL_CRW_S_GT1,HD_GRAPHICS },/* 0d0a */
{GMA_HASWELL_CRW_S_GT2,HD_GRAPHICS },/* 0d1a */
{GMA_HASWELL_CRW_S_GT3,IRIS_5200 },
{GMA_HASWELL_CRW_S_GT3,IRIS_5200 },/* 0d2a */
{GMA_HASWELL_CRW_B_GT1,HD_GRAPHICS },/* 0d0b */
{GMA_HASWELL_CRW_B_GT2,HD_GRAPHICS },/* 0d1b */
{GMA_HASWELL_CRW_B_GT3,IRIS_5200 },
{GMA_HASWELL_CRW_B_GT3,IRIS_5200 },/* 0d2b */
{GMA_HASWELL_CRW_E_GT1,HD_GRAPHICS },/* 0d0e */
{GMA_HASWELL_CRW_E_GT2,HD_GRAPHICS },/* od1e */
{GMA_HASWELL_CRW_E_GT3,IRIS_5200 },
{GMA_HASWELL_CRW_M_GT2_PLUS_IG,HD_GRAPHICS }
{GMA_HASWELL_CRW_E_GT3,IRIS_5200 },/* 0d2e */
{GMA_HASWELL_CRW_M_GT2_PLUS_IG,HD_GRAPHICS },/* 0d36 */
{GMA_HASWELL_CRW_S_GT2_PLUS_IG,HD_GRAPHICS },/* 0d3a */
/* Brodwell */
{GMA_BRODWELL_BDW_1602,HD_GRAPHICS },/* 1602 */
{GMA_BRODWELL_BDW_U_GT1,HD_GRAPHICS },/* 1606 */
{GMA_BRODWELL_BDW_160B,HD_GRAPHICS },/* 160b */
{GMA_BRODWELL_BDW_160A,HD_GRAPHICS },/* 160a */
{GMA_BRODWELL_BDW_160D,HD_GRAPHICS },/* 160d */
{GMA_BRODWELL_BDW_160E,HD_GRAPHICS },/* 160e */
{GMA_BRODWELL_BDW_1612,HD_GRAPHICS_5600},/* 1612 */
{GMA_BRODWELL_BDW_U_GT2,HD_GRAPHICS_5500 },/* 1616 */
{GMA_BRODWELL_BDW_161B,HD_GRAPHICS },/* 161b */
{GMA_BRODWELL_BDW_161A,HD_GRAPHICS },/* 161a */
{GMA_BRODWELL_BDW_161D,HD_GRAPHICS },/* 161d */
{GMA_BRODWELL_BDW_Y_GT2,HD_GRAPHICS_5300 },/* 161e */
{GMA_BRODWELL_BDW_1622,IRIS_6200},/* 1622 */
{GMA_BRODWELL_BDW_U_GT3,HD_GRAPHICS_6000 },/* 1626 */
{GMA_BRODWELL_BDW_162A,IRIS_6300},/* 162a */
{GMA_BRODWELL_BDW_U_GT3_2,IRIS_6100 },/* 162b */
{GMA_BRODWELL_BDW_162D,HD_GRAPHICS },/* 162d */
{GMA_BRODWELL_BDW_162E,HD_GRAPHICS },/* 162e */
{GMA_BRODWELL_BDW_1632,HD_GRAPHICS },/* 1632 */
{GMA_BRODWELL_BDW_1636,HD_GRAPHICS },/* 1636 */
{GMA_BRODWELL_BDW_163B,HD_GRAPHICS },/* 163b */
{GMA_BRODWELL_BDW_163A,HD_GRAPHICS },/* 163a */
{GMA_BRODWELL_BDW_163D,HD_GRAPHICS },/* 163d */
{GMA_BRODWELL_BDW_163E,HD_GRAPHICS }/* 163e */
};
#define GFX_DEVICES_LEN (sizeof(intel_gfx_chipsets) / sizeof(intel_gfx_chipsets[0]))
case GMA_HASWELL_CRW_E_GT2: // 0d1e
case GMA_HASWELL_CRW_E_GT3: // 0d2e
case GMA_HASWELL_CRW_M_GT2_PLUS_IG: // 0d36
case GMA_HASWELL_CRW_S_GT2_PLUS_IG: // 0d3a
if (getValueForKey(kAAPLCustomIG, &value, &len, &bootInfo->chameleonConfig) && len == AAPL_LEN_HSW * 2)
{
branches/zenith432/i386/libsaio/gma.h
7070
7171
7272
73
74
75
73
74
75
7676
7777
7878
......
9595
9696
9797
98
99
100
98
99
100
101101
102102
103
103
104104
105105
106106
......
170170
171171
172172
173
174
173175
174
176
177
178
179
180
181
182
175183
176184
177185
......
239247
240248
241249
242
243
250
251
244252
245
246
247
248
249
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
250278
251
252
253
254
255
256
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
257302
258303
259304
#define HD_GRAPHICS_5500 "HD Graphics 5500"
#define HD_GRAPHICS_5600 "HD Graphics 5600"
#define HD_GRAPHICS_6000 "HD Graphics 6000"
#define IRIS_6100 "Iris(TM) Pro Graphics 6100"
#define IRIS_6200 "Iris(TM) Pro Graphics 6200"
#define IRIS_6300 "Iris(TM) Pro Graphics 6300P"
#define IRIS_6100 "Iris graphics 6100"
#define IRIS_6200 "Iris Pro Graphics 6200"
#define IRIS_6300 "Iris Pro Graphics P6300"
#define INTEL_VENDORID0x8086
/* http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/tree/src/intel_driver.h */
#define GMA_I915_GM GFX_MODEL_CONSTRUCT(INTEL, 0x2592) // GMA 915
#define GMA_E7221_G GFX_MODEL_CONSTRUCT(INTEL, 0x258A)
#define GMA_I945_G GFX_MODEL_CONSTRUCT(INTEL, 0x2772) // Desktop GMA950
//#define GMA_82945G GFX_MODEL_CONSTRUCT(INTEL, 2776) // Desktop GMA950
//#define GMA_82915G GFX_MODEL_CONSTRUCT(INTEL, 2782) // GMA 915
//#define GMA_038000 GFX_MODEL_CONSTRUCT(INTEL, 2792) // Mobile GMA915
//#define GMA_82945G GFX_MODEL_CONSTRUCT(INTEL, 0x2776) // Desktop GMA950
//#define GMA_82915G GFX_MODEL_CONSTRUCT(INTEL, 0x2782) // GMA 915
//#define GMA_038000 GFX_MODEL_CONSTRUCT(INTEL, 0x2792) // Mobile GMA915
#define GMA_I945_GM GFX_MODEL_CONSTRUCT(INTEL, 0x27A2) // Mobile GMA950
#define GMA_I945_GME GFX_MODEL_CONSTRUCT(INTEL, 0x27AE) // Mobile GMA950
//#define GMA_945GM GFX_MODEL_CONSTRUCT(INTEL, 27A6) // Mobile GMA950
//#define GMA_945GM GFX_MODEL_CONSTRUCT(INTEL, 0x27A6) // Mobile GMA950
//#define GMA_PINEVIEW_M_HB GFX_MODEL_CONSTRUCT(INTEL, 0xA010)
#define GMA_PINEVIEW_M GFX_MODEL_CONSTRUCT(INTEL, 0xA011) // Mobile GMA3150
#define GMA_GMA3150_M GFX_MODEL_CONSTRUCT(INTEL, 0xA012) // Mobile GMA3150
#define GMA_IVYBRIDGE_S_GT5 GFX_MODEL_CONSTRUCT(INTEL, 0x0176) // HD Graphics 2500 Mobile // 3rd Gen Core processor Graphics Controller
/* ==================================== */
/* ====== Valleyview (Baytail) ======= */
//#define GMA_VALLEYVIEW_HB GFX_MODEL_CONSTRUCT(INTEL, 0x0F00) /* VLV1 */
//#define GMA_VALLEYVIEW_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0F30)
//#define GMA_VALLEYVIEW_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0F30) /* "HD Graphics" */
//#define GMA_VALLEYVIEW_?? GFX_MODEL_CONSTRUCT(INTEL, 0x0F31) /* "HD Graphics" */
//#define GMA_VALLEYVIEW_?? GFX_MODEL_CONSTRUCT(INTEL, 0x0F32) /* "HD Graphics" */
//#define GMA_VALLEYVIEW_?? GFX_MODEL_CONSTRUCT(INTEL, 0x0F33) /* "HD Graphics" */
//#define GMA_VALLEYVIEW_?? GFX_MODEL_CONSTRUCT(INTEL, 0x0155) /* "HD Graphics" */
//#define GMA_VALLEYVIEW_?? GFX_MODEL_CONSTRUCT(INTEL, 0x0157) /* "HD Graphics" */
/* ==================================== */
/* ============ Haswell =============== */
// 0090 // AppleIntelHD5000Graphics.kext
#define GMA_HASWELL_CRW_E_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x0D0E)
#define GMA_HASWELL_CRW_E_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x0D1E)
#define GMA_HASWELL_CRW_E_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x0D2E)
#define GMA_HASWELL_CRW_M_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D36)
//#define GMA_HASWELL_CRW_S_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D3A)
#define GMA_HASWELL_CRW_M_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D36) // Crystal Well Integrated Graphics Controller
#define GMA_HASWELL_CRW_S_GT2_PLUS_IG GFX_MODEL_CONSTRUCT(INTEL, 0x0D3A)
#define GMA_BRODWELLL_BDW_U_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x1606) // BDW U GT1
#define GMA_BRODWELLL_BDW_U_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x1616) // BDW U GT2 Intel(R) HD Graphics 5500 Drivers
#define GMA_BRODWELLL_BDW_U_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x1626) // BDW U GT3 15W Intel(R) HD Graphics 6000 Drivers
#define GMA_BRODWELLL_BDW_U_GT3_2 GFX_MODEL_CONSTRUCT(INTEL, 0x162B) // BDW U GT3 28W Intel(R) Iris(TM) Pro Graphics 6100 Drivers
#define GMA_BRODWELLL_BDW_Y_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x161E) // BDW Y GT2 Intel(R) HD Graphics 5300 Drivers
/* Brodwell */
#define GMA_BRODWELL_BDW_1602 GFX_MODEL_CONSTRUCT(INTEL, 0x1602) // Intel(R) HD Graphics Drivers
#define GMA_BRODWELL_BDW_U_GT1 GFX_MODEL_CONSTRUCT(INTEL, 0x1606) // BDW U GT1
#define GMA_BRODWELL_BDW_160A GFX_MODEL_CONSTRUCT(INTEL, 0x160A) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_160B GFX_MODEL_CONSTRUCT(INTEL, 0x160B) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_160D GFX_MODEL_CONSTRUCT(INTEL, 0x160D) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_160E GFX_MODEL_CONSTRUCT(INTEL, 0x160E) // Intel(R) HD Graphics Drivers
#define GMA_BRODWELL_BDW_1612 GFX_MODEL_CONSTRUCT(INTEL, 0x1612) // Intel(R) HD Graphics 5600 Drivers
#define GMA_BRODWELL_BDW_U_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x1616) // BDW U GT2 Intel(R) HD Graphics 5500 Drivers
#define GMA_BRODWELL_BDW_161B GFX_MODEL_CONSTRUCT(INTEL, 0x161B) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_161A GFX_MODEL_CONSTRUCT(INTEL, 0x161A) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_161D GFX_MODEL_CONSTRUCT(INTEL, 0x161D) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_Y_GT2 GFX_MODEL_CONSTRUCT(INTEL, 0x161E) // BDW Y GT2 Intel(R) HD Graphics 5300 Drivers
#define GMA_BRODWELL_BDW_1622 GFX_MODEL_CONSTRUCT(INTEL, 0x1622) // Intel(R) Iris(TM) Pro Graphics 6200 Drivers
#define GMA_BRODWELL_BDW_162A GFX_MODEL_CONSTRUCT(INTEL, 0x162A) // Intel(R) Iris(TM) Pro Graphics 6300P Drivers
#define GMA_BRODWELL_BDW_U_GT3 GFX_MODEL_CONSTRUCT(INTEL, 0x1626) // BDW U GT3 15W Intel(R) HD Graphics 6000 Drivers
#define GMA_BRODWELL_BDW_U_GT3_2 GFX_MODEL_CONSTRUCT(INTEL, 0x162B) // BDW U GT3 28W Intel(R) Iris(TM) Pro Graphics 6100 Drivers
#define GMA_BRODWELL_BDW_162D GFX_MODEL_CONSTRUCT(INTEL, 0x162D) // Intel(R) Iris(TM) Pro Graphics 6300P Drivers
#define GMA_BRODWELL_BDW_162E GFX_MODEL_CONSTRUCT(INTEL, 0x162E) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_1632 GFX_MODEL_CONSTRUCT(INTEL, 0x1632) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_1636 GFX_MODEL_CONSTRUCT(INTEL, 0x1636) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_163A GFX_MODEL_CONSTRUCT(INTEL, 0x163A) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_163B GFX_MODEL_CONSTRUCT(INTEL, 0x163B) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_163D GFX_MODEL_CONSTRUCT(INTEL, 0x163D) // Broadwell-U Integrated Graphics
#define GMA_BRODWELL_BDW_163E GFX_MODEL_CONSTRUCT(INTEL, 0x163E) // Broadwell-U Integrated Graphics
// 0x1602Intel(R) HD Graphics Drivers
// 0x160eIntel(R) HD Graphics Drivers
// 0x1612Intel(R) HD Graphics 5600 Drivers
// 0x1622Intel(R) Iris(TM) Pro Graphics 6200 Drivers
// 0x162aIntel(R) Iris(TM) Pro Graphics 6300P Drivers
// 0x162bIntel(R) Iris(TM) Pro Graphics 6100 Drivers
/*
https://fossies.org/linux/MesaLib/include/pci_ids/i965_pci_ids.h
CHIPSET(0x1602, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x1606, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160A, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160B, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160D, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x160E, bdw_gt1, "Intel(R) Broadwell GT1")
CHIPSET(0x1612, bdw_gt2, "Intel(R) HD Graphics 5600 (Broadwell GT2)")
CHIPSET(0x1616, bdw_gt2, "Intel(R) HD Graphics 5500 (Broadwell GT2)")
CHIPSET(0x161A, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161B, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161D, bdw_gt2, "Intel(R) Broadwell GT2")
CHIPSET(0x161E, bdw_gt2, "Intel(R) HD Graphics 5300 (Broadwell GT2)")
CHIPSET(0x1622, bdw_gt3, "Intel(R) Iris Pro 6200 (Broadwell GT3e)")
CHIPSET(0x1626, bdw_gt3, "Intel(R) HD Graphics 6000 (Broadwell GT3)")
CHIPSET(0x162A, bdw_gt3, "Intel(R) Iris Pro P6300 (Broadwell GT3e)")
CHIPSET(0x162B, bdw_gt3, "Intel(R) Iris 6100 (Broadwell GT3)")
CHIPSET(0x162D, bdw_gt3, "Intel(R) Broadwell GT3")
CHIPSET(0x162E, bdw_gt3, "Intel(R) Broadwell GT3")
*/
// 0x0bd0Intel Broadwell HD Graphics HAS GT0 Drivers
// 0x0bd1Intel Broadwell HD Graphics HAS GT1 Drivers
// 0x0bd2Intel Broadwell HD Graphics HAS GT2 Drivers
branches/zenith432/i386/libsaio/table.c
7878
7979
8080
81
81
8282
8383
8484
byte granularity, 1MB limit, MEMBASE offset */
//{0xFFFF, MEMBASE, 0x00, 0x9E, 0x4F, 0x00},
{0xFFFF, 0x0000, 0x00, 0x9E, 0xCF, 0x00},
/* 0x10 : boot protected mode data segment
page granularity, 4GB limit, MEMBASE offset */
{0xFFFF, MEMBASE, 0x00, 0x92, 0xCF, 0x00},
branches/zenith432/i386/libsaio/device_inject.c
7474
7575
7676
77
77
7878
7979
8080
8181
8282
8383
84
84
8585
8686
8787
......
175175
176176
177177
178
178
179179
180180
181181
......
274274
275275
276276
277
277
278278
279279
280280
DevPropString *devprop_create_string(void)
{
string = (struct DevPropString *)malloc(sizeof(struct DevPropString));
string = (DevPropString *)malloc(sizeof(DevPropString));
if(string == NULL)
{
return NULL;
}
memset(string, 0, sizeof(struct DevPropString));
memset(string, 0, sizeof(DevPropString));
string->length = 12;
string->WHAT2 = 0x01000000;
return string;
device->acpi_dev_path.length= 0x0c;
device->acpi_dev_path.type= 0x02;
device->acpi_dev_path.subtype= 0x01;
device->acpi_dev_path._HID= 0xd041030a;
device->acpi_dev_path._HID= 0xd041030a; // 0x0a0341d0
device->num_pci_devpaths = numpaths;
device->length = 24 + (6*numpaths);
if(!device->data)
{
device->data = (uint8_t*)malloc(sizeof(uint8_t));
device->data = (uint8_t *)malloc(sizeof(uint8_t));
}
else
{
branches/zenith432/i386/libsaio/nvidia.c
10821082
10831083
10841084
1085
1086
10851087
1088
10861089
1090
10871091
10881092
10891093
......
10921096
10931097
10941098
1099
1100
10951101
10961102
10971103
......
11821188
11831189
11841190
1191
1192
11851193
11861194
11871195
......
12151223
12161224
12171225
1218
1226
12191227
12201228
12211229
......
12311239
12321240
12331241
1242
12341243
12351244
12361245
......
12711280
12721281
12731282
1283
12741284
12751285
12761286
......
12801290
12811291
12821292
1293
12831294
12841295
12851296
......
12931304
12941305
12951306
1307
1308
12961309
12971310
12981311
......
13031316
13041317
13051318
1319
1320
13061321
13071322
13081323
13091324
13101325
13111326
1327
13121328
13131329
13141330
......
13221338
13231339
13241340
1325
1341
13261342
13271343
13281344
{ 0x10DE1020,"Tesla K20X" },
{ 0x10DE1021,"Tesla K20Xm" },
{ 0x10DE1022,"Tesla K20c" },
{ 0x10DE1023,"Tesla K40m" }, // GK110BGL
{ 0x10DE1024,"Tesla K40c" }, // GK110BGL
{ 0x10DE1026,"Tesla K20s" },
{ 0x10DE1027,"Tesla K40st" }, // GK110BGL
{ 0x10DE1028,"Tesla K20m" },
{ 0x10DE1029,"Tesla K40s" }, // GK110BGL
{ 0x10DE102A,"Tesla K40t" }, // GK110BGL
//{ 0x10DE102B,"Graphics Device" }, // GK110BGL
//{ 0x10DE102C,"Graphics Device" }, // GK110BGL
{ 0x10DE102F,"Tesla Stella Solo" }, // GK110BGL
// 1030 - 103F
//{ 0x10DE1030,"" }, // GK110
{ 0x10DE103a,"Quadro K6000" }, // GK110GL
{ 0x10DE103c,"Quadro K5200" }, // GK110GL
{ 0x10DE103F,"Tesla Stella SXM" }, // GK110
// 1040 - 104F
{ 0x10DE1040,"GeForce GT 520" },
{ 0x10DE1189,"GeForce GTX 670" },
{ 0x10DE118A,"GRID K520" },
{ 0x10DE118B,"GRID K200" }, // GRID K2 GeForce USM
{ 0x10DE118C,"GRID K2 NVS USM" }, // GK104
{ 0x10DE118D,"GRID K200 vGPU" }, // GK104GL
{ 0x10DE118E,"GeForce GTX 760 (192-bit)" },
{ 0x10DE118F,"Tesla K10" },
// 1190 - 119F
{ 0x10DE11BC,"Quadro K5000M" },
{ 0x10DE11BD,"Quadro K4000M" },
{ 0x10DE11BE,"Quadro K3000M" },
{ 0x10DE11BF,"GRID K2" },
{ 0x10DE11BF,"GRID K2" }, // GK104GL
// 11C0 - 11CF
{ 0x10DE11C0,"GeForce GTX 660" },
{ 0x10DE11C2,"GeForce GTX 650 Ti BOOST" },
{ 0x10DE11E1,"GeForce GTX 765M" },
{ 0x10DE11E2,"GeForce GTX 765M" },
{ 0x10DE11E3,"GeForce GTX 760M" },
//{ 0x10DE11E7,"GeForce " }, // GK106M
// 11F0 - 11FF
{ 0x10DE11FA,"Quadro K4000" },
{ 0x10DE11FC,"Quadro 2100M" },
{ 0x10DE1284,"GeForce GT 630" },
{ 0x10DE1286,"GeForce GT 720" },
{ 0x10DE1287,"GeForce GT 730" }, // GK208
{ 0x10DE1288,"GeForce GT 720" }, // GK208
// 1290 - 129F
{ 0x10DE1290,"GeForce GT 730M" },
{ 0x10DE1291,"GeForce GT 735M" },
{ 0x10DE1295,"GeForce GT 710M" },
{ 0x10DE1296,"GeForce 825M" }, // GK208M
{ 0x10DE1298,"GeForce GT 720M" },
{ 0x10DE1299,"GeForce 920M" }, // GK208M
// 12A0 - 12AF
{ 0x10DE12A0,"GK208" },
{ 0x10DE12AF,"GK208-INT" },
// 12F0 - 12FF
{ 0x10DE1340,"GeForce 830M" },
{ 0x10DE1341,"GeForce 840M" },
{ 0x10DE1346,"GeForce 930M" }, // GM108M
{ 0x10DE1347,"GeForce 940M" }, // GM108M
{ 0x10DE1380,"GeForce GTX 750 Ti" },
{ 0x10DE1381,"GeForce GTX 750" },
{ 0x10DE1382,"GeForce GTX 745" },
{ 0x10DE1392,"GeForce GTX 860M" },
{ 0x10DE1393,"GeForce 840M" },
{ 0x10DE1398,"GeForce 845M" }, //
{ 0x10DE139A,"GeForce GTX 950M" }, // GM107
{ 0x10DE139B,"GeForce GTX 960M" }, // GM107
{ 0x10DE13AD,"GM107 INT52" }, //
{ 0x10DE13AE,"GM107 CS1" }, //
//{ 0x10DE13AF,"Graphics Device" }, // GM107GLM
{ 0x10DE13B3,"Quadro K2200M" }, //
{ 0x10DE13BA,"Quadro K2200" },
{ 0x10DE13BB,"Quadro K620" },
{ 0x10DE13BC,"Quadro K1200" },
{ 0x10DE13BD,"Tesla M40" }, // GM107GLM
{ 0x10DE13BE,"GM107 CS1" }, //
{ 0x10DE13BF,"GM107 INT52" }, //
{ 0x10DE13D9,"GeForce GTX 965M" },
//{ 0x10DE13F0,"Graphics Device" }, // GM107GLM
//{ 0x10DE13F1,"Graphics Device" }, // GM107GLM
//{ 0x10DE1401,"Graphics Device" }, //
{ 0x10DE1401,"GeForce GTX 960" }, //
//{ 0x10DE1402,"Graphics Device" }, //
//{ 0x10DE143F,"Graphics Device" }, //
//{ 0x10DE1600,"Graphics Device" }, //
branches/zenith432/i386/libsaio/ati.c
77
88
99
10
11
12
13
14
1015
1116
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
6917
7018
7119
......
10654
10755
10856
109
57
11058
11159
112
60
11361
11462
11563
......
12775
12876
12977
78
13079
13180
13281
......
13685
13786
13887
139
140
88
89
90
91
92
93
94
95
14196
142
143
144
145
97
98
99
100
101
146102
147103
148104
......
10791035
10801036
10811037
1082
10831038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
10841063
10851064
10861065
......
11011080
11021081
11031082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
11041313
11051314
11061315
......
12181427
12191428
12201429
1221
1222
12231430
12241431
12251432
......
12271434
12281435
12291436
1230
12311437
12321438
12331439
12341440
12351441
12361442
1237
1238
1239
1443
12401444
12411445
12421446
......
12801484
12811485
12821486
1283
1487
12841488
1285
1489
12861490
12871491
12881492
......
12961500
12971501
12981502
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
13091513
13101514
13111515
......
13751579
13761580
13771581
1378
1379
13801582
13811583
13821584
......
13901592
13911593
13921594
1393
1595
13941596
13951597
13961598
13971599
13981600
1399
1601
14001602
14011603
14021604
1403
1605
14041606
14051607
1406
1608
14071609
14081610
14091611
......
14281630
14291631
14301632
1431
1633
14321634
14331635
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
14441646
14451647
14461648
1447
1649
14481650
14491651
14501652
......
14761678
14771679
14781680
1479
1480
1481
1482
1483
1484
1681
1682
1683
1684
1685
1686
14851687
14861688
1487
1488
1489
1689
1690
1691
14901692
14911693
14921694
1493
1695
14941696
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
15071709
1508
1509
1510
1511
1710
1711
15121712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
15131744
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
17121772
17131773
1714
1774
17151775
17161776
17171777
......
17471807
17481808
17491809
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
17631810
17641811
17651812
......
17801827
17811828
17821829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
17831844
17841845
17851846
......
19442005
19452006
19462007
1947
2008
19482009
19492010
19502011
......
20102071
20112072
20122073
2074
20132075
20142076
20152077
......
20172079
20182080
20192081
2082
20202083
20212084
20222085
20232086
20242087
2088
20252089
20262090
20272091
......
20572121
20582122
20592123
2124
20602125
20612126
20622127
......
21062171
21072172
21082173
2174
21092175
21102176
21112177
......
23262392
23272393
23282394
2395
2396
23292397
23302398
23312399
......
23612429
23622430
23632431
2432
23642433
23652434
23662435
#include "ati.h"
/* vals */
static value_t aty_name;
static value_t aty_nameparent;
card_t *card;
static booldoit= false;
static const char *chip_family_name[] = {
"UNKNOW",
"R420",
"RV410",
"RV515",
"R520",
"RV530",
"RV560",
"RV570",
"R580",
/* IGP */
"RS600",
"RS690",
"RS740",
"RS780",
"RS880",
/* R600 */
"R600",
"RV610",
"RV620",
"RV630",
"RV635",
"RV670",
/* R700 */
"RV710",
"RV730",
"RV740",
"RV772",
"RV770",
"RV790",
/* Evergreen */
"Cedar",
"Cypress",
"Hemlock",
"Juniper",
"Redwood",
"Broadway",
/* Northern Islands */
"Barts",
"Caicos",
"Cayman",
"Turks",
/* Southern Islands */
"Tahiti",
"Pitcairn",
"Verde",
"Oland",
"Hainan",
"Bonaire",
"Kaveri",
"Abini",
"Hawaii",
/* ... */
"Mullins",
""
};
static card_config_t card_configs[] = {
{NULL,0},
/* OLDController */
{"Galago",2},
{"Colobus",2},
{"Mangabey",2},
{"Nomascus",5},
{"Nomascus",4},
{"Orangutan",2},
/* AMD6000Controller */
{"Pithecia",3},
{"Pithecia",2},
{"Bulrushes",6},
{"Cattail",4},
{"Hydrilla",5},
{"Spikerush", 4},
{"Typha", 5},
/* AMD7000Controller */
{"Namako",4},
{"Aji",4},
{"Buri",4},
{"Chutoro",5},
{"Futomaki",5},
{"Hamachi",4},
{"OPM", 6},
{"Ikura", 6},
{"IkuraS", 1},
{"Ikura",1},
{"IkuraS",6},
{"Junsai",6},
{"Kani",1},
{"KaniS",6},
{"DashimakiS",4},
{"Maguro",1},
{"MaguroS",6},
/* AMD8000Controller */
{"Baladi", 5},//desktop
{"Exmoor", 4},//mobile
{"Basset", 4}
{"Baladi", 6},
/* AMD9000Controller */
{"Exmoor",4},
{"Basset",4},
{"Greyhound",6}
};
static radeon_card_info_t radeon_cards[] = {
{ 0x6840,0xFCD41179, CHIP_FAMILY_LOMBOK,"Toshiba HD 7670M", kPondweed },
{ 0x6840,0xFCEE1179, CHIP_FAMILY_LOMBOK,"Toshiba HD 7670M", kPondweed },
*/
/* Old series */
// KAVERI
//{ 0x1304,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x1305,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
//{ 0x1306,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x1307,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
//{ 0x1309,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x130A,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x130B,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x130C,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x130D,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
//{ 0x130E,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
{ 0x130F,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon R7", kNull },
//{ 0x1310,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
//{ 0x1311,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
//{ 0x1312,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
{ 0x1313,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon R7", kNull },
//{ 0x1315,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
{ 0x1316,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon R5", kNull },
//{ 0x1317,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull }, // Mobile
{ 0x1318,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon R5", kNull }, // Mobile
//{ 0x131B,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
//{ 0x131C,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
//{ 0x131D,0x00000000, CHIP_FAMILY_KAVERI,"AMD Radeon", kNull },
// R423
{ 0x5D48, 0x00000000, CHIP_FAMILY_R423, "ATI Radeon HD Mobile ",kNull},
{ 0x5D49, 0x00000000, CHIP_FAMILY_R423, "ATI Radeon HD Mobile ",kNull},
{ 0x5E4D, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ",kNull},
{ 0x5E4F, 0x00000000, CHIP_FAMILY_RV410, "ATI Radeon HD Desktop ",kNull},
// OLAND
{ 0x6600,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon HD 8600/8700M",kNull }, // Mobile
{ 0x6601,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon HD 8500/8700M",kNull }, // Mobile
//{ 0x6602,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon",kNull }, // Mobile
//{ 0x6603,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon",kNull }, // Mobile
{ 0x6604,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 M265",kNull }, // Mobile
{ 0x6605,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 M260",kNull }, // Mobile
{ 0x6606,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon HD 8790M",kNull }, // Mobile
{ 0x6607,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R5 M240",kNull }, // Mobile
{ 0x6608,0x00000000, CHIP_FAMILY_OLAND,"AMD FirePro W2100",kNull },
{ 0x6610,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 200 Series",kNull },
{ 0x6611,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 200 Series",kNull },
{ 0x6613,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 240",kFutomaki},
//{ 0x6620,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon", kNull }, // Mobile
//{ 0x6621,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon", kNull }, // Mobile
//{ 0x6623,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon", kNull }, // Mobile
//{ 0x6631,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon", kNull },
// BONAIRE
{ 0x6640,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon HD 8950", kNull }, // Mobile
//{ 0x6641,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon", kNull }, // Mobile
{ 0x6646,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon R9 M280X", kNull }, // Mobile
{ 0x6647,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon R9 M270X", kNull }, // Mobile
{ 0x6649,0x00000000, CHIP_FAMILY_BONAIRE,"AMD FirePro W5100", kNull },
//{ 0x6650,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon", kNull },
//{ 0x6651,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon", kNull },
{ 0x6658,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon R7 200", kNull },
{ 0x665C,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon HD 7790",kFutomaki},
{ 0x665D,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon R9 260",kFutomaki},
// HAINAN
{ 0x6660,0x00000000, CHIP_FAMILY_HAINAN,"AMD Radeon HD 8600M", kNull }, // Mobile
{ 0x6663,0x00000000, CHIP_FAMILY_HAINAN,"AMD Radeon HD 8500M", kNull }, // Mobile
{ 0x6664,0x00000000, CHIP_FAMILY_HAINAN,"AMD Radeon R5 M200", kNull }, // Mobile
{ 0x6665,0x00000000, CHIP_FAMILY_HAINAN,"AMD Radeon R5 M200", kNull }, // Mobile
{ 0x6667,0x00000000, CHIP_FAMILY_HAINAN,"AMD Radeon R5 M200", kNull }, // Mobile
{ 0x666F,0x00000000, CHIP_FAMILY_HAINAN,"AMD Radeon HD 8500M", kNull }, // Mobile
// CAYMAN
{ 0x6701,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6702,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6703,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6704,0x00000000, CHIP_FAMILY_CAYMAN,"AMD FirePro V7900",kLotus},
{ 0x6705,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6706,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6707,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6708,0x00000000, CHIP_FAMILY_CAYMAN,"AMD FirePro V5900",kLotus},
{ 0x6709,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6718,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kLotus},
{ 0x6719,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950 Series",kLotus},
{ 0x671C,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kLotus},
{ 0x671D,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950 Series",kLotus},
{ 0x671F,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6930 Series",kLotus},
// BARTS
{ 0x6720,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kFanwort},
{ 0x6722,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kFanwort},
{ 0x6729,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kFanwort},
{ 0x6738,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870 Series",kDuckweed},
{ 0x6739,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850 X2",kDuckweed},
{ 0x673E,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6790 Series",kDuckweed},
// TURKS
{ 0x6740,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M Series",kCattail},
{ 0x6741,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6750M",kCattail},
{ 0x6742,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7500/7600 Series",kCattail},
{ 0x6745,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6600M Series",kCattail},
{ 0x6749,0x00000000, CHIP_FAMILY_TURKS,"ATI Radeon FirePro V4900",kPithecia},
{ 0x674A,0x00000000, CHIP_FAMILY_TURKS,"AMD FirePro V3900",kPithecia},
{ 0x6750,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kPithecia},
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kPithecia},
{ 0x6759,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570 Series",kPithecia},
{ 0x675B,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600 Series",kPithecia},
{ 0x675D,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7570M Series",kCattail},
{ 0x675F,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6510 Series",kPithecia},
// CAICOS
{ 0x6760,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M Series",kHydrilla},
{ 0x6761,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6430M Series",kHydrilla},
{ 0x6763,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon E6460 Series",kHydrilla},
{ 0x6768,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400M Series",kHydrilla},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kBulrushes},
{ 0x6772,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400A Series",kBulrushes},
{ 0x6778,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7000 Series",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450/7450/8450/R5 230",kBulrushes},
{ 0x677B,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400 Series",kBulrushes},
// TAHITI
//Framebuffers: Aji - 4 Desktop, Buri - 4 Mobile, Chutoro - 5 Mobile, Dashimaki - 4, IkuraS - HMDI
// Ebi - 5 Mobile, Gari - 5 M, Futomaki - 4 D, Hamachi - 4 D, OPM - 6 Server, Ikura - 6
{ 0x6780,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6784,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6788,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x678A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6790,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6791,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6792,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6798,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7970X/8970/R9 280X",kFutomaki},
{ 0x6799,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7990 Series",kAji},
{ 0x679A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950/8950/R9 280",kFutomaki},
{ 0x679B,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x679E,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7870 XT",kFutomaki},
{ 0x679F,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950 Series",kFutomaki},
// HAWAII
//{ 0x67A0,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A1,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A2,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A8,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A9,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67AA,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
{ 0x67B0,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290X", kBaladi},
{ 0x67B1,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290", kBaladi},
//{ 0x67B8,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
{ 0x67B9,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 200", kFutomaki},
//{ 0x67BA,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67BE,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
// PITCAIRN
{ 0x6800,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7970M",kBuri}, // Mobile
{ 0x6801,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 8970M Series",kFutomaki}, // Mobile
//{ 0x6802,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD ???M Series",kFutomaki}, // Mobile
{ 0x6806,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7600 Series",kFutomaki},
{ 0x6808,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7600 Series",kFutomaki},
{ 0x6809,0x00000000, CHIP_FAMILY_PITCAIRN,"ATI FirePro V",kNull},
{ 0x6810,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon R9 270X",kFutomaki},
{ 0x6811,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon R9 270",kFutomaki},
//{ 0x6816,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon",kFutomaki},
//{ 0x6817,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon",kFutomaki},
{ 0x6818,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7870 Series",kFutomaki},
{ 0x6819,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7850 Series",kFutomaki},
// VERDE
{ 0x6820,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x6821,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x6822,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon E8860",kBuri}, // Mobile
{ 0x6823,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 8800M Series",kBuri}, // Mobile
//{ 0x6824,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700M Series",kBuri}, // Mobile
{ 0x6825,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7800M Series",kPondweed}, // Mobile
{ 0x6826,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x6827,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7800M Series",kPondweed}, // Mobile
{ 0x6828,0x00000000, CHIP_FAMILY_VERDE,"ATI FirePro V",kBuri},
//{ 0x6829,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD ??? Series",kBuri},
//{ 0x682A,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD",kBuri}, // Mobile
{ 0x682B,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 8800M Series",kBuri}, // Mobile
{ 0x682D,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x682F,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7730 Series",kBuri}, // Mobile
{ 0x6830,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7800M Series",kBuri}, // Mobile
{ 0x6831,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x6835,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD R7 Series",kBuri},
{ 0x6837,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x6838,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x6839,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x683B,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x683D,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7770 Series",kBuri},
{ 0x683F,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7750 Series",kBuri},
// TURKS
{ 0x6840,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7670M Series",kPondweed}, // Mobile
{ 0x6841,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7650M Series",kPondweed}, // Mobile
{ 0x6842,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed}, // Mobile
{ 0x6843,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7670M Series",kPondweed}, // Mobile
{ 0x6849,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed},
// PITCAIRN
//{ 0x684C,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD",kNull},
// TURKS
{ 0x6850,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed },
{ 0x6858,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7400 Series",kPondweed },
{ 0x6859,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed },
// CYPRESS
//{ 0x6880,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD",kNull}, // Mobile
{ 0x6888,0x00000000, CHIP_FAMILY_CYPRESS,"ATI FirePro V8800",kNull},
{ 0x6889,0x00000000, CHIP_FAMILY_CYPRESS,"ATI FirePro V7800",kNull},
{ 0x688A,0x00000000, CHIP_FAMILY_CYPRESS,"ATI FirePro V9800",kNull},
{ 0x688C,0x00000000, CHIP_FAMILY_CYPRESS,"AMD FireStream 9370",kZonalis},
{ 0x688D,0x00000000, CHIP_FAMILY_CYPRESS,"AMD FireStream 9350",kZonalis},
{ 0x6898,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870 Series",kUakari},
{ 0x6899,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5850 Series",kUakari},
{ 0x689B,0x00000000, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6800 Series",kNull},
// HEMLOCK
{ 0x689C,0x00000000, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5970 Series",kUakari},
{ 0x689D,0x00000000, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5900 Series",kUakari},
// CYPRESS
{ 0x689E,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5800 Series",kUakari},
// JUNIPER
{ 0x68A0,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kHoolock}, // Mobile
{ 0x68A1,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5850 Series",kHoolock}, // Mobile
{ 0x68A8,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6850M",kHoolock},
{ 0x68A9,0x00000000, CHIP_FAMILY_JUNIPER,"ATI FirePro V5800 (FireGL)",kHoolock},
{ 0x68B0,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kHoolock}, // Mobile
{ 0x68B1,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kHoolock},
{ 0x68B8,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kVervet},
{ 0x68B9,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5700 Series",kHoolock},
{ 0x68BA,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6770 Series",kHoolock},
{ 0x68BC,0x00000000, CHIP_FAMILY_JUNIPER,"AMD FireStream 9370",kHoolock},
{ 0x68BD,0x00000000, CHIP_FAMILY_JUNIPER,"AMD FireStream 9350",kHoolock},
{ 0x68BE,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5750 Series",kHoolock},
{ 0x68BF,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750 Series",kHoolock},
// REDWOOD
{ 0x68C0,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5730 Series",kBaboon}, // Mobile
{ 0x68C1,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5650 Series",kBaboon}, // Mobile
{ 0x68C7,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5570",kEulemur}, // Mobile
{ 0x68C8,0x00000000, CHIP_FAMILY_REDWOOD,"ATI FirePro v4800", kBaboon},
{ 0x68C9,0x00000000, CHIP_FAMILY_REDWOOD,"FirePro 3D V3800",kBaboon},
{ 0x68D8,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5670 Series",kBaboon},
{ 0x68D9,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5570 Series",kBaboon},
{ 0x68DA,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5500 Series",kBaboon},
{ 0x68DE,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5000 Series",kNull},
// CEDAR
{ 0x68E0,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470 Series",kEulemur},
{ 0x68E1,0x00000000, CHIP_FAMILY_CEDAR,"AMD Radeon HD 6230",kEulemur},
{ 0x68E4,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 6370M Series",kEulemur},
{ 0x68E5,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 6300M Series",kEulemur},
//{ 0x68E8,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
//{ 0x68E9,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
{ 0x68F1,0x00000000, CHIP_FAMILY_CEDAR,"AMD FirePro 2460",kEulemur},
{ 0x68F2,0x00000000, CHIP_FAMILY_CEDAR,"AMD FirePro 2270",kEulemur},
//{ 0x68F8,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
{ 0x68F9,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5450 Series",kEulemur},
{ 0x68FA,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 7300 Series",kEulemur},
//{ 0x68FE,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
// R520
{ 0x7100, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Desktop ",kNull},
{ 0x7101, 0x00000000, CHIP_FAMILY_R520, "ATI Radeon HD Mobile ",kNull},
{ 0x7293, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ",kAlopias},
{ 0x7297, 0x00000000, CHIP_FAMILY_RV560, "ATI Radeon HD Desktop ",kAlopias},
/* IGP */
// RS690
{ 0x791E,0x00000000, CHIP_FAMILY_RS690,"ATI Radeon IGP ",kNull},
{ 0x791F,0x00000000, CHIP_FAMILY_RS690,"ATI Radeon IGP ",kNull},
{ 0x7941,0x00000000, CHIP_FAMILY_RS690,"ATI Radeon IGP ",kNull},
{ 0x7942,0x00000000, CHIP_FAMILY_RS690,"ATI Radeon IGP ",kNull},
// RS740
{ 0x796C,0x00000000, CHIP_FAMILY_RS740,"ATI Radeon IGP ",kNull},
{ 0x796D,0x00000000, CHIP_FAMILY_RS740,"ATI Radeon IGP ",kNull},
{ 0x796E,0x00000000, CHIP_FAMILY_RS740,"ATI Radeon IGP ",kNull},
{ 0x796F,0x00000000, CHIP_FAMILY_RS740,"ATI Radeon IGP ",kNull},
/* standard/default models */
// RS600
// RS600
{ 0x9400,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 XT",kNull},
{ 0x9401,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 GT",kNull},
{ 0x9402,0x00000000, CHIP_FAMILY_R600,"ATI Radeon HD 2900 GT",kNull},
//{ 0x947B,0x00000000, CHIP_FAMILY_RV770,"ATI Mobility Radeon",kMotmot},
// RV730
{ 0x9480,0x00000000, CHIP_FAMILY_RV730,"ATI Mobility Radeon HD 550v",kGliff},
{ 0x9480,0x00000000, CHIP_FAMILY_RV730,"ATI Mobility Radeon HD 550v",kGliff},
{ 0x9487,0x00000000, CHIP_FAMILY_RV730,"ATI Radeon HD Series",kGliff},
{ 0x9488,0x00000000, CHIP_FAMILY_RV730,"ATI Radeon HD 4650 Series",kGliff},
{ 0x9488,0x00000000, CHIP_FAMILY_RV730,"ATI Radeon HD 4650 Series",kGliff},
{ 0x9489,0x00000000, CHIP_FAMILY_RV730,"ATI Radeon HD Series",kGliff},
{ 0x948A,0x00000000, CHIP_FAMILY_RV730,"ATI Radeon HD Series",kGliff},
{ 0x948F,0x00000000, CHIP_FAMILY_RV730,"ATI Radeon HD Series",kGliff},
// RV610
{ 0x94C0,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD Series",kIago},
{ 0x94C1,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C3,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2350 Series",kIago},
{ 0x94C4,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C5,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C6,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C7,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2350",kIago},
{ 0x94C8,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C9,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94CB,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94CC,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C1,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C3,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2350 Series",kIago},
{ 0x94C4,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C5,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C6,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C7,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2350",kIago},
{ 0x94C8,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94C9,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94CB,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94CC,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 Series",kIago},
{ 0x94CD,0x00000000, CHIP_FAMILY_RV610,"ATI Radeon HD 2400 PRO Series",kIago},
// RV670
//{ 0x95CE,0x00000000, CHIP_FAMILY_RV620,"ATI Radeon HD",kIago },
{ 0x95CF,0x00000000, CHIP_FAMILY_RV620,"ATI FirePro 2260",kIago },
/* IGP */
// RS780
{ 0x9610,0x00000000, CHIP_FAMILY_RS780,"ATI Radeon HD 3200 Graphics",kNull },
{ 0x9611,0x00000000, CHIP_FAMILY_RS780,"ATI Radeon HD 3100 Graphics",kNull },
{ 0x9640,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD 6550D",kNull },
{ 0x9641,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD 6620G",kNull }, // Mobile
// SUMO2
// SUMO2
{ 0x9642,0x00000000, CHIP_FAMILY_SUMO2,"AMD Radeon HD 6370D",kNull },
{ 0x9643,0x00000000, CHIP_FAMILY_SUMO2,"AMD Radeon HD 6380G",kNull }, // Mobile
{ 0x9644,0x00000000, CHIP_FAMILY_SUMO2,"AMD Radeon HD 6410D",kNull },
{ 0x9645,0x00000000, CHIP_FAMILY_SUMO2,"AMD Radeon HD 6410D",kNull }, // Mobile
// SUMO
// SUMO
{ 0x9647,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD 6520G",kNull }, // Mobile
{ 0x9648,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD 6480G",kNull }, // Mobile
// SUMO2
// SUMO2
{ 0x9649,0x00000000, CHIP_FAMILY_SUMO2,"AMD Radeon(TM) HD 6480G",kNull }, // Mobile
// SUMO
// SUMO
{ 0x964A,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD 6530D",kNull },
//{ 0x964B,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD",kNull },
//{ 0x964C,0x00000000, CHIP_FAMILY_SUMO,"AMD Radeon HD",kNull },
{ 0x9807,0x00000000, CHIP_FAMILY_PALM,"AMD Radeon HD 6290 Graphics", kNull },
{ 0x9808,0x00000000, CHIP_FAMILY_PALM,"AMD Radeon HD 7340 Graphics", kNull },
{ 0x9809,0x00000000, CHIP_FAMILY_PALM,"AMD Radeon HD 7310 Graphics", kNull },
//{ 0x980A,0x00000000, CHIP_FAMILY_PALM,"AMD Radeon HD", kNull },
{ 0x980A,0x00000000, CHIP_FAMILY_PALM,"AMD Radeon HD 7290 Graphics", kNull },
// KABINI
//{ 0x9830,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9831,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x9832,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9833,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x9834,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9835,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x9836,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9837,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x9838,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9839,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
{ 0x9830,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8400", kNull }, // Mobile
{ 0x9831,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8400E", kNull },
{ 0x9832,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8330", kNull }, // Mobile
{ 0x9833,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8330E", kNull },
{ 0x9834,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8210", kNull }, // Mobile
{ 0x9835,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8210E", kNull },
{ 0x9836,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8280", kNull }, // Mobile
{ 0x9837,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8280E", kNull },
{ 0x9838,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8240", kNull }, // Mobile
{ 0x9839,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8180", kNull }, // Mobile
//{ 0x983A,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x983B,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull }, // Mobile
//{ 0x983C,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x983D,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
{ 0x983D,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD 8250", kNull },
//{ 0x983E,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
//{ 0x983F,0x00000000, CHIP_FAMILY_KABINI,"AMD Radeon HD", kNull },
{ 0x9907,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7620G", kNull }, // Mobile
{ 0x9908,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7600G", kNull }, // Mobile
//{ 0x9909,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x990A,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x990B,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x990C,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
//{ 0x990D,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x990E,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
//{ 0x990F,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
{ 0x990A,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7500G", kNull }, // Mobile
{ 0x990B,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8650G", kNull }, // Mobile
{ 0x990C,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8670D", kNull },
{ 0x990D,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8550G", kNull }, // Mobile
{ 0x990E,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8570D", kNull },
{ 0x990F,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8610G", kNull }, // Mobile
{ 0x9910,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7660G", kNull }, // Mobile
{ 0x9913,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7640G", kNull }, // Mobile
//{ 0x9917,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon", kNull },
//{ 0x9918,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon", kNull },
//{ 0x9919,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon", kNull },
{ 0x9917,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7620G", kNull },
{ 0x9918,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7600G", kNull },
{ 0x9919,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7500G", kNull },
{ 0x9990,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7520G", kNull }, // Mobile
{ 0x9991,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7540D", kNull },
{ 0x9992,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7420G", kNull }, // Mobile
//{ 0x9993,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
{ 0x9993,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7480D", kNull },
{ 0x9994,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7400G", kNull }, // Mobile
//{ 0x9995,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9996,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
//{ 0x9997,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x9998,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
//{ 0x9999,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x999A,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x999B,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x999C,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
//{ 0x999D,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
//{ 0x99A0,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x99A2,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull }, // Mobile
//{ 0x99A4,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD", kNull },
{ 0x9995,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8450G", kNull }, // Mobile
{ 0x9996,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8470D", kNull },
{ 0x9997,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8350G", kNull }, // Mobile
{ 0x9998,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8370D", kNull },
{ 0x9999,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8510G", kNull }, // Mobile
{ 0x999A,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8410G", kNull }, // Mobile
{ 0x999B,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8310G", kNull }, // Mobile
{ 0x999C,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8650D", kNull },
{ 0x999D,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 8550D", kNull },
{ 0x99A0,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7520G", kNull }, // Mobile
{ 0x99A2,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7420G", kNull }, // Mobile
{ 0x99A4,0x00000000, CHIP_FAMILY_ARUBA,"AMD Radeon HD 7400G", kNull },
{ 0x6610,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 250",kFutomaki},
{ 0x6613,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 240",kFutomaki},
{ 0x665C,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon HD 7790",kFutomaki},
{ 0x665D,0x00000000, CHIP_FAMILY_BONAIRE,"AMD Radeon R9 260",kFutomaki},
{ 0x0000,0x00000000, CHIP_FAMILY_UNKNOW,"AMD Unknown",kNull}
};
static const char *chip_family_name[] = {
"UNKNOW",
"R420",
"R423",
"RV410",
"RV515",
"R520",
"RV530",
"RV560",
"RV570",
"R580",
/* IGP */
"RS600",
"RS690",
"RS740",
"RS780",
"RS880",
/* R600 */
"R600",
"RV610",
"RV620",
"RV630",
"RV635",
"RV670",
/* R700 */
"RV710",
"RV730",
"RV740",
"RV770",
"RV772",
"RV790",
/* Evergreen */
// CYPRESS
//{ 0x6880,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD",kNull}, // Mobile
//{ 0x6888,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD",kNull},
//{ 0x6889,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD",kNull},
//{ 0x688A,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD",kNull},
//{ 0x688C,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD",kNull},
{ 0x688D,0x00000000, CHIP_FAMILY_CYPRESS,"AMD FireStream 9350",kZonalis},
{ 0x6898,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870 Series",kUakari},
{ 0x6899,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5850 Series",kUakari},
{ 0x689B,0x00000000, CHIP_FAMILY_CYPRESS,"AMD Radeon HD 6800 Series",kNull},
// HEMLOCK
{ 0x689C,0x00000000, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5970 Series",kUakari},
{ 0x689D,0x00000000, CHIP_FAMILY_HEMLOCK,"ATI Radeon HD 5900 Series",kUakari},
// CYPRESS
{ 0x689E,0x00000000, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5800 Series",kUakari},
// JUNIPER
{ 0x68A0,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kHoolock}, // Mobile
{ 0x68A1,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5850 Series",kHoolock}, // Mobile
{ 0x68A8,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6850M",kHoolock},
{ 0x68A9,0x00000000, CHIP_FAMILY_JUNIPER,"ATI FirePro V5800 (FireGL)",kHoolock},
{ 0x68B0,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kHoolock}, // Mobile
{ 0x68B1,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kHoolock},
{ 0x68B8,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5770 Series",kVervet},
{ 0x68B9,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5700 Series",kHoolock},
{ 0x68BA,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6770 Series",kHoolock},
{ 0x68BC,0x00000000, CHIP_FAMILY_JUNIPER,"AMD FireStream 9370",kHoolock},
{ 0x68BD,0x00000000, CHIP_FAMILY_JUNIPER,"AMD FireStream 9350",kHoolock},
{ 0x68BE,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 5750 Series",kHoolock},
{ 0x68BF,0x00000000, CHIP_FAMILY_JUNIPER,"ATI Radeon HD 6750 Series",kHoolock},
// REDWOOD
{ 0x68C0,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5730 Series",kBaboon}, // Mobile
{ 0x68C1,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5650 Series",kBaboon}, // Mobile
{ 0x68C7,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Mobility Radeon HD 5570",kEulemur}, // Mobile
{ 0x68C8,0x00000000, CHIP_FAMILY_REDWOOD,"ATI FirePro v4800", kBaboon},
{ 0x68C9,0x00000000, CHIP_FAMILY_REDWOOD,"FirePro 3D V3800",kBaboon},
{ 0x68D8,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5670 Series",kBaboon},
{ 0x68D9,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5570 Series",kBaboon},
{ 0x68DA,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5500 Series",kBaboon},
{ 0x68DE,0x00000000, CHIP_FAMILY_REDWOOD,"ATI Radeon HD 5000 Series",kNull},
// CEDAR
{ 0x68E0,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5470 Series",kEulemur},
{ 0x68E1,0x00000000, CHIP_FAMILY_CEDAR,"AMD Radeon HD 6230",kEulemur},
{ 0x68E4,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 6370M Series",kEulemur},
{ 0x68E5,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 6300M Series",kEulemur},
//{ 0x68E8,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
//{ 0x68E9,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
{ 0x68F1,0x00000000, CHIP_FAMILY_CEDAR,"AMD FirePro 2460",kEulemur},
{ 0x68F2,0x00000000, CHIP_FAMILY_CEDAR,"AMD FirePro 2270",kEulemur},
//{ 0x68F8,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
{ 0x68F9,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 5450 Series",kEulemur},
{ 0x68FA,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD 7300 Series",kEulemur},
//{ 0x68FE,0x00000000, CHIP_FAMILY_CEDAR,"ATI Radeon HD ??? Series",kNull},
/* Northen Islands */
// CAYMAN
{ 0x6701,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6702,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6703,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6704,0x00000000, CHIP_FAMILY_CAYMAN,"AMD FirePro V7900",kLotus},
{ 0x6705,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6706,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6707,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6708,0x00000000, CHIP_FAMILY_CAYMAN,"AMD FirePro V5900",kLotus},
{ 0x6709,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6xxx Series",kLotus},
{ 0x6718,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kLotus},
{ 0x6719,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950 Series",kLotus},
{ 0x671C,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6970 Series",kLotus},
{ 0x671D,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6950 Series",kLotus},
{ 0x671F,0x00000000, CHIP_FAMILY_CAYMAN,"AMD Radeon HD 6930 Series",kLotus},
// BARTS
{ 0x6720,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kFanwort},
{ 0x6722,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kFanwort},
{ 0x6729,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6900M Series",kFanwort},
{ 0x6738,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6870 Series",kDuckweed},
{ 0x6739,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6850 X2",kDuckweed},
{ 0x673E,0x00000000, CHIP_FAMILY_BARTS,"AMD Radeon HD 6790 Series",kDuckweed},
// TURKS
{ 0x6740,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6770M Series",kCattail},
{ 0x6741,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6750M",kCattail},
{ 0x6742,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7500/7600 Series",kCattail},
{ 0x6745,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6600M Series",kCattail},
{ 0x6749,0x00000000, CHIP_FAMILY_TURKS,"ATI Radeon FirePro V4900",kPithecia},
{ 0x674A,0x00000000, CHIP_FAMILY_TURKS,"AMD FirePro V3900",kPithecia},
{ 0x6750,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kPithecia},
{ 0x6758,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6670 Series",kPithecia},
{ 0x6759,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6570 Series",kPithecia},
{ 0x675B,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600 Series",kPithecia},
{ 0x675D,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7570M Series",kCattail},
{ 0x675F,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 6510 Series",kPithecia},
// CAICOS
{ 0x6760,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6470M Series",kHydrilla},
{ 0x6761,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6430M Series",kHydrilla},
{ 0x6763,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon E6460 Series",kHydrilla},
{ 0x6768,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400M Series",kHydrilla},
{ 0x6770,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6400 Series",kBulrushes},
{ 0x6772,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400A Series",kBulrushes},
{ 0x6778,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7000 Series",kBulrushes},
{ 0x6779,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 6450/7450/8450/R5 230",kBulrushes},
{ 0x677B,0x00000000, CHIP_FAMILY_CAICOS,"AMD Radeon HD 7400 Series",kBulrushes},
/* Southen Islands */
// TAHITI
//Framebuffers: Aji - 4 Desktop, Buri - 4 Mobile, Chutoro - 5 Mobile, Dashimaki - 4, IkuraS - HMDI
// Ebi - 5 Mobile, Gari - 5 M, Futomaki - 4 D, Hamachi - 4 D, OPM - 6 Server, Ikura - 6
{ 0x6780,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6784,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6788,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x678A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6790,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6791,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6792,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x6798,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7970X/8970/R9 280X",kFutomaki},
{ 0x6799,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7990 Series",kAji},
{ 0x679A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950/8950/R9 280",kFutomaki},
{ 0x679B,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x679E,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7870 XT",kFutomaki},
{ 0x679F,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950 Series",kFutomaki},
// HAWAII
//{ 0x67A0,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A1,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A2,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A8,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67A9,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67AA,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
{ 0x67B0,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290X", kBaladi},
{ 0x67B1,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon R9 290", kBaladi}, // CHIP_FAMILY_HAWAII
//{ 0x67B8,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67B9,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67BA,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
//{ 0x67BE,0x00000000, CHIP_FAMILY_HAWAII,"AMD Radeon", kFutomaki},
// PITCAIRN
{ 0x6800,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7970M",kBuri}, // Mobile
//{ 0x6801,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 8970M Series",kFutomaki}, // Mobile
//{ 0x6802,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD ???M Series",kFutomaki}, // Mobile
{ 0x6806,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7600 Series",kFutomaki},
{ 0x6808,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7600 Series",kFutomaki},
//{ 0x6809,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD ??? Series",kNull},
{ 0x6810,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon R9 270X",kFutomaki},
{ 0x6811,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon R9 270",kFutomaki},
//{ 0x6816,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon",kFutomaki},
//{ 0x6817,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon",kFutomaki},
{ 0x6818,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7870 Series",kFutomaki},
{ 0x6819,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD 7850 Series",kFutomaki},
// VERDE
{ 0x6820,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x6821,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
//{ 0x6822,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD",kBuri}, // Mobile
//{ 0x6823,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 8800M Series",kBuri}, // Mobile
//{ 0x6824,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700M Series",kBuri}, // Mobile
{ 0x6825,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7800M Series",kPondweed}, // Mobile
{ 0x6826,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x6827,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7800M Series",kPondweed}, // Mobile
//{ 0x6828,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD ??? Series",kBuri},
//{ 0x6829,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD ??? Series",kBuri},
//{ 0x682A,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD",kBuri}, // Mobile
{ 0x682B,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 8800M Series",kBuri}, // Mobile
{ 0x682D,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
{ 0x682F,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7730 Series",kBuri}, // Mobile
{ 0x6830,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7800M Series",kBuri}, // Mobile
{ 0x6831,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri}, // Mobile
//{ 0x6835,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD",kBuri},
{ 0x6837,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x6838,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x6839,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x683B,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7700 Series",kBuri},
{ 0x683D,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7770 Series",kBuri},
{ 0x683F,0x00000000, CHIP_FAMILY_VERDE,"AMD Radeon HD 7750 Series",kBuri},
// TURKS
{ 0x6840,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7670M Series",kPondweed}, // Mobile
{ 0x6841,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7650M Series",kPondweed}, // Mobile
{ 0x6842,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed}, // Mobile
{ 0x6843,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7670M Series",kPondweed}, // Mobile
{ 0x6849,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed},
// PITCAIRN
//{ 0x684C,0x00000000, CHIP_FAMILY_PITCAIRN,"AMD Radeon HD",kNull},
// TURKS
{ 0x6850,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed },
{ 0x6858,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7400 Series",kPondweed },
{ 0x6859,0x00000000, CHIP_FAMILY_TURKS,"AMD Radeon HD 7600M Series",kPondweed },
{ 0x0000,0x00000000, CHIP_FAMILY_UNKNOW,"AMD Unknown",kNull}
"Cedar",
"Cypress",
"Hemlock",
"Juniper",
"Redwood",
/* Northern Islands */
"Barts",
"Caicos",
"Cayman",
"Turks",
/* Southern Islands */
"Palm",
"Sumo",
"Sumo2",
"Aruba",
"Tahiti",
"Pitcairn",
"Verde",
"Oland",
"Hainan",
"Bonaire",
"Kaveri",
"Kabini",
"Hawaii",
/* ... */
"Mullins",
""
};
dev_prop_t ati_devprop_list[] = {
AtiDevProp ati_devprop_list[] = {
{FLAGTRUE,false,"@0,AAPL,boot-display",get_bootdisplay_val,NULVAL},
//{FLAGTRUE,false,"@0,ATY,EFIDisplay",NULL,STRVAL("TMDSA")},
{FLAGTRUE,false,NULL,NULL,NULVAL}
};
bool get_hdmiaudio(value_t * val)
{
bool doit = false;
if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit){
val->type = kStr;
val->size = strlen("onboard-1") + 1;
val->data = (uint8_t *)"onboard-1";
return true;
}
return false;
}
bool get_bootdisplay_val(value_t *val)
{
static uint32_t v = 0;
return true;
}
bool get_hdmiaudio(value_t * val)
{
bool doit = false;
if(getBoolForKey(kEnableHDMIAudio, &doit, &bootInfo->chameleonConfig) && doit)
{
val->type = kStr;
val->size = strlen("onboard-1") + 1;
val->data = (uint8_t *)"onboard-1";
return true;
}
return false;
}
bool get_vrammemory_val(value_t *val)
{
return false;
bzero(val, sizeof(value_t));
}
void devprop_add_list(dev_prop_t devprop_list[])
void devprop_add_list(AtiDevProp devprop_list[])
{
int i, pnum;
value_t *val = malloc(sizeof(value_t));
if (rom_header->signature != 0xaa55)
{
//verbose("invalid ROM signature %x\n", rom_header->signature);
return false;
}
if (rom_pci_header->signature != 0x52494350)
{
//verbose("invalid ROM header %x\n", rom_pci_header->signature);
return false;
}
if (rom_pci_header->vendor_id != pci_dev->vendor_id || rom_pci_header->device_id != pci_dev->device_id)
{
//verbose("invalid ROM vendor=%x deviceID=%d\n", rom_pci_header->vendor_id, rom_pci_header->device_id);
return false;
}
if (!validate_rom((option_rom_header_t *)card->rom, card->pci_dev))
{
verbose("validate_rom fails\n");
card->rom_size = 0;
card->rom = 0;
return false;
if (!validate_rom(rom_addr, card->pci_dev))
{
verbose("There is no ROM @0x%x\n", rom_addr);
return false;
}
card->rom_size = rom_addr->rom_size * 512;
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys.vendor_id, pci_dev->subsys_id.subsys.device_id);
return false;
}
verbose("Found ATI card! Device ID:[%04X:%04X] Subsystem ID:[%08X] - Radeon [%04X:%08X] %s\n",
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id, card->info->device_id, card->info->subsys_id, card->info->model_name);
card->fb= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_0) & ~0x0f);
card->mmio= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f);
if (card->info->chip_family >= CHIP_FAMILY_CEDAR)
{
verbose("ATI Radeon EVERGREEN family\n");
card->flags |= EVERGREEN;
}
branches/zenith432/i386/libsaio/sys.c
7878
7979
8080
81
82
83
84
8185
8286
8387
......
954958
955959
956960
957
958
959
960
961
962
963
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
964977
965
978
979
966980
967981
968982
......
10121026
10131027
10141028
1029
10151030
10161031
1017
1032
1033
10181034
10191035
10201036
......
10401056
10411057
10421058
1059
1060
10431061
10441062
10451063
#define DBG(x...)msglog(x)
#endif
#ifndef DEBUG_FEATURE_LAST_BOOT
#define DEBUG_FEATURE_LAST_BOOT 0 // AllocateKernelMemory error with feature from 2562
#endif
extern int multiboot_partition;
extern int multiboot_partition_set;
extern int multiboot_skip_partition;
BVRef selectBootVolume(BVRef chain)
{
bool filteredChain = false;
bool foundPrimary = false;
BVRef bvr= NULL;
BVRef bvr1= NULL;
BVRef bvr2= NULL;
char dirSpec[] = "hd(%d,%d)/", fileSpec[] = "Volumes", *label;
u_int32_t time, lasttime = 0;
bool filteredChain= false;
bool foundPrimary= false;
BVRef bvr= NULL;
BVRef bvr1= NULL;
BVRef bvr2= NULL;
#if DEBUG_FEATURE_LAST_BOOT
char dirSpec[]= "hd(%d,%d)/";
char fileSpec[]= "Volumes";
#endif
char *label;
#if DEBUG_FEATURE_LAST_BOOT
u_int32_t time;
u_int32_t lasttime= 0;
long flags;
#endif
if (chain->filtered)
{
filteredChain = true;
free(val);
}
#if DEBUG_FEATURE_LAST_BOOT // the above code cause "AllocateKernelMemory error"
// Bungo: select last booted partition as the boot volume
// TODO: support other OSes (foreign boot)
for (bvr = chain; bvr; bvr = bvr->next) {
for (bvr = chain; bvr; bvr = bvr->next)
{
if (bvr->flags & (kBVFlagSystemVolume | kBVFlagForeignBoot))
{
time = 0;
// Bungo: code below selects first partition in the chain (last partition on disk),
// in my case Recovery HD, as boot volume, so I would prefer last booted partition
// as default boot volume - see the code above
#endif
/*
* Scannig the volume chain backwards and trying to find
* a HFS+ volume with valid boot record signature.
branches/zenith432/i386/libsaio/nbp.c
107107
108108
109109
110
110
111111
112112
113113
static void NBPGetDescription(CICell ih, char * str, long strMaxLen)
{
sprintf( str, "Ethernet PXE Client" );
snprintf( str, strMaxLen, "Ethernet PXE Client" );
}
//==========================================================================
branches/zenith432/i386/libsaio/load.c
301301
302302
303303
304
304
305305
306306
307307
stop("Kernel overflows available space");
}
if (vmsize && ((strcmp(segname, "__PRELINK_INFO") == 0) || (strcmp(segname, "__PRELINK") == 0)))
if (vmsize && ((strncmp(segname, "__PRELINK_INFO", sizeof("__PRELINK_INFO")) == 0) || (strncmp(segname, "__PRELINK", sizeof("__PRELINK")) == 0)))
{
gHaveKernelCache = true;
}
branches/zenith432/i386/libsaio/ati.h
1717
1818
1919
20
2120
22
23
21
22
2423
2524
26
27
28
29
30
25
3126
3227
3328
......
107102
108103
109104
105
106
107
108
109
110
110111
111112
112113
......
168169
169170
170171
171
172
173
174
175
176
177
178
172
173
174
175
176
177
178
179
180
179181
180182
181183
184
185
186
187
188
189
182190
183191
192
184193
185194
195
186196
187
197
188198
189
190
191
192
193
194
195
196
197
198
199
200
201
202199
203200
204
205
206
207
208
201
202
203
204
205
209206
210207
211
212208
213
214
215
216
217
218
219
220
221209
222210
223211
......
234222
235223
236224
225
226
227
228
229
230
231
237232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
238249
239250
240251
......
253264
254265
255266
256
257
258
259
260
261267
#include "ati_reg.h"
/* DEFINES */
#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e
#define Reg32(reg)(*(volatile uint32_t *)(card->mmio + reg))
#define RegRead32(reg)(Reg32(reg))
#define Reg32(reg)(*(volatile uint32_t *)(card->mmio + reg))
#define RegRead32(reg)(Reg32(reg))
#define RegWrite32(reg, value)(Reg32(reg) = value)
/* Flags */
#define MKFLAG(n)(1 << n)
#define FLAGTRUEMKFLAG(0)
#define EVERGREENMKFLAG(1)
#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e
#define DATVAL(x){kPtr, sizeof(x), (uint8_t *)x}
#define STRVAL(x){kStr, sizeof(x), (uint8_t *)x}
#define BYTVAL(x){kCst, 1, (uint8_t *)x}
CHIP_FAMILY_LAST
} ati_chip_family_t;
//card to #ports
typedef struct {
const char*name;
uint8_tports;
} card_config_t;
typedef enum {
kNull,
/* OLDController */
kSpikerush,
kTypha,
/* AMD7000Controller */
kAji, //4
kBuri, //4 M
kChutoro, //5 M
kDashimaki, //4
kEbi, //5 M
kGari, //5 M
kFutomaki, //5
kHamachi, //4
kNamako,
kAji,
kBuri,
kChutoro,
kDashimaki,
kEbi,
kGari,
kFutomaki,
kHamachi,
kOPM,
kIkura,
kIkuraS,
kJunsai,
kKani,
kKaniS,
kDashimakiS,
kMaguro,
kMaguroS,
/* AMD8000Controller */
kBaladi,
/* AMD9000Controller */
kExmoor,
kBasset,
kGreyhound,
kCfgEnd
} ati_config_name_t;
} config_name_t;
/* Typedefs STRUCTS */
typedef struct {
type_ttype;
uint32_tsize;
uint8_t*data;
} value_t;
//card to #ports
typedef struct {
const char*name;
uint8_tports;
} card_config_t;
//radeon card (includes teh AtiConfig)
typedef struct {
uint16_tdevice_id;
uint32_tsubsys_id;
ati_chip_family_tchip_family;
const char*model_name;
ati_config_name_tcfg_name;
uint16_tdevice_id;
uint32_tsubsys_id;
ati_chip_family_tchip_family;
const char*model_name;
config_name_tcfg_name;
} radeon_card_info_t;
// dev_tree representation
typedef struct {
uint32_tflags;
boolall_ports;
char*name;
bool(*get_value)(value_t *val);
value_tdefault_val;
} dev_prop_t;
typedef struct {
struct DevPropDevice*device;
radeon_card_info_t*info;
pci_dt_t*pci_dev;
} card_t;
/* Flags */
#define MKFLAG(n)(1 << n)
#define FLAGTRUEMKFLAG(0)
#define EVERGREENMKFLAG(1)
#define FLAGMOBILEMKFLAG(2)
#define FLAGOLDMKFLAG(3)
#define FLAGNOTFAKEMKFLAG(4)
/* Typedefs STRUCTS */
typedef struct {
type_ttype;
uint32_tsize;
uint8_t*data;
} value_t;
// dev_tree representation
typedef struct {
uint32_tflags;
boolall_ports;
char*name;
bool(*get_value)(value_t *val);
value_tdefault_val;
} AtiDevProp;
/* functions */
bool get_bootdisplay_val(value_t *val);
bool get_vrammemory_val(value_t *val);
bool get_vramtotalsize_val(value_t *val);
bool get_hdmiaudio(value_t * val);
/* vals */
static value_t aty_name;
static value_t aty_nameparent;
card_t *card;
#endif
branches/zenith432/i386/libsaio/cpu.c
1616
1717
1818
19
19
2020
2121
2222
......
2828
2929
3030
31
31
3232
33
33
3434
3535
3636
......
5151
5252
5353
54
54
5555
5656
5757
5858
59
59
6060
6161
6262
6363
6464
65
65
6666
6767
6868
......
316316
317317
318318
319
319320
320321
321322
322323
323324
324325
326
325327
326328
327329
......
460462
461463
462464
463
464
465
466
465467
466468
467469
......
512514
513515
514516
515
517
516518
517519
518520
......
786788
787789
788790
789
791
792
793
794
790795
791
796
792797
793798
794799
#if DEBUG_CPU
#define DBG(x...)printf(x)
#else
#define DBG(x...)msglog(x)
#define DBG(x...)
#endif
/*
static uint64_t timeRDTSC(void)
{
intattempts = 0;
uint64_t latchTime;
uint64_t latchTime;
uint64_tsaveTime,intermediate;
unsigned int timerValue, lastValue;
unsigned inttimerValue, lastValue;
//boolean_tint_enabled;
/*
* Table of correction factors to account for
ROUND64(SAMPLE_MULTIPLIER/(double)(SAMPLE_CLKS_INT-5))
};
//int_enabled = ml_set_interrupts_enabled(FALSE);
//int_enabled = ml_set_interrupts_enabled(false);
restart:
if (attempts >= 9) // increase to up to 9 attempts.
{
// This will flash-reboot. TODO: Use tscPanic instead.
// This will flash-reboot. TODO: Use tscPanic instead.
printf("Timestamp counter calibation failed with %d attempts\n", attempts);
}
attempts++;
enable_PIT2();// turn on PIT2
set_PIT2(0);// reset timer 2 to be zero
latchTime = rdtsc64();// get the time stamp to time
latchTime = rdtsc64();// get the time stamp to time
latchTime = get_PIT2(&timerValue) - latchTime; // time how long this takes
set_PIT2(SAMPLE_CLKS_INT);// set up the timer for (almost) 1/20th a second
saveTime = rdtsc64();// now time how long a 20th a second is...
{
do_cpuid(5, p->CPU.CPUID[CPUID_5]);
}
if (p->CPU.CPUID[CPUID_0][0] >= 6)// Thermal/Power
{
do_cpuid(6, p->CPU.CPUID[CPUID_6]);
}
do_cpuid(0x80000000, p->CPU.CPUID[CPUID_80]);
if ((p->CPU.CPUID[CPUID_80][0] & 0x0000000f) >= 8)
{
do_cpuid(0x80000008, p->CPU.CPUID[CPUID_88]);
// MSR is *NOT* available on the Intel Atom CPU
if ((p->CPU.Model == CPUID_MODEL_ATOM) && (strstr(p->CPU.BrandString, "270")))
{
p->CPU.NoCores= 1;
p->CPU.NoThreads= 2;
p->CPU.NoCores= 1;
p->CPU.NoThreads= 2;
}
/* setup features */
tscFrequency = measure_tsc_frequency();
DBG("cpu freq classic = 0x%016llx\n", tscFrequency);
/* if usual method failed */
// if usual method failed
if ( tscFrequency < 1000 )//TEST
{
tscFrequency = timeRDTSC() * 20;//measure_tsc_frequency();
DBG("%d\n", currcoef);
}
}
if (!cpuFrequency) cpuFrequency = tscFrequency;
if (!cpuFrequency)
{
cpuFrequency = tscFrequency;
}
}
#if 0
if (!fsbFrequency)
{
branches/zenith432/i386/libsaio/disk.c
233233
234234
235235
236
236
237237
238238
239239
......
263263
264264
265265
266
266
267267
268268
269269
......
13311331
13321332
13331333
1334
1334
13351335
13361336
13371337
......
17251725
17261726
17271727
1728
1728
17291729
17301730
17311731
1732
1732
17331733
17341734
17351735
17361736
17371737
1738
1738
17391739
17401740
17411741
1742
1742
17431743
17441744
17451745
17461746
1747
1747
17481748
17491749
17501750
......
17531753
17541754
17551755
1756
17571756
1758
1759
1760
1761
1757
1758
1759
1760
1761
17621762
1763
1764
1765
1766
1767
1768
1769
1763
17701764
1771
1765
1766
1767
1768
17721769
17731770
17741771
1775
1772
17761773
17771774
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
17891775
1790
1776
1777
1778
17911779
1792
1793
1794
1795
1796
1797
1798
1799
1780
1781
18001782
18011783
18021784
......
18101792
18111793
18121794
1795
1796
1797
18131798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
18141822
18151823
18161824
......
18361844
18371845
18381846
1839
1840
1847
1848
18411849
18421850
18431851
1844
1852
1853
1854
18451855
18461856
18471857
......
18601870
18611871
18621872
1863
1873
18641874
18651875
18661876
......
21912201
21922202
21932203
2194
2204
21952205
21962206
21972207
......
22812291
22822292
22832293
2284
2294
22852295
22862296
22872297
......
23012311
23022312
23032313
2304
2305
2314
2315
2316
2317
2318
2319
2320
23062321
23072322
23082323
......
23362351
23372352
23382353
2339
2354
23402355
23412356
23422357
......
23452360
23462361
23472362
2348
2363
23492364
23502365
23512366
//==========================================================================
static const char * getNameForValue( const struct NamedValue * nameTable,
static const char *getNameForValue( const struct NamedValue *nameTable,
unsigned char value )
{
const struct NamedValue *np;
return errname;
}
sprintf(errorstr, "Error 0x%02x", errnum);
snprintf(errorstr, sizeof(errorstr), "Error 0x%02x", errnum);
return errorstr; // No string, print error code only
}
dpme.dpme_boot_block);
*/
if (strcmp(dpme_p->dpme_type, "Apple_HFS") == 0)
if (strncmp(dpme_p->dpme_type, "Apple_HFS", sizeof("Apple_HFS")) == 0)
{
bvr = newAPMBVRef(biosdev,
i,
if (!valid)
{
// OS X Standard
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/System/Library/CoreServices/SystemVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
bvr->OSisInstaller = true;
bvr->OSisInstaller = false;
valid = true;
}
else
{
// OS X Server
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/System/Library/CoreServices/ServerVersion.plist", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
bvr->OSisServer = true;
bvr->OSisServer = false;
valid = true;
}
/*else
{
sprintf(dirSpec, "hd(%d,%d)/.IAProductInfo", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/.IAProductInfo", BIOS_DEV_UNIT(bvr), bvr->part_no);
if (!loadConfigFile(dirSpec, &systemVersion))
{
}
*/
}
}
if (valid)
{
const char *val;
int len;
if ( LION )
{
int fh = -1;
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (getValueForKey(kProductVersion, &val, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim
*str = '\0';
// crazybirdy
if (len > 4 && (val[3] == '1'))
if (fh >= 0)
{
strncat(str, val, MIN(len, 5));
valid = true;
bvr->OSisInstaller = true;
strcpy(bvr->OSVersion, "10.7"); // 10.7 +
close(fh);
}
else
{
strncat(str, val, MIN(len, 4));
close(fh);
}
}
else
{
valid = false;
}
}
if(!valid)
{
int fh = -1;
sprintf(dirSpec, "hd(%d,%d)/.PhysicalMediaInstall", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0)
// Mountain Lion ?
if ( MAVERICKS )
{
valid = true;
bvr->OSisInstaller = true;
strcpy(bvr->OSVersion, "10.7"); // 10.7 +
close(fh);
}
else
{
sprintf(dirSpec, "hd(%d,%d)/.IAPhysicalMedia", BIOS_DEV_UNIT(bvr), bvr->part_no);
int fh = -1;
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/.IAPhysicalMedia", BIOS_DEV_UNIT(bvr), bvr->part_no);
fh = open(dirSpec, 0);
if (fh >= 0)
close(fh);
}
}
// Yosemite ?
}
if (valid)
{
const char *val;
int len;
if (getValueForKey(kProductVersion, &val, &len, &systemVersion))
{
// getValueForKey uses const char for val
// so copy it and trim
*str = '\0';
strncat(str, val, MIN(len, 5));
if(str[4] == '.')
{
str[4] = '\0';
}
}
else
{
valid = false;
}
}
return valid;
}
//
if (bvr->flags & kBVFlagBooter)
{
sprintf(dirSpec, "hd(%d,%d)/System/Library/CoreServices/", BIOS_DEV_UNIT(bvr), bvr->part_no);
strcpy(fileSpec, ".disk_label.contentDetails");
snprintf(dirSpec, sizeof(dirSpec), "hd(%d,%d)/System/Library/CoreServices/", BIOS_DEV_UNIT(bvr), bvr->part_no);
strlcpy(fileSpec, ".disk_label.contentDetails", sizeof(fileSpec));
ret = GetFileInfo(dirSpec, fileSpec, &flags, &time);
if (!ret)
{
fh = open(strcat(dirSpec, fileSpec), 0);
strlcat(dirSpec, fileSpec, sizeof(dirSpec));
fh = open(dirSpec,0);
fileSize = file_size(fh);
if (fileSize > 0 && fileSize < BVSTRLEN)
{
if (!error)
{
label[fileSize] = '\0';
strcpy(bvr->altlabel, label);
strlcpy(bvr->altlabel, label, sizeof(bvr->altlabel));
}
}
}
}
// Try to match hd(x,y) first.
sprintf(testStr, "hd(%d,%d)", BIOS_DEV_UNIT(bvr), bvr->part_no);
snprintf(testStr, sizeof(testStr), "hd(%d,%d)", BIOS_DEV_UNIT(bvr), bvr->part_no);
if ( matchLen ? !strncmp(match, testStr, matchLen) : !strcmp(match, testStr) )
{
return true;
//==============================================================================
void getBootVolumeDescription( BVRef bvr, char * str, long strMaxLen, bool useDeviceDescription )
void getBootVolumeDescription( BVRef bvr, char *str, long strMaxLen, bool useDeviceDescription )
{
unsigned char type;
char *p = str;
return;
}
strcpy(str + len, bvr->OSisInstaller ? " (Installer) " : " ");
len += bvr->OSisInstaller ? 13 : 1;
strcpy(str + len, bvr->OSisInstaller ? " (Installer " : " (");
len += bvr->OSisInstaller ? 12 : 2;
strcpy(str + len, bvr->OSVersion);
len += strlen(bvr->OSVersion);
strcpy(str + len, ") ");
len += 2;
strMaxLen -= len;
p += len;
}
if (name == NULL)
{
sprintf(p, "TYPE %02X", type);
snprintf(p, strMaxLen, "TYPE %02X", type);
}
else
{
}
// Set the devices label
sprintf(bvr->label, p);
snprintf(bvr->label, sizeof(bvr->label), p);
}
branches/zenith432/i386/libsaio/convert.c
1313
1414
1515
16
16
1717
1818
1919
static char msg[UUID_LEN*2 + 8] = "";
if (!eUUID) return "";
const unsigned char * uuid = (unsigned char*) eUUID;
sprintf(msg, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
snprintf(msg, sizeof(msg), "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10],uuid[11],
branches/zenith432/i386/libsaio/misc.c
7171
7272
7373
74
74
7575
7676
7777
//==========================================================================
// Enable A20 gate to be able to access memory above 1MB
static inline void flushKeyboardInputBuffer();
static inline void flushKeyboardInputBuffer()
{
unsigned char ret;
branches/zenith432/i386/boot2/drivers.c
203203
204204
205205
206
206
207207
208208
209209
......
215215
216216
217217
218
218
219219
220220
221221
......
228228
229229
230230
231
232
233
234
235
236
231
232
233
234
235
236
237
238
239
237240
238241
239242
......
250253
251254
252255
253
256
254257
255258
256259
......
352355
353356
354357
355
358
356359
357360
358361
......
514517
515518
516519
517
520
518521
519522
520523
......
532535
533536
534537
535
538
536539
537540
538541
......
546549
547550
548551
552
549553
550554
551555
552556
557
553558
554559
560
555561
556562
557563
558564
565
559566
560567
561568
......
708715
709716
710717
711
718
712719
713720
714721
715722
716
723
717724
718725
719726
}
// Next try to load Extra extensions from the selected root partition.
strcpy(dirSpecExtra, "/Extra/");
strlcpy(dirSpecExtra, "/Extra/", sizeof(dirSpecExtra));
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// If failed, then try to load Extra extensions from the boot partition
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0) {
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
strlcpy(dirSpecExtra, "bt(0,0)/Extra/", sizeof(dirSpecExtra));
FileLoadDrivers(dirSpecExtra, 0);
}
}
// The /Extra code is not disabled in this case due to a kernel patch that allows for this to happen.
// Also try to load Extensions from boot helper partitions.
if (gBootVolume->flags & kBVFlagBooter) {
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0) {
strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0) {
strcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/");
if (gBootVolume->flags & kBVFlagBooter)
{
strlcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/", sizeof(dirSpecExtra));
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strlcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/", sizeof(dirSpecExtra));
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strlcpy(dirSpecExtra, "/com.apple.boot.S/System/Library/", sizeof(dirSpecExtra));
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
else
{
if (MacOSVerCurrent >= MacOSVer2Int("10.9")) // issue 352
if ( MAVERICKS || YOSEMITE ) // issue 352
{
strlcpy(gExtensionsSpec, dirSpec, 4087); /* 4096 - sizeof("Library/") */
strcat(gExtensionsSpec, "Library/");
// Make sure this is a kext.
length = strlen(name);
if (strcmp(name + length - 5, ".kext"))
if (strncmp(name + length - 5, ".kext", 5))
{
continue;
}
if (tmpExecutablePath == 0) {
break;
}
strcpy(tmpExecutablePath, gFileSpec);
strlcpy(tmpExecutablePath, gFileSpec, executablePathLength);
if(name)
{
break;
}
strcpy(tmpBundlePath, gFileSpec);
strlcpy(tmpBundlePath, gFileSpec, bundlePathLength);
// Construct the file spec to the plist, then load it.
}
length = LoadFile(gFileSpec);
if (length == -1)
{
break;
}
length = length + 1;
buffer = malloc(length);
if (buffer == 0)
{
break;
}
strlcpy(buffer, (char *)kLoadAddr, length);
// Parse the plist.
driver->bundlePathLength = module->bundlePathLength;
// Save the plist, module and bundle.
strcpy(driver->plistAddr, module->plistAddr);
strlcpy(driver->plistAddr, module->plistAddr,driver->plistLength);
if (length != 0)
{
memcpy(driver->executableAddr, executableAddr, length);
}
strcpy(driver->bundlePathAddr, module->bundlePath);
strlcpy(driver->bundlePathAddr, module->bundlePath, module->bundlePathLength);
// Add an entry to the memory map.
snprintf(segName, sizeof(segName), "Driver-%lx", (unsigned long)driver);
branches/zenith432/i386/boot2/boot.c
152152
153153
154154
155
156
155157
156158
157159
......
225227
226228
227229
228
230
229231
230232
233
234
235
236
237
238
239
231240
232241
233242
......
236245
237246
238247
239
240
241
242
243248
244
245
246
247249
248250
249251
......
251253
252254
253255
254
256
255257
256258
257259
......
273275
274276
275277
276
277
278
279
278280
279
280
281
282
283
284
285
286
287
281288
282289
283
290
284291
285
286
287
288
292
293
289294
290
291
292
295
296
297
293298
294
299
295300
296
297
301
302
303
304
298305
299
306
307
300308
301
302
303
304
305
306
309
310
307311
308
309312
310
313
311314
312
313
314
315
316
317
318
319
320
321
315
322316
317
318
319
320
321
322
323
324
323325
324326
325327
......
620622
621623
622624
623
625
624626
627
628
629
630
625631
626632
633
634
635
636
627637
628638
629639
630
640
631641
632642
633643
......
749759
750760
751761
752
753
754
762
763
764
755765
756766
757767
758768
759769
760
770
761771
762
772
763773
764774
765775
766
776
767777
768778
769779
......
886896
887897
888898
899
889900
890901
891902
if ( ret != 0 )
{
printf("Decoding kernel failed.\n");
pause();
return ret;
}
finalizeBootStruct();
// Jump to kernel's entry point. There's no going back now.
if (MacOSVerCurrent >= MacOSVer2Int("10.7"))
if ( TIGER || LEOPARD || SNOW_LEOPARD )
{
// Notify modules that the kernel is about to be started
execute_hook("Kernel Start", (void *)kernelEntry, (void *)bootArgsPreLion, NULL, NULL);
startprog( kernelEntry, bootArgsPreLion );
}
else
{
// Notify modules that the kernel is about to be started
execute_hook("Kernel Start", (void *)kernelEntry, (void *)bootArgs, NULL, NULL);
// Masking out so that Lion doesn't doublefault
startprog( kernelEntry, bootArgs );
}
else
{
// Notify modules that the kernel is about to be started
execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgsPreLion, NULL, NULL);
startprog( kernelEntry, bootArgsPreLion );
}
// Not reached
__builtin_unreachable();
}
//==========================================================================
// LoadKernelCache - Try to load Kernel Cache.
// return the length of the loaded cache file or -1 on error
long LoadKernelCache(const char* cacheFile, void **binary)
long LoadKernelCache(const char *cacheFile, void **binary)
{
charkernelCacheFile[512];
charkernelCachePath[512];
}
else
{
// Lion, Mountain Lion, Mavericks and Yosemite prelink kernel cache file
if (MacOSVerCurrent >= MacOSVer2Int("10.7")) // OSX is Lion (10.7) or newer
// Leopard prelink kernel cache file
if ( TIGER || LEOPARD ) // OSX is 10.4 or 10.5
{
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow);
verbose("Kernel Cache file path (Mac OS X 10.7 and newer): %s\n", kernelCacheFile);
// Reset cache name.
bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64);
snprintf(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64, "%s,%s", gRootDevice, bootInfo->bootFile);
adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler));
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%s.%08lX", kDefaultCachePathLeo, adler32);
verbose("Reseted kernel cache file path: %s\n", kernelCacheFile);
}
// Snow Leopard prelink kernel cache file
else
else if ( SNOW_LEOPARD )
{
if (MacOSVerCurrent >= MacOSVer2Int("10.6")) // OSX is Snow (10.6)
{
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "kernelcache_%s",
(archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64");
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "kernelcache_%s",
(archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64");
intlnam = strlen(kernelCacheFile) + 9; //with adler32
char*name;
u_int32_t prev_time = 0;
intlnam = strlen(kernelCacheFile) + 9; //with adler32
char*name;
u_int32_tprev_time = 0;
struct dirstuff* cacheDir = opendir(kDefaultCachePathSnow);
struct dirstuff *cacheDir = opendir(kDefaultCachePathSnow);
/* TODO: handle error? */
if (cacheDir)
/* TODO: handle error? */
if (cacheDir)
{
while(readdir(cacheDir, (const char**)&name, &flags, &time) >= 0)
{
while(readdir(cacheDir, (const char**)&name, &flags, &time) >= 0)
if (((flags & kFileTypeMask) != kFileTypeDirectory) && time > prev_time
&& strstr(name, kernelCacheFile) && (name[lnam] != '.'))
{
if (((flags & kFileTypeMask) != kFileTypeDirectory) && time > prev_time
&& strstr(name, kernelCacheFile) && (name[lnam] != '.'))
{
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%s%s", kDefaultCachePathSnow, name);
prev_time = time;
}
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%s%s", kDefaultCachePathSnow, name);
prev_time = time;
}
verbose("Kernel Cache file path (Mac OS X 10.6.X): %s\n", kernelCacheFile);
}
closedir(cacheDir);
verbose("Kernel Cache file path (Mac OS X 10.6.X): %s\n", kernelCacheFile);
}
else
{
// Leopard prelink kernel cache file
// Reset cache name.
bzero(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64);
snprintf(gCacheNameAdler + 64, sizeof(gCacheNameAdler) - 64, "%s,%s", gRootDevice, bootInfo->bootFile);
adler32 = Adler32((unsigned char *)gCacheNameAdler, sizeof(gCacheNameAdler));
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%s.%08lX", kDefaultCachePathLeo, adler32);
verbose("Reseted kernel cache file path: %s\n", kernelCacheFile);
}
closedir(cacheDir);
}
else
{
// Lion, Mountain Lion, Mavericks and Yosemite prelink kernel cache file
// for 10.7 10.8 10.9 10.10
snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%skernelcache", kDefaultCachePathSnow);
verbose("Kernel Cache file path (Mac OS X 10.7 and newer): %s\n", kernelCacheFile);
}
}
// Check if the kernel cache file exists
if (getValueForKey(karch, &val, &len, &bootInfo->chameleonConfig))
{
if (strncmp(val, "i386", 4) == 0)
if (strncmp(val, "x86_64", sizeof("x86_64") ) == 0)
{
archCpuType = CPU_TYPE_X86_64;
}
else if (strncmp(val, "i386", sizeof("i386") ) == 0)
{
archCpuType = CPU_TYPE_I386;
}
else
{
DBG("Incorrect parameter for option 'arch =' , please use x86_64 or i386\n");
}
}
if (getValueForKey(kKernelArchKey, &val, &len, &bootInfo->chameleonConfig)) {
if (strncmp(val, "i386", 4) == 0)
if (strncmp(val, "i386", sizeof("i386") ) == 0)
{
archCpuType = CPU_TYPE_I386;
}
bool bootFileWithDevice = false;
// Check if bootFile start with a device ex: bt(0,0)/Extra/mach_kernel
if (strncmp(bootInfo->bootFile,"bt(",3) == 0 ||
strncmp(bootInfo->bootFile,"hd(",3) == 0 ||
strncmp(bootInfo->bootFile,"rd(",3) == 0)
if (strncmp(bootInfo->bootFile, "bt(", sizeof("bt(") ) == 0 ||
strncmp(bootInfo->bootFile, "hd(", sizeof("hd(") ) == 0 ||
strncmp(bootInfo->bootFile, "rd(", sizeof("rd(") ) == 0)
bootFileWithDevice = true;
// bootFile must start with a / if it not start with a device name
if (!bootFileWithDevice && (bootInfo->bootFile)[0] != '/')
{
if (MacOSVerCurrent >= MacOSVer2Int("10.10")) // OSX is 10.10 or newer
if ( !YOSEMITE ) // Is not Yosemite 10.10
{
snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathForYos "%s", bootInfo->bootFile); // Yosemite
snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading /
}
else
{
snprintf(bootFile, sizeof(bootFile), "/%s", bootInfo->bootFile); // append a leading '/'
snprintf(bootFile, sizeof(bootFile), kDefaultKernelPathForYos"%s", bootInfo->bootFile); // Yosemite
}
}
else
return ((gMacOSVersion[0] == version[0]) && (gMacOSVersion[1] == version[1])
&& (gMacOSVersion[2] == version[2]) && (gMacOSVersion[3] == version[3]));
}
}
uint32_t getMacOSVerCurrent()
branches/zenith432/i386/boot2/boot.h
3030
3131
3232
33
34
35
36
37
38
39
33
34
35
36
37
38
39
40
4041
4142
4243
#include "libsaio.h"
// OS X Versions
//#define YOSEMITE checkOSVersion("10.10") // Yosemite
//#define MAVERICKS checkOSVersion("10.9") // Mavericks
//#define MOUNTAIN_LION checkOSVersion("10.8") // Mountain Lion
//#define LION checkOSVersion("10.7") // Lion
//#define SNOW_LEOPARD checkOSVersion("10.6") // Snow Leopard
//#define LEOPARD checkOSVersion("10.5") // Leopard
//#define TIGER checkOSVersion("10.4") // Tiger
//#define GALA checkOSVersion("10.11") // Gala
#define YOSEMITE checkOSVersion("10.10") // Yosemite
#define MAVERICKS checkOSVersion("10.9") // Mavericks
#define MOUNTAIN_LION checkOSVersion("10.8") // Mountain Lion
#define LION checkOSVersion("10.7") // Lion
#define SNOW_LEOPARD checkOSVersion("10.6") // Snow Leopard
#define LEOPARD checkOSVersion("10.5") // Leopard
#define TIGER checkOSVersion("10.4") // Tiger
/*
* Paths used by chameleon
branches/zenith432/i386/boot2/gui.c
265265
266266
267267
268
269
268
269
270
271
270272
271273
272274
......
284286
285287
286288
287
289
288290
289291
290292
......
657659
658660
659661
660
662
661663
662664
663665
......
930932
931933
932934
933
934
935
936
937
935938
936939
937940
static int getImageIndexByName(const char *name)
{
int i;
for (i = 0; i < sizeof(images) / sizeof(images[0]); i++) {
if (strcmp(name, images[i].name) == 0) {
for (i = 0; i < sizeof(images) / sizeof(images[0]); i++)
{
if (strncmp(name, images[i].name, sizeof(images[i].name)) == 0)
{
return i; // found the name
}
}
// NOTE: This algorithm assumes that the embedded images are sorted.
// This is currently done using the make file. If the array is
// generated manualy, this *will* fail to work properly.
while((result = strcmp(name, embeddedImages[compareIndex].name)) != 0)
while((result = strncmp(name, embeddedImages[compareIndex].name, sizeof(embeddedImages[compareIndex].name))) != 0)
{
if (result > 0){ // We need to search a HIGHER index
if (compareIndex != lowerLimit) {
gui.layout = HorizontalLayout;
if(getValueForKey( "devices_layout", &string, &len, theme))
{
if (!strcmp (string, "vertical"))
if (!strncmp (string, "vertical",sizeof("vertical")))
{
gui.layout = VerticalLayout;
}
config_file_t*config;
config = &bootInfo->themeConfig;
if (ParseXMLFile((char *)__theme_plist, &config->dictionary) != 0) {
return 1;
if (ParseXMLFile((char *)__theme_plist, &config->dictionary) != 0)
{
return 1;
}
#else
branches/zenith432/i386/boot2/options.c
266266
267267
268268
269
269
270270
271271
272272
273273
274
274
275275
276276
277277
execute_hook("ClearArgs", NULL, NULL, NULL, NULL);
}
void addBootArg(const char * argStr)
void addBootArg(const char *argStr)
{
if ( (gBootArgsPtr + strlen(argStr) + 1) < gBootArgsEnd)
{
if(gBootArgsPtr != gBootArgs) *gBootArgsPtr++ = ' ';
strcat(gBootArgs, argStr);
strlcat(gBootArgs, argStr, BOOT_STRING_LEN);
gBootArgsPtr += strlen(argStr);
}
}
branches/zenith432/i386/modules/Keylayout/Keylayout.c
138138
139139
140140
141
141
142142
143
144
143
144
145145
146146
147147
if (getValueForKey("KeyLayout", &val, &len, &bootInfo->chameleonConfig))
{
sprintf(layoutPath, "/Extra/Keymaps/%s", val);
snprintf(layoutPath, sizeof(layoutPath),"/Extra/Keymaps/%s", val);
// Add the extension if needed
if (len <= 4 || strcmp(val+len-4,".lyt") != 0)
strncat(layoutPath, ".lyt", sizeof(layoutPath) - strlen(layoutPath) - 1);
if (len <= 4 || strncmp(val+len-4,".lyt", sizeof(".lyt")) != 0)
strlcat(layoutPath, ".lyt", sizeof(layoutPath));
if (!load_keyboard_layout_file(layoutPath))
{
branches/zenith432/i386/modules/AcpiCodec/acpi_codec.c
12261226
12271227
12281228
1229
1229
12301230
12311231
12321232
12331233
12341234
12351235
1236
12361237
1238
12371239
1240
12381241
1239
1242
12401243
12411244
1245
12421246
12431247
1248
12441249
12451250
12461251
U32 index;
for (index=0; index < cpu->pkg_pstates.num_pstates; index ++)
{
PSTATE * pstate = &cpu->pkg_pstates.pstate[index];
PSTATE *pstate = &cpu->pkg_pstates.pstate[index];
// Set ratio
pstate->ratio = computePstateRatio(cpu->max_ratio_as_cfg, cpu->min_ratio, cpu->turbo_available, cpu->pkg_pstates.num_pstates, index);
// Compute frequency based on ratio
if ((index != 0) || (cpu->turbo_available == 0))
{
pstate->frequency = pstate->ratio * get_bclk();
}
else
{
pstate->frequency = ((pstate->ratio - 1) * get_bclk()) + 1;
}
// Compute power based on ratio and other data
if (pstate->ratio >= cpu->max_ratio_as_mfg)
{
// Use max power in mW
pstate->power = TDP * 1000;
}
else
{
pstate->power = compute_pstate_power(cpu, pstate->ratio, TDP);
branches/zenith432/i386/libsa/libsa.h
102102
103103
104104
105
105106
106107
107108
extern intatoi(const char * str);
extern intptol(const char * str);
extern size_tstrlen(const char * str);
extern size_tstrlcat(char *, const char *, size_t);
extern char*strcat(char * s1, const char * s2);
extern char*strncat(char * s1, const char * s2, size_t n);
extern char*strdup(const char *s1);
branches/zenith432/i386/libsa/string.c
243243
244244
245245
246
247
248
249
250
251
252
253
254
255
256
257
258
246259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
247288
248289
249290
}
return sum;
}
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
size_t strlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
{
d++;
}
dlen = d - dst;
n = siz - dlen;
if (n == 0)
{
return(dlen + strlen(s));
}
while (*s != '\0')
{
if (n != 1)
{
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}
char *strncat(char *s1, const char *s2, size_t n)
{
register char *ret = s1;
branches/zenith432/i386/util/machOconv.c
2121
2222
2323
24
2425
2526
2627
......
3334
3435
3536
37
38
3639
37
3840
3941
4042
43
44
4145
4246
43
44
45
46
47
48
49
50
51
52
53
54
4755
4856
49
50
57
58
59
60
5161
52
53
54
55
56
62
63
64
65
66
5767
5868
5969
70
6071
6172
62
73
6374
75
6476
6577
6678
6779
6880
69
70
81
82
83
84
7185
72
86
87
88
7389
7490
75
91
7692
77
78
79
93
94
95
96
8097
98
99
100
101
102
103
104
105
81106
82
107
83108
109
84110
85111
86112
......
89115
90116
91117
92
118
93119
94120
95121
......
100126
101127
102128
103
104
129
130
131
132
105133
106134
107135
108136
137
109138
110139
111
140
112141
113142
114143
115144
116
145
146
117147
118148
119149
120150
151
121152
122153
123
154
124155
125156
126157
127
158
128159
129160
130161
......
135166
136167
137168
138
169
139170
140171
141172
......
156187
157188
158189
159
190
191
160192
161193
162194
163
195
196
197
164198
165199
166200
167201
202
168203
169204
170205
......
173208
174209
175210
176
211
212
213
177214
178215
179216
217
180218
181219
182220
......
185223
186224
187225
226
188227
189228
190229
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
intinfile, outfile;
void *cmds;
struct mach_headermh;
void *cmds;
static boolswap_ends;
//==============================================================================
static unsigned long swap(unsigned long x)
{
if (swap_ends)
return OSSwapInt32(x);
else
return x;
if (swap_ends)
{
return OSSwapInt32(x);
}
else
{
return x;
}
}
int
main(int argc, char *argv[])
//==============================================================================
int main(int argc, char *argv[])
{
kern_return_tresult;
vm_address_tdata;
intnc, ncmds;
char *cp;
kern_return_tresult;
vm_address_tdata;
intnc, ncmds;
char *cp;
if (argc == 2)
{
infile = open(argv[1], O_RDONLY);
if (infile < 0)
{
goto usage;
goto filenotfound;
}
outfile = fileno(stdout);
}
else if (argc == 3)
{
infile = open(argv[1], O_RDONLY);
if (infile < 0){
goto usage;
if (infile < 0)
{
goto filenotfound;
}
outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644);
outfile = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (outfile < 0)
{
goto usage;
goto openerror;
}
} else {
usage:
fprintf(stderr, "usage: machOconv inputfile [outputfile]\n");
}
else
{
fprintf(stderr, "Usage: machOconv inputfile [outputfile]\n");
exit(1);
filenotfound:
fprintf(stderr, "Error: File Not Found\n");
exit(1);
openerror:
fprintf(stderr, "Error: Open Failed\n");
exit(1);
}
nc = read(infile, &mh, sizeof (mh));
if (nc < 0)
{
perror("read mach header");
if (nc < (int)sizeof (mh))
{
fprintf(stderr, "read mach header: premature EOF %d\n", nc);
fprintf(stderr, "Error: read mach header: premature EOF %d\n", nc);
exit(1);
}
else if (mh.magic == MH_CIGAM)
{
swap_ends = true;
} else {
fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic);
}
else
{
fprintf(stderr, "Error: bad magic number %lx\n", (unsigned long)mh.magic);
exit(1);
}
cmds = calloc(swap(mh.sizeofcmds), sizeof (char));
if (cmds == 0)
{
fprintf(stderr, "alloc load commands: no memory\n");
fprintf(stderr, "Error: alloc load commands: no memory\n");
exit(1);
}
nc = read(infile, cmds, swap(mh.sizeofcmds));
if (nc < 0)
if (nc < 0)
{
perror("read load commands");
exit(1);
}
if (nc < (int)swap(mh.sizeofcmds))
{
fprintf(stderr, "read load commands: premature EOF %d\n", nc);
fprintf(stderr, "Error: read load commands: premature EOF %d\n", nc);
exit(1);
}
unsigned long vmstart = (unsigned long)-1;
unsigned long vmstart = (unsigned long) -1;
// First pass: determine actual load address
for (ncmds = swap(mh.ncmds), cp = cmds; ncmds > 0; ncmds--)
switch(swap(lcp->cmd))
{
case LC_SEGMENT:
if(vmstart > swap(scp->vmaddr))
if (vmstart > swap(scp->vmaddr))
{
vmstart = swap(scp->vmaddr);
}
switch(swap(lcp->cmd))
{
case LC_SEGMENT:
isDATA = (strcmp(scp->segname, "__DATA") == 0);
isDATA = (strncmp(scp->segname, "__DATA", sizeof("__DATA")) == 0);
if (isDATA)
{
vmsize = swap(scp->filesize);
} else {
}
else
{
vmsize = swap(scp->vmsize);
}
result = vm_allocate(mach_task_self(), &data, vmsize, true);
if (result != KERN_SUCCESS)
{
mach_error("vm_allocate segment data", result);
lseek(infile, swap(scp->fileoff), L_SET);
nc = read(infile, (void *)data, swap(scp->filesize));
if (nc < 0) {
if (nc < 0)
{
perror("read segment data");
exit(1);
}
if (nc < (int)swap(scp->filesize))
{
fprintf(stderr, "read segment data: premature EOF %d\n", nc);
lseek(outfile, swap(scp->vmaddr) - vmstart, L_SET);
nc = write(outfile, (void *)data, vmsize);
if (nc < (int)vmsize)
{
perror("write segment data");
branches/zenith432/CHANGES
1
2
3
14
25
36
- Zenith432 : Sanitize 16-bit assembly
- Zenith432 : Fix bug in malloc_init, use bios for enableA20()
- meklort : Slightly improve decive selection name - add os version.
- Zenith432 : Interrupt Management
- Bungo : Added ability to auto-select last booted partition as the boot volume.
- Bungo : Added MacOSVerCurrent and MacOSVer2Int function to use instead of macros.

Archive Download the corresponding diff file

Revision: 2629