Chameleon

Chameleon Commit Details

Date:2012-10-29 12:27:18 (11 years 5 months ago)
Author:ErmaC
Commit:2111
Parents: 2110
Message:sync with trunk 2110 merge more cparm securityfix Update pkg script for Kernel Patcher module.
Changes:
A/branches/ErmaC/Trunk/i386/modules/KernelPatcher/KernelPatcher.dylib
A/branches/ErmaC/Trunk/i386/modules/KernelPatcher
A/branches/ErmaC/Trunk/i386/modules/KernelPatcher/Cconfig
A/branches/ErmaC/Trunk/i386/modules/KernelPatcher/Makefile
A/branches/ErmaC/Trunk/i386/modules/KextPatcher
A/branches/ErmaC/Trunk/i386/util/segsize.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cwctype
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iostream
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/new
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/unwind-cxx.h
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ios
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/locale
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/fstream
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/vector
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/char_traits
M/branches/ErmaC/Trunk/i386/libsaio/ati.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stack
M/branches/ErmaC/Trunk/i386/modules/Makefile
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string_iostream
M/branches/ErmaC/Trunk/i386/libsaio/saio_types.h
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator_base
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/algorithm
M/branches/ErmaC/Trunk/i386/boot2/Makefile
M/branches/ErmaC/Trunk/i386/libsaio/openbsd.h
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstdarg
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iomanip
M/branches/ErmaC/Trunk/i386/libsaio/bootstruct.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/numeric
M/branches/ErmaC/Trunk/i386/boot2/modules.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/utility
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stdexcept
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/deque
M/branches/ErmaC/Trunk/i386/modules/HelloWorld/HelloWorld.cpp
M/branches/ErmaC/Trunk/i386/libsaio/stringTable.c
M/branches/ErmaC/Trunk/i386/libsaio/freebsd.h
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/type_traits
M/branches/ErmaC/Trunk/i386/boot2/modules.h
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/func_exception
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/basic_definitions
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstddef
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/map
M/branches/ErmaC/Trunk/i386/include/mach/mach.h
M/branches/ErmaC/Trunk/i386/util/Makefile
M/branches/ErmaC/Trunk/i386/boot2/gui.c
M/branches/ErmaC/Trunk/i386/modules/MakeInc.dir
M/branches/ErmaC/Trunk/i386/libsaio/disk.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/valarray
M/branches/ErmaC/Trunk/i386/libsaio/Makefile
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/queue
M/branches/ErmaC/Trunk/i386/klibc/Makefile
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/streambuf
M/branches/ErmaC/Trunk/i386/boot2/picopng.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/set
M/branches/ErmaC/Trunk/i386/libsa/Makefile
M/branches/ErmaC/Trunk/i386/util/machOconv.c
M/branches/ErmaC/Trunk/i386/include/unwind.h
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ctime
M/branches/ErmaC/Trunk/CHANGES
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/string.cpp
M/branches/ErmaC/Trunk/i386/modules/Cconfig
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/memory
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/list
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/sstream
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/csignal
M/branches/ErmaC/Trunk/i386/libsaio/fake_efi.c
M/branches/ErmaC/Trunk/version
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream_helpers
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/bitset
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iosfwd
M/branches/ErmaC/Trunk/i386/libsaio/gma.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream_helpers
M/branches/ErmaC/Trunk/i386/boot2/boot.c
M/branches/ErmaC/Trunk/i386/modules/Keylayout/layouts/Makefile
M/branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c
M/branches/ErmaC/Trunk/i386/modules/AcpiCodec/acpi_codec.c
M/branches/ErmaC/Trunk/package/buildpkg.sh
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/limits
M/branches/ErmaC/Trunk/i386/libsaio/nvidia.c
M/branches/ErmaC/Trunk/i386/util/dyldsymboltool.c
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/functional
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/associative_base
M/branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string
M/branches/ErmaC/Trunk/package/Resources/templates/Localizable.strings
M/branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c

File differences

branches/ErmaC/Trunk/version
1
1
2.1svn
2.2svn
branches/ErmaC/Trunk/i386/libsaio/bootstruct.c
185185
186186
187187
188
188
189189
190190
191191
DT__FlattenDeviceTree((void **)&addr, &size);
bootArgs->deviceTreeP = (uint32_t)addr;
bootArgs->deviceTreeLength = size;
// Copy BootArgs values to older structure
memcpy(&bootArgsPreLion->CommandLine, &bootArgs->CommandLine, BOOT_LINE_LENGTH);
branches/ErmaC/Trunk/i386/libsaio/acpi_patcher.c
9696
9797
9898
99
99
100100
101101
102102
......
702702
703703
704704
705
705
706
706707
707708
708709
710
709711
712
710713
714
711715
712716
713
714
715
716
717717
718
719
720
721
722
718723
719
724
725
726
727
720728
721729
722730
......
737745
738746
739747
748
740749
741
750
751
752
742753
754
743755
744756
745757
758
746759
760
747761
748762
749763
......
799813
800814
801815
816
802817
818
803819
804820
805821
......
10481064
10491065
10501066
1051
1052
1067
1068
10531069
10541070
10551071
......
10711087
10721088
10731089
1090
10741091
10751092
10761093
int search_and_get_acpi_fd(const char * filename, const char ** outDirspec)
{
int fd = 0;
char dirSpec[512] = "";
char dirSpec[512];
// Try finding 'filename' in the usual places
// Start searching any potential location for ACPI Table
const char * value;
// Restart Fix
if (Platform.CPU.Vendor == 0x756E6547) {/* Intel */
if (Platform.CPU.Vendor == 0x756E6547)
{/* Intel */
fix_restart = true;
fix_restart_ps2 = false;
if ( getBoolForKey(kPS2RestartFix, &fix_restart_ps2, &bootInfo->chameleonConfig) && fix_restart_ps2)
{
fix_restart = true;
}
else
{
getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig);
}
else
{
verbose ("Not an Intel platform: Restart Fix not applied !!!\n");
fix_restart = false;
}
else
{
verbose ("Not an Intel platform: Restart Fix not applied !!!\n");
fix_restart = false;
}
if (fix_restart) fadt_rev2_needed = true;
if (fix_restart)
{
fadt_rev2_needed = true;
}
// Allocate new fadt table
if (fadt->Length < 0x84 && fadt_rev2_needed)
if (Platform.Type > 6)
{
if(fadt_mod->PM_Profile<=6)
{
Platform.Type = fadt_mod->PM_Profile; // get the fadt if correct
else
}
else
{
Platform.Type = 1;/* Set a fixed value (Desktop) */
}
verbose("Error: system-type must be 0..6. Defaulting to %d !\n", Platform.Type);
}
else
{
Platform.Type = (unsigned char) strtoul(value, NULL, 10);
}
}
// Set PM_Profile from System-type if only user wanted this value to be forced
if (fadt_mod->PM_Profile != Platform.Type)
fadt_mod->DSDT=(uint32_t)new_dsdt;
if ((uint32_t)(&(fadt_mod->X_DSDT))-(uint32_t)fadt_mod+8<=fadt_mod->Length)
{
fadt_mod->X_DSDT=(uint32_t)new_dsdt;
}
DBG("New @%x,%x\n",fadt_mod->DSDT,fadt_mod->X_DSDT);
// FIXME: handle 64-bit address correctly
xsdt=(struct acpi_2_xsdt*) ((uint32_t)rsdp->XsdtAddress);
DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress,
xsdt->Length);
DBG("XSDT @%x;%x, Length=%d\n", (uint32_t)(rsdp->XsdtAddress>>32),(uint32_t)rsdp->XsdtAddress, xsdt->Length);
if (xsdt && (uint64_t)rsdp->XsdtAddress<0xffffffff && xsdt->Length<0x10000)
{
uint64_t *xsdt_entries;
continue;
}
xsdt_entries[i-dropoffset]=xsdt_entries[i];
if (drop_ssdt && tableSign(table, "SSDT"))
{
dropoffset++;
branches/ErmaC/Trunk/i386/libsaio/Makefile
1919
2020
2121
22
23
24
25
22
23
24
2625
2726
2827
CFLAGS:= $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \
-D__ARCHITECTURE__=\"i386\" -DSAIO_INTERNAL_USER \
-DRCZ_COMPRESSED_FILE_SUPPORT \
-fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \
-mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
-DRCZ_COMPRESSED_FILE_SUPPORT -fno-stack-protector \
-fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \
-march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -nostdinc++
branches/ErmaC/Trunk/i386/libsaio/gma.c
180180
181181
182182
183
183184
184
185
186
185187
186188
187189
......
195197
196198
197199
198
200
199201
200202
201203
202204
203205
204
206
205207
206208
207209
208210
209211
210
212
211213
212214
213215
......
237239
238240
239241
240
242
241243
242244
243245
......
258260
259261
260262
261
263
262264
263265
264266
......
279281
280282
281283
282
284
283285
284286
285287
......
288290
289291
290292
291
293
292294
293295
294296
......
298300
299301
300302
301
303
302304
303305
304306
model, gma_dev->vendor_id, gma_dev->device_id, devicepath);
if (!string)
{
string = devprop_create_string();
}
struct DevPropDevice *device = malloc(sizeof(struct DevPropDevice));
device = devprop_add_device(string, devicepath);
devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1));
devprop_add_value(device, "device_type", (uint8_t*)"display", 8);
if ((model == (char *)"Mobile GMA950") || (model == (char *)"Mobile GMA3150"))
if ((model == (char *)&"Mobile GMA950") || (model == (char *)&"Mobile GMA3150"))
{
devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4);
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
}
else if ((model == (char *)"Desktop GMA950") || (model == (char *)"Desktop GMA3150"))
else if ((model == (char *)&"Desktop GMA950") || (model == (char *)&"Desktop GMA3150"))
{
BuiltIn = 0x01;
devprop_add_value(device, "built-in", &BuiltIn, 1);
devprop_add_value(device, "class-code", ClassFix, 4);
}
else if (model == (char *)"GMAX3100")
else if (model == (char *)&"GMAX3100")
{
BuiltIn = gDualLink;
devprop_add_value(device, "AAPL,HasPanel",GMAX3100_vals[0], 4);
devprop_add_value(device, "subsystem-vendor-id",GMAX3100_vals[21], 4);
devprop_add_value(device, "subsystem-id",GMAX3100_vals[22], 4);
}
else if (model == (char *)"Intel HD Graphics 2000 Mobile")
else if (model == (char *)&"Intel HD Graphics 2000 Mobile")
{
devprop_add_value(device, "class-code", ClassFix, 4);
devprop_add_value(device, "hda-gfx",(uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info",HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info",HD2000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 3000 Mobile")
else if (model == (char *)&"Intel HD Graphics 3000 Mobile")
{
devprop_add_value(device, "class-code",ClassFix, 4);
devprop_add_value(device, "hda-gfx", (uint8_t *)"onboard-1", 10);
devprop_add_value(device, "AAPL,tbl-info",HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info",HD3000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 2000")
else if (model == (char *)&"Intel HD Graphics 2000")
{
devprop_add_value(device, "built-in",&BuiltIn, 1);
devprop_add_value(device, "class-code",ClassFix, 4);
devprop_add_value(device, "AAPL,tbl-info",HD2000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info",HD2000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 3000")
else if (model == (char *)&"Intel HD Graphics 3000")
{
devprop_add_value(device, "built-in",&BuiltIn, 1);
devprop_add_value(device, "class-code",ClassFix, 4);
devprop_add_value(device, "AAPL,tbl-info",HD3000_tbl_info, 18);
devprop_add_value(device, "AAPL,os-info",HD3000_os_info, 20);
}
else if (model == (char *)"Intel HD Graphics 4000")
else if (model == (char *)&"Intel HD Graphics 4000")
{
devprop_add_value(device, "built-in",&BuiltIn, 1);
devprop_add_value(device, "class-code",ClassFix, 4);
branches/ErmaC/Trunk/i386/libsaio/nvidia.c
16581658
16591659
16601660
1661
1662
16611663
1664
16621665
16631666
16641667
1668
1669
1670
1671
16651672
1673
1674
16661675
16671676
16681677
......
16711680
16721681
16731682
1683
16741684
1685
1686
16751687
16761688
16771689
......
32463258
32473259
32483260
3261
32493262
32503263
32513264
{ 0x10DE1211,0x15587101,"Clevo GeForce GTX 580M" },
{ 0x10DE1211,0x15587200,"Clevo GeForce GTX 580M" },
{ 0x10DE1212,0x10280550,"Dell GeForce GTX 675M" },
{ 0x10DE1212,0x10280551,"Dell GeForce GTX 675M" },
{ 0x10DE1212,0x1028057B,"Dell GeForce GTX 675M" },
{ 0x10DE1212,0x10280580,"Dell GeForce GTX 675M" },
{ 0x10DE1212,0x10DE095D,"nVidia GeForce GTX 675M" },
{ 0x10DE1212,0x144DC0D0,"Samsung GeForce GTX 675M" },
{ 0x10DE1212,0x146210CB,"MSi GeForce GTX 675M" },
{ 0x10DE1212,0x15580270,"Clevo GeForce GTX 675M" },
{ 0x10DE1212,0x15580271,"Clevo GeForce GTX 675M" },
{ 0x10DE1212,0x15585105,"Clevo GeForce GTX 675M" },
{ 0x10DE1212,0x15587102,"Clevo GeForce GTX 675M" },
{ 0x10DE1213,0x10432119,"Asus GeForce GTX 670M" },
{ 0x10DE1213,0x10432120,"Asus GeForce GTX 670M" },
{ 0x10DE1213,0x102804BA,"Dell GeForce GTX 670M" },
{ 0x10DE1213,0x10432119,"Dell GeForce GTX 670M" },
{ 0x10DE1213,0x10432120,"Dell GeForce GTX 670M" },
{ 0x10DE1213,0x1179FB18,"Toshiba GeForce GTX 670M" },
{ 0x10DE1213,0x1179FB1A,"Toshiba GeForce GTX 670M" },
{ 0x10DE1213,0x146210CB,"MSi GeForce GTX 670M" },
{ 0x10DE1213,0x15580371,"Clevo GeForce GTX 670M" },
{ 0x10DE1213,0x15585105,"Clevo GeForce GTX 670M" },
{ 0x10DE1213,0x15587102,"Clevo GeForce GTX 670M" },
{ 0x10DE1213,0x15588000,"Clevo GeForce GTX 670M" },
{ 0x10DE1241,0x10DE091D,"nVidia GeForce GT 545" },
else
{
printf("ERROR: unable to open nVidia Video BIOS File %s\n", nvFilename);
free(rom);
return false;
}
}
branches/ErmaC/Trunk/i386/libsaio/ati.c
401401
402402
403403
404
404
405405
406406
407407
/* Evergreen */
{ 0x6898,0x00D0106B, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870", kLangur},
{ 0x6898,0x032E1043, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870", kUakari},
{ 0x6898,0x038C1043, CHIP_FAMILY_CYPRESS,"ASUS 5870 Eyefinity 6", kNull},
{ 0x6898,0x038C1043, CHIP_FAMILY_CYPRESS,"ASUS 5870 Eyefinity 6", kNull},
{ 0x6898,0x0B001002, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870", kZonalis},
{ 0x6898,0x21E51458, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870", kUakari},
{ 0x6898,0x29611682, CHIP_FAMILY_CYPRESS,"ATI Radeon HD 5870", kUakari},
branches/ErmaC/Trunk/i386/libsaio/disk.c
13851385
13861386
13871387
1388
1389
1390
1391
13881392
13891393
13901394
......
13941398
13951399
13961400
1401
1402
1403
1404
13971405
13981406
13991407
......
15341542
15351543
15361544
1537
1545
1546
1547
1548
15381549
15391550
15401551
......
15931604
15941605
15951606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
15961625
15971626
15981627
......
20822111
20832112
20842113
2085
2086
2114
2115
20872116
20882117
20892118
goto scanErr;
}
buffer = malloc(bufferSize);
if (!buffer)
{
goto scanErr;
}
if (readBytes(biosdev, gptBlock, 0, bufferSize, buffer) != 0)
{
// Allocate a new map for this BIOS device and insert it into the chain
map = malloc(sizeof(*map));
if (!map)
{
goto scanErr;
}
map->biosdev = biosdev;
map->bvr = NULL;
map->bvrcnt = 0;
}
scanErr:
free(buffer);
if (buffer)
{
free(buffer);
}
if(map)
{
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)
{
valid = true;
bvr->OSisInstaller = true;
strcpy(bvr->OSVersion, "10.7"); // 10.7 +
}
else
{
close(fh);
}
}
return valid;
}
return;
}
strcpy(str + len, " ");
len++;
strcpy(str + len, bvr->OSisInstaller ? " (Installer) " : " ");
len += bvr->OSisInstaller ? 13 : 1;
strMaxLen -= len;
p += len;
}
branches/ErmaC/Trunk/i386/libsaio/openbsd.h
1
2
3
14
2
5
6
7
#ifndef __LIBSAIO_OPENBSD_H
#define __LIBSAIO_OPENBSD_H
extern bool OpenBSDProbe (const void *buf);
extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen);
extern void OpenBSDGetDescription(CICell ih, char *str, long strMaxLen);
#endif /* !__LIBSAIO_OPENBSD_H */
branches/ErmaC/Trunk/i386/libsaio/nvidia_helper.c
9191
9292
9393
94
94
9595
9696
9797
......
143143
144144
145145
146
146
entry = cardList;
while(entry)
{
if((entry->id == id))
if(entry->id == id)
{
return entry;
}
}
}
}
}
}
branches/ErmaC/Trunk/i386/libsaio/stringTable.c
623623
624624
625625
626
626627
627628
628629
{
char *dirspec[] = {
"/Library/Preferences/SystemConfiguration/com.apple.Boot.plist",
"/OS X Install Data/com.apple.Boot.plist",
};
int i, fd, count, ret=-1;
branches/ErmaC/Trunk/i386/libsaio/freebsd.h
1
2
3
14
2
5
6
7
#ifndef __LIBSAIO_FREEBSD_H
#define __LIBSAIO_FREEBSD_H
extern bool FreeBSDProbe (const void *buf);
extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen);
extern void FreeBSDGetDescription(CICell ih, char *str, long strMaxLen);
#endif /* !__LIBSAIO_FREEBSD_H */
branches/ErmaC/Trunk/i386/libsaio/saio_types.h
214214
215215
216216
217
218
217219
218220
219221
boolvisible;/* will shown in the device list */
charOSVersion[8];
boolOSisServer;/* 1 = OS X server , 0 = OS X client */
boolOSisInstaller;/* 1 = OS X Install partition / recover partition , 0 = OS X Install */
};
enum
branches/ErmaC/Trunk/i386/libsaio/fake_efi.c
686686
687687
688688
689
689
690690
691691
692692
*/
static void setupSmbiosConfigFile(const char *filename)
{
chardirSpecSMBIOS[128] = "";
chardirSpecSMBIOS[128];
const char *override_pathname = NULL;
intlen = 0, err = 0;
extern void scan_mem();
branches/ErmaC/Trunk/i386/include/mach/mach.h
11
22
33
4
54
65
76
......
2322
2423
2524
26
27
28
2925
3026
3127
......
4945
5046
5147
52
53
54
48
5549
5650
5751
/*
* Copyright (c) 1999-2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
*
* Includes all the types that a normal user
* of Mach programs should need
*/
branches/ErmaC/Trunk/i386/include/unwind.h
3232
3333
3434
35
3536
3637
38
3739
3840
3941
......
235237
236238
237239
240
238241
239242
243
240244
241245
#define _UNWIND_H
#ifndef HIDE_EXPORTS
#ifdef __GCC__
#pragma GCC visibility push(default)
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HIDE_EXPORTS
#ifdef __GCC__
#pragma GCC visibility pop
#endif
#endif
#endif /* unwind.h */
branches/ErmaC/Trunk/i386/klibc/Makefile
1414
1515
1616
17
18
17
1918
2019
2120
CFLAGS:= $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \
-fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \
-mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float \
-march=pentium4 -msse2 -msoft-float -fno-stack-protector \
-nostdinc -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -nostdinc++
branches/ErmaC/Trunk/i386/boot2/picopng.c
6565
6666
6767
68
6869
70
6971
72
7073
74
7175
76
7277
78
7379
80
7481
82
7583
7684
7785
......
8593
8694
8795
88
96
8997
98
9099
91
92
93
94
95
96
97100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
98115
99116
100117
return;
}
if (node->prev)
{
node->prev->next = node->next;
}
if (node->next)
{
node->next->prev = node->prev;
}
if (node == png_alloc_head)
{
png_alloc_head = node->next;
}
if (node == png_alloc_tail)
{
png_alloc_tail = node->prev;
}
node->prev = node->next = node->addr = NULL;
free(node);
}
void *png_alloc_realloc(void *addr, size_t size)
{
void *new_addr;
void *new_addr = NULL;
if (!addr)
{
return png_alloc_malloc(size);
new_addr = realloc(addr, size);
if (new_addr && (new_addr != addr)) {
png_alloc_node_t *old_node;
old_node = png_alloc_find_node(addr);
png_alloc_remove_node(old_node);
png_alloc_add_node(new_addr, size);
}
png_alloc_node_t *old_node;
old_node = png_alloc_find_node(addr);
if (old_node)
{
new_addr = realloc(addr, size);
if (new_addr && (new_addr != addr))
{
png_alloc_remove_node(old_node);
png_alloc_add_node(new_addr, size);
}
}
return new_addr;
}
branches/ErmaC/Trunk/i386/boot2/Makefile
2121
2222
2323
24
25
26
24
25
2726
2827
2928
......
6564
6665
6766
67
68
6869
6970
7071
......
7879
7980
8081
82
8183
82
84
8385
84
85
86
86
87
88
89
90
91
8792
93
8894
8995
90
91
9296
9397
9498
9599
96100
97
98
99
100
101
102
103
104
105
106
107
108
109
110
101111
112
102113
103114
104115
......
106117
107118
108119
109
110120
111
112
113
114
121
122
123
124
125
126
127
128
129
130
115131
116
132
117133
118134
119135
......
125141
126142
127143
144
145
146
147
148
149
150
151
152
153
154
128155
129156
130
131
132157
133
158
159
134160
135161
136162
......
143169
144170
145171
146
147
148
149
150
151
152
153
154
155
156
157
158172
159173
160174
OPTIM = -Os -Oz
CFLAGS= $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \
-fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \
-mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
-fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \
-march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -nostdinc++ -include $(SRCROOT)/autoconf.h
DATA_ADDR = $(shell printf "%d" `otool -l $(SYMROOT)/boot.sys | grep __data -A 4 | grep __DATA -A 3 | head -n 2 | tail -n 1 | cut -f 8 -d " "`)
PATCH_ADDR = $(shell echo ${SYMBOL_ADDR}-${DATA_ADDR}+${DATA_OFFSET} | bc)
#### NOTE #### This value is currently *not* calculated and *should* be. It is currently determined experimentally…
DATA_PAD = 3582
all: $(DIRS_NEEDED) boot all-recursive
endif
@${MKDIRS} $(OBJROOT)/../boot2_modules/
@${MKDIRS} $(OBJROOT)/../boot2_modules/
@### First pass, don't worry abount segment alignment.
@echo "\t[LD] boot.sys"
@$(BINROOT)/ld_classic -static -segalign 20 -segaddr __INIT $(BOOT2ADDR) -preload \
-arch i386 -e boot2 \
-o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a`
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-read_only_relocs,suppress \
-lcc_kext \
$(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \
-o ${SYMROOT}/$@.sys
ifeq (${CONFIG_MODULES}, y)
@cp $(SYMROOT)/boot.sys $(SYMROOT)/boot2.sys
@# Generate the Symbols.dylib file
@echo "\t[dyldsymboltool] Symbols.dylib"
@$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@echo "\t[LD] boot.sys"
@$(BINROOT)/ld_classic -static -segalign 20 -segaddr __INIT $(BOOT2ADDR) -preload \
-arch i386 -e boot2\
-sectcreate __DATA __Symbols $(SYMROOT)/Symbols.dylib \
-o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a`
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \
-Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \
-Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \
-Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \
-Wl,-read_only_relocs,suppress \
-lcc_kext \
$(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \
-o ${SYMROOT}/$@.sys
@# Second pass, fixup global var locations
@${RM} $(SYMROOT)/${SYMBOLS_MODULE}
@echo "\t[dyldsymboltool] Symbols.dylib"
@$(SYMROOT)/dyldsymboltool $(SYMROOT)/boot.sys $(SYMROOT)/${SYMBOLS_MODULE}
@${RM} $(SYMROOT)/boot.sys
@echo "\t[LD] boot.sys"
@$(BINROOT)/ld_classic -static -segalign 20 -segaddr __INIT $(BOOT2ADDR) -preload \
-arch i386 \
-sectcreate __DATA __Symbols $(SYMROOT)/Symbols.dylib \
-o $(SYMROOT)/boot.sys $(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) `find /usr/llvm-gcc-*/lib/gcc/*/*/ -name \libcc_kext.a`
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-sectcreate,__DATA,__Symbols,$(SYMROOT)/Symbols.dylib \
-Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \
-Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \
-Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \
-Wl,-read_only_relocs,suppress \
-lcc_kext \
$(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \
-o ${SYMROOT}/$@.sys
@${RM} $(SYMROOT)/${SYMBOLS_MODULE}
@#${RM} $(SYMROOT)/${SYMBOLS_MODULE}
@$(LD) -arch i386 \
-undefined dynamic_lookup \
-macosx_version_min 10.6 \
-o $(OBJROOT)/Symbols_LINKER_ONLY.dylib
else
@echo "\t[LD] boot.sys"
@$(CC) -Wl,-preload -Wl,-alias,boot2,start \
-nostdlib -arch i386 -Wl,-pie \
-Wl,-segaddr,__INIT,`echo obase=16\; $$((0x${BOOT2ADDR})) | bc` \
-Wl,-segaddr,__TEXT,`echo obase=16\; $$((0x${BOOT2ADDR})) + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` | bc` \
-Wl,-segaddr,__DATA,`echo obase=16\; $$((0x${BOOT2ADDR})) + ${DATA_PAD} + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __INIT\` + \`${SYMROOT}/segsize ${SYMROOT}/$@.sys __TEXT\` | bc` \
-Wl,-read_only_relocs,suppress \
-lcc_kext \
$(filter %.o,$^) `find $(OBJROOT)/../boot2_modules/ -name \*.o` $(LIBS) \
-o ${SYMROOT}/$@.sys
endif
@# this is done in a sub process after boot.sys exists so the strings are populated correctly
@make embed_symbols
@${RM} $(SYMROOT)/boot2.sys
@echo "\t[MACHOCONV] boot"
@$(SYMROOT)/machOconv ${SYMROOT}/$@.sys $(SYMROOT)/$@ &> /dev/null
@( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\
echo "\t******* boot is $$size bytes *******"; \
fi)
embed_symbols:
ifeq (${CONFIG_MODULES}, y)
@echo ================= Embedding Symbols.dylib =================
@echo "\t[MACHOCONV] boot"
@$(SYMROOT)/machOconv $(SYMROOT)/boot2.sys $(SYMROOT)/boot &> /dev/null
@echo "\t******* Patching at $(PATCH_ADDR) ******"
@stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null
endif
@echo "\t[MACHOCONV] boot"
@$(SYMROOT)/machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot
$(SYMROOT)/art.h:
@if [ "$(PNGCRUSH)" ]; then\
echo "optimizing art files ...\n$(PNGCRUSH) $(PNGOPTIONS) artwork/$(THEME)"; \
branches/ErmaC/Trunk/i386/boot2/boot.c
9191
9292
9393
94
95
94
95
96
97
9698
97
98
99
100
99101
100102
101103
......
374376
375377
376378
377
378
379
380
381
382
383
379
384380
385381
386382
......
528524
529525
530526
531
527
532528
533529
534530
......
663659
664660
665661
666
667
668
669
670
671
672
673662
674
675663
676664
677665
static void zeroBSS(void)
{
extern char _DATA__bss__begin, _DATA__bss__end;
extern char _DATA__common__begin, _DATA__common__end;
extern char bss_start __asm("section$start$__DATA$__bss");
extern char bss_end __asm("section$end$__DATA$__bss");
extern char common_start __asm("section$start$__DATA$__common");
extern char common_end __asm("section$end$__DATA$__common");
bzero(&_DATA__bss__begin, (&_DATA__bss__end - &_DATA__bss__begin));
bzero(&_DATA__common__begin, (&_DATA__common__end - &_DATA__common__begin));
bzero(&bss_start, (&bss_end - &bss_start));
bzero(&common_start, (&common_end - &common_start));
}
//==========================================================================
// Since the kernel cache file exists and is the most recent try to load it
verbose("Loading kernel cache %s\n", kernelCachePath);
if ((checkOSVersion("10.7")) || (checkOSVersion("10.8")))
{
ret = LoadThinFatFile(kernelCachePath, binary);
} else {
ret = LoadFile(kernelCachePath);
*binary = (void *)kLoadAddr;
}
ret = LoadThinFatFile(kernelCachePath, binary);
return ret; // ret contain the length of the binary
}
while (1)
{
booltryresume, tryresumedefault, forceresume;
booluseKernelCache = false; // by default don't use prelink kernel cache
booluseKernelCache = true; // by default try to use the prelinked kernel
const char*val;
intlen, ret = -1;
longflags, sleeptime, time;
verbose("Loading Darwin %s\n", gMacOSVersion);
// If boot from boot helper partitions and OS is Mountain Lion or Lion use prelink kernel.
// We need to find a solution to load extra mkext with a prelink kernel.
if (gBootVolume->flags & kBVFlagBooter && ((checkOSVersion("10.7")) || (checkOSVersion("10.8"))))
useKernelCache = true;
else
useKernelCache = false; // by default don't use prelink kernel cache
getBoolForKey(kUseKernelCache, &useKernelCache, &bootInfo->chameleonConfig);
if (useKernelCache) do {
// Determine the name of the Kernel Cache
branches/ErmaC/Trunk/i386/boot2/modules.c
22
33
44
5
6
7
8
9
105
116
127
138
149
1510
11
12
13
14
1615
16
1717
1818
1919
......
2323
2424
2525
26
27
26
27
2828
29
30
3129
3230
3331
......
4846
4947
5048
51
49
50
51
5252
5353
54
54
5555
5656
5757
......
6060
6161
6262
63
6463
6564
6665
......
6968
7069
7170
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
71
72
9173
9274
9375
......
10587
10688
10789
108
10990
11091
11192
......
326307
327308
328309
329
310
330311
331312
332313
......
361342
362343
363344
364
345
365346
366347
367348
368349
369350
370
371
351
372352
373353
374354
......
411391
412392
413393
414
394
415395
416
417
418396
419397
420398
......
439417
440418
441419
442
443
444
445
420
421
422
446423
447424
448425
......
11511128
11521129
11531130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
11541155
* Copyright 2010 Evan Lojewski. All rights reserved.
*
*/
#ifdef CONFIG_MODULES
#ifndef CONFIG_MODULE_DEBUG
#define CONFIG_MODULE_DEBUG 0
#endif
#include "boot.h"
#include "bootstruct.h"
#include "modules.h"
#include "boot_modules.h"
#include <vers.h>
#ifdef CONFIG_MODULES
#ifndef CONFIG_MODULE_DEBUG
#define CONFIG_MODULE_DEBUG 0
#endif
#if CONFIG_MODULE_DEBUG
#define DBG(x...)printf(x);
#define DBGPAUSE()getchar()
#endif
// NOTE: Global so that modules can link with this
UInt64 textAddress = 0;
UInt64 textSection = 0;
static UInt64 textAddress = 0;
static UInt64 textSection = 0;
void* symbols_module_start = (void*)0xFFFFFFFF;// Global, value is populated by the makefile with actual address
/** Internal symbols, however there are accessor methods **/
moduleHook_t* moduleCallbacks = NULL;
moduleList_t* loadedModules = NULL;
int retVal = 0;
void (*module_start)(void) = NULL;
char* module_data = symbols_module_start + BOOT2_ADDR;
extern char symbols_start __asm("section$start$__DATA$__Symbols");
char* module_data = &symbols_start;
// Intialize module system
if(symbols_module_start != (void*)0xFFFFFFFF)
if(module_data)
{
// Module system was compiled in (Symbols.dylib addr known)
module_start = parse_mach(module_data, &load_module, &add_symbol, NULL);
{
// Notify the system that it was laoded
module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT);
(*module_start)();// Start the module. This will point to load_all_modules due to the way the dylib was constructed.
execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL);
DBG("Module %s Loaded.\n", SYMBOLS_MODULE);
}
else
{
module_data -= 0x10; // XCODE 4 HACK
module_start = parse_mach(module_data, &load_module, &add_symbol, NULL);
if(module_start && module_start != (void*)0xFFFFFFFF)
{
// Notify the system that it was laoded
module_loaded(SYMBOLS_MODULE, SYMBOLS_AUTHOR, SYMBOLS_DESCRIPTION, SYMBOLS_VERSION, SYMBOLS_COMPAT);
(*module_start)();// Start the module. This will point to load_all_modules due to the way the dylib was constructed.
execute_hook("ModulesLoaded", NULL, NULL, NULL, NULL);
DBG("Module %s Loaded.\n", SYMBOLS_MODULE);
retVal = 1;
}
else
{
// The module does not have a valid start function
printf("Unable to start %s\n", SYMBOLS_MODULE); getchar();
}
// The module does not have a valid start function
printf("Unable to start %s at 0x%x\n", SYMBOLS_MODULE, module_data); pause();
}
}
return retVal;
module_loaded(name, author, description, version, compat);
}
/*
* Load all modules in the /Extra/modules/ directory
* Module depencdies will be loaded first
void* parse_mach(void* binary,
int(*dylib_loader)(char*),
long long(*symbol_handler)(char*, long long, char),
void (*section_handler)(char* section, char* segment, long long offset, long long address)
void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address)
)
{
char is64 = false;
}
else if(((struct mach_header_64*)binary)->magic == MH_MAGIC_64)
{
// NOTE: modules cannot be 64bit...
// NOTE: modules cannot be 64bit. This is used to parse the kernel and kexts
is64 = true;
binaryIndex += sizeof(struct mach_header_64);
}
else
{
//verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic);
//getchar();
verbose("Invalid mach magic 0x%X\n", ((struct mach_header*)binary)->magic);
return NULL;
}
sectionIndex += sizeof(struct section);
if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr);
if(section_handler) section_handler(sect->sectname, segCommand->segname, (void*)sect, sect->offset, sect->addr);
if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0))
{
// __TEXT,__text found, save the offset and address for when looking for the calls.
sectionIndex += sizeof(struct section_64);
if(section_handler) section_handler(sect->sectname, segCommand->segname, sect->offset, sect->addr);
if((strcmp("__TEXT", segCommand->segname) == 0) && (strcmp("__text", sect->sectname) == 0))
if(section_handler) section_handler(sect->sectname, segCommand64->segname, (void*)sect, sect->offset, sect->addr);
if((strcmp("__TEXT", segCommand64->segname) == 0) && (strcmp("__text", sect->sectname) == 0))
{
// __TEXT,__text found, save the offset and address for when looking for the calls.
textSection = sect->offset;
{
return 0;
}
void register_hook_callback(const char* name, void(*callback)(void*, void*, void*, void*))
{
printf("WARNING: register_hook_callback is not supported when compiled in.\n");
pause();
}
int replace_function(const char* symbol, void* newAddress)
{
printf("WARNING: replace_functions is not supported when compiled in.\n");
pause();
return 0;
}
void start_built_in_module(const char* name,
const char* author,
const char* description,
UInt32 version,
UInt32 compat,
void(*start_function)(void))
{
start_function();
}
#endif
branches/ErmaC/Trunk/i386/boot2/modules.h
2121
2222
2323
24
25
2624
2725
2826
......
9088
9189
9290
93
91
9492
9593
9694
......
121119
122120
123121
124
122
#define SYMBOLS_COMPAT 0
#define VOID_SYMBOL"dyld_void_start"
extern UInt64 textAddress;
extern UInt64 textSection;
void*parse_mach(void* binary,
int(*dylib_loader)(char*),
long long(*symbol_handler)(char*, long long, char),
void (*section_handler)(char* section, char* segment, long long offset, long long address)
void (*section_handler)(char* section, char* segment, void* cmd, UInt64 offset, UInt64 address)
);
unsigned inthandle_symtable(UInt32 base,
struct symtab_command* symtabCommand,
/********************************************************************************/
void dyld_stub_binder();
#endif /* __BOOT_MODULES_H */
#endif /* __BOOT_MODULES_H */
branches/ErmaC/Trunk/i386/boot2/gui.c
12231223
12241224
12251225
1226
1226
12271227
12281228
12291229
return;
}
inline void vramwrite (void *data, int width, int height)
static inline void vramwrite (void *data, int width, int height)
{
if (VIDEO (depth) == 32 && VIDEO (rowBytes) == gui.backbuffer->width * 4)
{
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iostream
2929
3030
3131
32
33
3432
3533
3634
......
9694
9795
9896
99
100
10197
#include <fstream>
#include <string_iostream>
#pragma GCC visibility push(default)
namespace std{
#ifdef __UCLIBCXX_SUPPORT_CIN__
extern istream cin;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstdarg
4343
4444
4545
46
47
4846
4947
5048
#ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1
#pragma GCC system_header
#include <stdarg.h>
// Adhere to section 17.4.1.2 clause 5 of ISO 14882:1998
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/unwind-cxx.h
3838
3939
4040
41
41
4242
43
44
4543
4644
4745
......
135133
136134
137135
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162136
163137
164138
......
177151
178152
179153
180
181
182154
#include <typeinfo>
#include <exception>
#include <cstddef>
#include "unwind.h"
//#include <unwind.h>
#pragma GCC visibility push(default)
namespace __cxxabiv1
{
// The current installed user handlers.
extern std::terminate_handler __terminate_handler;
extern std::unexpected_handler __unexpected_handler;
// These are explicitly GNU C++ specific.
// This is the exception class we report -- "GNUCC++\0".
const _Unwind_Exception_Class __gxx_exception_class
= ((((((((_Unwind_Exception_Class) 'G'
<< 8 | (_Unwind_Exception_Class) 'N')
<< 8 | (_Unwind_Exception_Class) 'U')
<< 8 | (_Unwind_Exception_Class) 'C')
<< 8 | (_Unwind_Exception_Class) 'C')
<< 8 | (_Unwind_Exception_Class) '+')
<< 8 | (_Unwind_Exception_Class) '+')
<< 8 | (_Unwind_Exception_Class) '\0');
// GNU C++ personality routine, Version 0.
extern "C" _Unwind_Reason_Code __gxx_personality_v0
(int, _Unwind_Action, _Unwind_Exception_Class,
struct _Unwind_Exception *, struct _Unwind_Context *);
// GNU C++ sjlj personality routine, Version 0.
extern "C" _Unwind_Reason_Code __gxx_personality_sj0
(int, _Unwind_Action, _Unwind_Exception_Class,
struct _Unwind_Exception *, struct _Unwind_Context *);
#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__
// Acquire the C++ exception header from the C++ object.
#endif
} /* namespace __cxxabiv1 */
#pragma GCC visibility pop
#endif // _UNWIND_CXX_H
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iomanip
2323
2424
2525
26
27
2826
2927
3028
......
164162
165163
166164
167
168
169165
170166
#ifndef __STD_IOMANIP
#define __STD_IOMANIP 1
#pragma GCC visibility push(default)
namespace std{
// These are the helper classes which we are going to be using to
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/numeric
2323
2424
2525
26
27
2826
2927
3028
......
155153
156154
157155
158
159
160156
161157
#ifndef __STD_NUMERIC_HEADER
#define __STD_NUMERIC_HEADER 1
#pragma GCC visibility push(default)
namespace std{
template <class InputIterator, class T> _UCXXEXPORT
T accumulate(InputIterator first, InputIterator last, T init)
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/utility
2424
2525
2626
27
28
2927
3028
3129
......
8381
8482
8583
86
87
8884
#ifndef __STD_HEADER_UTILITY
#define __STD_HEADER_UTILITY 1
#pragma GCC visibility push(default)
namespace std{
namespace rel_ops {
}
#pragma GCC visibility pop
#endif//__STD_HEADER_UTILITY
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/type_traits
2525
2626
2727
28
29
3028
3129
3230
......
8684
8785
8886
89
90
9187
9288
#ifndef __HEADER_TYPE_TRAITS
#define __HEADER_TYPE_TRAITS 1
#pragma GCC visibility push(default)
namespace std{
struct _UCXXEXPORT __true_type{};
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/memory
2727
2828
2929
30
31
3230
3331
3432
......
190188
191189
192190
193
194
195191
196192
#ifndef HEADER_STD_MEMORY
#define HEADER_STD_MEMORY 1
#pragma GCC visibility push(default)
namespace std{
template <class T> class allocator;
}//namespace std
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cstddef
4343
4444
4545
46
47
48
49
5046
5147
5248
#ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1
#ifdef __GCC__
#pragma GCC system_header
#endif
#include <stddef.h>
namespace std
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/map
2929
3030
3131
32
33
3432
3533
3634
......
254252
255253
256254
257
258
259255
260256
261257
#ifndef __STD_HEADER_MAP
#define __STD_HEADER_MAP
#pragma GCC visibility push(default)
namespace std{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator
2828
2929
3030
31
32
3331
3432
3533
......
164162
165163
166164
167
165
168166
169167
170168
......
222220
223221
224222
225
226
227223
228224
229225
#ifndef __STD_HEADER_ITERATOR
#define __STD_HEADER_ITERATOR 1
#pragma GCC visibility push(default)
namespace std{
// subclause _lib.stream.iterators_, stream iterators:
}
bool equal(const istreambuf_iterator& b) const{
return sbuf == b.sbuf || is_eof() && b.is_eof();
return sbuf == b.sbuf || (is_eof() && b.is_eof());
}
private:
streambuf_type* sbuf;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/bitset
2727
2828
2929
30
31
3230
3331
3432
......
417415
418416
419417
420
421
422418
423419
#ifndef __STD_BITSET_HEADER
#define __STD_BITSET_HEADER 1
#pragma GCC visibility push(default)
namespace std{
template <size_t N> class bitset;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/set
2828
2929
3030
31
32
3331
3432
3533
......
400398
401399
402400
403
404
405401
406402
407403
#ifndef __STD_HEADER_SET
#define __STD_HEADER_SET
#pragma GCC visibility push(default)
namespace std{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iosfwd
2525
2626
2727
28
29
3028
3129
32
30
3331
3432
3533
......
109107
110108
111109
112
113
114110
#ifndef __HEADER_STD_IOSFWD
#define __HEADER_STD_IOSFWD 1
#pragma GCC visibility push(default)
namespace std {
class ios_base;
template<> class char_traits<char>;
template<> struct char_traits<char>;
#ifdef __UCLIBCXX_HAS_WCHAR__
template<> class char_traits<wchar_t>;
#endif
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/limits
2323
2424
2525
26
27
2826
2927
3028
......
610608
611609
612610
613
614
615611
//#warning limits header is nowhere complete or accurate
#pragma GCC visibility push(default)
namespace std{
enum float_round_style{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/functional
2121
2222
2323
24
25
2624
2725
2826
......
4644
4745
4846
49
47
5048
51
49
5250
5351
5452
......
431429
432430
433431
434
435
436432
437433
438434
#include <basic_definitions>
#pragma GCC visibility push(default)
namespace std{
template <class Arg, class Result> struct unary_function;
template <class T> struct logical_or;
template <class T> struct logical_not;
template <class Predicate> struct unary_negate;
template <class Predicate> class unary_negate;
template <class Predicate> unary_negate<Predicate> not1(const Predicate&);
template <class Predicate> struct binary_negate;
template <class Predicate> class binary_negate;
template <class Predicate> binary_negate<Predicate> not2(const Predicate&);
return binary_compose<Op1, Op2, Op3>(fn1, fn2, fn3);
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream
2626
2727
2828
29
30
3129
3230
3331
......
9896
9997
10098
101
99
102100
103
101
104102
105103
106104
107105
108106
109
107
110108
111109
112110
......
130128
131129
132130
133
131
134132
135
133
136134
137135
138136
139137
140138
141139
142
140
143141
144142
145143
......
165163
166164
167165
168
166
169167
170
168
171169
172170
173171
174172
175173
176174
177
175
178176
179177
180178
......
194192
195193
196194
197
195
198196
199197
200198
......
211209
212210
213211
214
212
215213
216214
217215
......
225223
226224
227225
228
229
226
227
230228
231229
232230
......
241239
242240
243241
244
242
245243
246244
247245
248246
249247
250
248
251249
252250
253251
......
270268
271269
272270
273
271
274272
275273
276274
277
275
278276
279277
280278
281
279
282280
283281
284282
......
287285
288286
289287
290
288
291289
292290
293291
294
292
295293
296294
297295
298
296
299297
300298
301299
......
306304
307305
308306
309
307
310308
311309
312310
......
340338
341339
342340
343
341
344342
345343
346344
......
372370
373371
374372
375
373
376374
377375
378376
......
386384
387385
388386
389
390
387
388
391389
392390
393391
......
595593
596594
597595
598
599
600596
601597
#ifndef __STD_HEADER_ISTREAM
#define __STD_HEADER_ISTREAM 1
#pragma GCC visibility push(default)
namespace std{
typedef basic_istream<char> istream;
basic_ios<charT, traits>::mstreambuf->sbumpc();
if(c == traits::eof() ){
if(i==0){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}else{
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
break;
}
if(c == delim){
if(i==0){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}
basic_ios<charT, traits>::mstreambuf->sputbackc(c);
break;
c = basic_ios<charT, traits>::mstreambuf->sgetc();
if(c == traits::eof()){
if(i==0){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}else{
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
count_last_ufmt_input = i;
return *this;
}
if(c == delim){
if(i==0){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}
count_last_ufmt_input = i;
return *this;
c = basic_ios<charT, traits>::mstreambuf->sgetc();
if(c == traits::eof() ){
if( basic_ios<charT,traits>::eof() ){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}else{
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
count_last_ufmt_input = i;
s[i] = traits::eos();
return *this;
}
if(basic_ios<charT, traits>::mstreambuf->sbumpc()==traits::eof() ){
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
if(c == delim){
count_last_ufmt_input = i+1;
for(i=0;i<n;++i){
c = basic_ios<charT, traits>::mstreambuf->sgetc();
if(c == traits::eof()){
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
return *this;
}
basic_ios<charT, traits>::mstreambuf->sbumpc();
}else{
int_type c = basic_ios<charT, traits>::mstreambuf->sgetc();
if(c == traits::eof()){
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
return basic_ios<charT, traits>::mstreambuf->sgetc();
}
c = basic_ios<charT, traits>::mstreambuf->sgetc();
if(c == traits::eof()){
basic_ios<charT,traits>::setstate(ios_base::failbit);
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
count_last_ufmt_input = i;
return *this;
}
sentry(*this, true);
if(!basic_ios<charT,traits>::good()){
count_last_ufmt_input = 0;
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
return 0;
}
if( basic_ios<charT, traits>::mstreambuf->in_avail() == -1){
count_last_ufmt_input=0;
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
return 0;
}
_UCXXEXPORT basic_istream<charT,traits>& putback(char_type c){
sentry(*this, true);
if(!basic_ios<charT,traits>::good()){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
return *this;
}
if(basic_ios<charT, traits>::mstreambuf == 0){
basic_ios<charT,traits>::setstate(ios_base::badbit);
//basic_ios<charT,traits>::setstate(ios_base::badbit);
return *this;
}
if(basic_ios<charT, traits>::mstreambuf->sputbackc(c) == traits::eof()){
basic_ios<charT,traits>::setstate(ios_base::badbit);
//basic_ios<charT,traits>::setstate(ios_base::badbit);
return *this;
}
return *this;
_UCXXEXPORT basic_istream<charT,traits>& unget(){
sentry(*this, true);
if(!basic_ios<charT,traits>::good()){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
return *this;
}
if(basic_ios<charT, traits>::mstreambuf == 0){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
return *this;
}
if(basic_ios<charT, traits>::mstreambuf->sungetc() == traits::eof()){
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}
return *this;
}
return -1;
}
if(basic_ios<charT, traits>::mstreambuf->pubsync() == -1){
basic_ios<charT,traits>::setstate(ios_base::badbit);
//basic_ios<charT,traits>::setstate(ios_base::badbit);
return traits::eof();
}
return 0;
};
template <class charT,class traits = char_traits<charT> > class _UCXXEXPORT basic_istream<charT,traits>::sentry {
template <class charT,class traits /*= char_traits<charT>*/ > class _UCXXEXPORT basic_istream<charT,traits>::sentry {
bool ok;
public:
explicit _UCXXEXPORT sentry(basic_istream<charT,traits>& os, bool noskipws = false){
int_type retval = basic_ios<charT, traits>::mstreambuf->sgetc();
if(retval == traits::eof()){
count_last_ufmt_input = 0;
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}else{
count_last_ufmt_input = 1;
basic_ios<charT, traits>::mstreambuf->sbumpc();
int_type retval = basic_ios<charT, traits>::mstreambuf->sgetc();
if(retval == traits::eof()){
count_last_ufmt_input = 0;
basic_ios<charT,traits>::setstate(ios_base::eofbit);
basic_ios<charT,traits>::setstate(ios_base::failbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::failbit);
}else{
count_last_ufmt_input = 1;
c = traits::to_char_type(retval);
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stack
2121
2222
2323
24
25
2624
2725
2826
......
7775
7876
7977
80
81
8278
8379
8480
#ifndef __HEADER_STD_STACK
#define __HEADER_STD_STACK 1
#pragma GCC visibility push(default)
namespace std{
template <class T, class Container = deque<T> > class _UCXXEXPORT stack{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string
3333
3434
3535
36
37
3836
3937
4038
......
426424
427425
428426
429
427
430428
431429
432430
......
456454
457455
458456
459
457
460458
461459
462460
......
472470
473471
474472
475
473
476474
477475
478476
......
485483
486484
487485
488
486
489487
490488
491489
......
503501
504502
505503
506
504
507505
508506
509507
......
515513
516514
517515
518
516
519517
520518
521519
......
534532
535533
536534
537
535
538536
539537
540538
......
10171015
10181016
10191017
1020
1018
10211019
10221020
10231021
1024
1022
10251023
10261024
10271025
......
10371035
10381036
10391037
1040
1041
10421038
#ifndef __HEADER_STD_STRING
#define __HEADER_STD_STRING 1
#pragma GCC visibility push(default)
namespace std{
//Basic basic_string
}
_UCXXEXPORT size_type find (Ch c, size_type pos = 0) const{
for(size_type i = pos; i < length(); ++i){
if(operator[](i) == c){
if(this->operator[](i) == c){
return i;
}
}
_UCXXEXPORT size_type find_first_of(const basic_string& str, size_type pos = 0) const{
for(size_type i = pos; i < length(); ++i){
for(size_type j = 0; j < str.length() ; ++j){
if( Tr::eq(str[j], operator[](i)) ){
if( Tr::eq(str[j], this->operator[](i)) ){
return i;
}
}
}
_UCXXEXPORT size_type find_first_of(Ch c, size_type pos = 0) const{
for(size_type i = pos; i< length(); ++i){
if( Tr::eq(operator[](i), c) ){
if( Tr::eq(this->operator[](i), c) ){
return i;
}
}
}
for(size_type i = pos; i >0 ; --i){
for(size_type j = 0 ; j < str.length(); ++j){
if( Tr::eq(operator[](i-1), str[j]) ){
if( Tr::eq(this->operator[](i-1), str[j]) ){
return i-1;
}
}
pos = length();
}
for(size_type i = pos; i >0 ; --i){
if( Tr::eq(operator[](i-1), c) ){
if( Tr::eq(this->operator[](i-1), c) ){
return i-1;
}
}
for(size_type i = pos; i < length(); ++i){
foundCharacter = false;
for(size_type j = 0; j < str.length() ; ++j){
if( Tr::eq(str[j], operator[](i)) ){
if( Tr::eq(str[j], this->operator[](i)) ){
foundCharacter = true;
}
}
}
_UCXXEXPORT size_type find_first_not_of(Ch c, size_type pos = 0) const{
for(size_type i = pos; i < length() ; ++i){
if(operator[](i) != c){
if(this->operator[](i) != c){
return i;
}
}
template <> _UCXXEXPORT bool operator==(const string & lhs, const string & rhs);
template <> _UCXXEXPORT bool operator==(const char * lhs, const string & rhs);
template <> _UCXXEXPORT bool operator==(const string & rhs, const char * rhs);
template <> _UCXXEXPORT bool operator==(const string & lhs, const char * rhs);
template <> _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs);
template <> _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs);
template <> _UCXXEXPORT bool operator!=(const string & rhs, const char * rhs);
template <> _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs);
template <> _UCXXEXPORT string operator+(const string & lhs, const char* rhs);
template <> _UCXXEXPORT string operator+(const char* lhs, const string & rhs);
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream
2727
2828
2929
30
31
3230
3331
3432
......
9189
9290
9391
94
92
9593
9694
9795
......
10098
10199
102100
103
101
104102
105103
106104
107105
108106
109
107
110108
111109
112110
......
231229
232230
233231
234
232
235233
236234
237235
......
275273
276274
277275
278
276
279277
280278
281279
......
477475
478476
479477
480
481
482478
483479
#include <cstdio>
#include <ostream_helpers>
#pragma GCC visibility push(default)
namespace std {
template <class charT, class traits > class basic_ostream;
typedef basic_ostream<char> ostream;
basic_ios<charT, traits>::mstreambuf->sputc(c),
basic_ostream<charT,traits>::traits_type::eof()))
{
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
return *this;
}
basic_ios<charT, traits>::mstreambuf->sputn(s, n),
basic_ostream<charT,traits>::traits_type::eof())
){
basic_ios<charT,traits>::setstate(ios_base::eofbit);
//basic_ios<charT,traits>::setstate(ios_base::eofbit);
}
return *this;
}
_UCXXEXPORT basic_ostream<charT,traits>& flush(){
if(basic_ios<charT, traits>::mstreambuf->pubsync() == -1){
basic_ios<charT,traits>::setstate(ios_base::badbit);
//basic_ios<charT,traits>::setstate(ios_base::badbit);
}
return *this;
}
{
sentry s(*this);
if(sb == 0){
basic_ios<charT,traits>::setstate(ios_base::badbit);
//basic_ios<charT,traits>::setstate(ios_base::badbit);
return *this;
}
#endif
#endif
template <class charT,class traits = char_traits<charT> >
template <class charT,class traits/* = char_traits<charT>*/ >
class _UCXXEXPORT basic_ostream<charT,traits>::sentry
{
bool ok;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/sstream
2929
3030
3131
32
33
3432
3533
3634
......
376374
377375
378376
379
380
381377
382378
383379
#include <iostream>
#include <string>
#pragma GCC visibility push(default)
namespace std{
template <class charT, class traits, class Allocator>
#endif
#endif
#pragma GCC visibility pop
}
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/csignal
4444
4545
4646
47
48
4947
5048
5149
#ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1
#pragma GCC system_header
#include <signal.h>
// Get rid of those macros defined in <signal.h> in lieu of real functions.
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/valarray
2525
2626
2727
28
29
3028
3129
3230
......
991989
992990
993991
994
995
996992
#include <cstddef>
#include <cmath>
#pragma GCC visibility push(default)
namespace std{
template<class T> class valarray;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/iterator_base
2222
2323
2424
25
26
2725
2826
2927
......
298296
299297
300298
301
302
303299
304300
305301
#ifndef __STD_HEADER_ITERATOR_BASE
#define __STD_HEADER_ITERATOR_BASE 1
#pragma GCC visibility push(default)
namespace std{
template<class Iterator> struct iterator_traits;
template<class T> struct iterator_traits<T*>;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/algorithm
2727
2828
2929
30
31
3230
3331
3432
......
16871685
16881686
16891687
1690
1691
16921688
16931689
16941690
#undef min
#undef max
#pragma GCC visibility push(default)
namespace std{
// subclause _lib.alg.nonmodifying_, non-modifying sequence operations:
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/istream_helpers
2525
2626
2727
28
29
3028
3129
3230
......
5654
5755
5856
59
60
57
58
6159
6260
6361
......
7674
7775
7876
79
80
77
78
8179
8280
8381
......
331329
332330
333331
334
332
335333
336334
337335
338336
339
340
341337
342338
343339
#ifndef __STD_HEADER_ISTREAM_HELPERS
#define __STD_HEADER_ISTREAM_HELPERS 1
#pragma GCC visibility push(default)
namespace std{
break;
}
}
if (temp.size() == 0)
stream.setstate(ios_base::eofbit|ios_base::failbit);
//if (temp.size() == 0)
//stream.setstate(ios_base::eofbit|ios_base::failbit);
return temp;
}
break;
}
}
if (temp.size() == 0)
stream.setstate(ios_base::eofbit|ios_base::failbit);
//if (temp.size() == 0)
//stream.setstate(ios_base::eofbit|ios_base::failbit);
return temp;
}
is.rdbuf()->sbumpc();
}
if(traits::eq_int_type(c, eof)){
is.setstate(ios_base::eofbit);
//is.setstate(ios_base::eofbit);
}
}
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ostream_helpers
2121
2222
2323
24
2425
2526
2627
2728
2829
29
30
3130
3231
3332
......
482481
483482
484483
485
486
487484
488485
489486
#include <cstddef>
#include <ios>
#include <cctype>
#include <cstdio>
#include <string>
#ifndef __STD_HEADER_OSTREAM_HELPERS
#define __STD_HEADER_OSTREAM_HELPERS 1
#pragma GCC visibility push(default)
namespace std{
/* We are making the following template class for serveral reasons. Firstly,
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/locale
2424
2525
2626
27
28
2927
3028
3129
......
7876
7977
8078
81
82
8379
#ifndef __HEADER_STD_LOCALE
#define __HEADER_STD_LOCALE 1
#pragma GCC visibility push(default)
namespace std{
class _UCXXEXPORT locale {
public:
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/vector
2929
3030
3131
32
33
3432
3533
3634
......
511509
512510
513511
514
515
516512
517513
#ifndef __STD_HEADER_VECTOR
#define __STD_HEADER_VECTOR
#pragma GCC visibility push(default)
namespace std{
template <class T, class Allocator = allocator<T> > class vector;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/deque
2121
2222
2323
24
25
2624
2725
2826
......
802800
803801
804802
805
806
807803
808804
809805
#include <iterator>
#include <stdexcept>
#pragma GCC visibility push(default)
#ifndef __STD_HEADER_DEQUE
#define __STD_HEADER_DEQUE
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/stdexcept
2727
2828
2929
30
31
3230
3331
3432
......
111109
112110
113111
114
115
116112
117113
//Don't include support if not needed
#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__
#pragma GCC visibility push(default)
namespace std{
//typedef basic_string<char> string;
}
#pragma GCC visibility pop
#endif
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/list
2424
2525
2626
27
28
2927
3028
3129
......
6260
6361
6462
65
66
67
68
69
70
71
72
73
74
75
76
63
7764
7865
7966
......
547534
548535
549536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
550551
551552
552553
......
920921
921922
922923
923
924
925924
926925
927926
#ifndef __STD_HEADER_LIST
#define __STD_HEADER_LIST 1
#pragma GCC visibility push(default)
namespace std{
template <class T, class Allocator = allocator<T> > class _UCXXEXPORT list {
list(const list<T,Allocator>& x);
~list();
list<T,Allocator>& operator=(const list<T,Allocator>& x){
if(&x == this){
return *this;
}
clear();
iterator i = x.begin();
while(i != x.end()){
push_back(*i);
++i;
}
return *this;
}
list<T,Allocator>& operator=(const list<T,Allocator>& x);
template <class InputIterator> void assign(InputIterator first, InputIterator last);
template <class Size, class U> void assign(Size n, const U& u = U());
}
}
template<class T, class Allocator> list<T,Allocator>& list<T, Allocator>:: operator=(const list<T,Allocator>& x){
if(&x == this){
return *this;
}
clear();
iterator i = x.begin();
while(i != x.end()){
push_back(*i);
++i;
}
return *this;
}
template<class T, class Allocator>
void list<T, Allocator>::splice(iterator position, list<T,Allocator>& x)
{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/basic_definitions
2020
2121
2222
23
24
2523
2624
2725
......
5452
5553
5654
57
58
5955
6056
6157
#include <system_configuration.h>
#pragma GCC visibility push(default)
//The following is used to support GCC symbol visibility patch
#ifdef GCC_HASCLASSVISIBILITY
typedef signed long int streamsize;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/cwctype
4444
4545
4646
47
48
4947
5048
5149
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
#pragma GCC system_header
//#include <bits/c++config.h>
#ifdef __UCLIBCXX_HAS_WCHAR__
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/queue
2323
2424
2525
26
27
2826
2927
3028
......
119117
120118
121119
122
123
124120
125121
126122
#ifndef __HEADER_STD_QUEUE
#define __HEADER_STD_QUEUE 1
#pragma GCC visibility push(default)
namespace std{
template <class T, class Container = deque<T> > class _UCXXEXPORT queue{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/streambuf
2727
2828
2929
30
31
3230
3331
3432
......
324322
325323
326324
327
328
329325
#include <ios>
#pragma GCC visibility push(default)
namespace std{
template <class charT, class traits> class _UCXXEXPORT basic_streambuf{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/new
2424
2525
2626
27
28
2927
3028
3129
......
5856
5957
6058
61
62
6359
6460
#ifndef __STD_NEW_OPERATOR
#define __STD_NEW_OPERATOR 1
#pragma GCC visibility push(default)
namespace std{
class _UCXXEXPORT bad_alloc : public exception {};
inline void* operator new[](std::size_t, void *p) throw() { return p; }
inline void operator delete[](void* , void *) throw() {}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ios
2525
2626
2727
28
29
3028
3129
3230
......
495493
496494
497495
498
499
500496
501497
#ifndef __HEADER_STD_IOS
#define __HEADER_STD_IOS 1
#pragma GCC visibility push(default)
namespace std{
typedef signed long int streamoff;
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/fstream
3939
4040
4141
42
43
4442
4543
4644
......
671669
672670
673671
674
675
676672
677673
678
674
#include <cwctype>
#endif //__UCLIBCXX_HAS_WCHAR__
#pragma GCC visibility push(default)
namespace std{
template <class C, class T> class basic_filebuf;
}
#pragma GCC visibility pop
#endif
#endif
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/ctime
4444
4545
4646
47
48
4947
5048
5149
#ifndef _CPP_CTIME
#define _CPP_CTIME 1
#pragma GCC system_header
#include <cstddef>
#include <time.h>
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/char_traits
2121
2222
2323
24
25
26
27
2824
2925
3026
......
105101
106102
107103
108
109
104
105
110106
111107
112108
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195109
196110
197111
#include <exception>
#include <memory>
#ifdef __UCLIBCXX_HAS_WCHAR__
#include <cwchar>
#include <cwctype>
#endif
#ifndef __HEADER_CHAR_TRAITS
#define __HEADER_CHAR_TRAITS 1
}
}
static state_type get_state(pos_type p){
p = p;
state_type a;
//p = p;
state_type a = 0;
return a;
}
};
#ifdef __UCLIBCXX_HAS_WCHAR__
template<> struct _UCXXEXPORT char_traits<wchar_t> {
typedef wchar_t char_type;
typedef wint_t int_type;
typedef char_traits_off_type off_type;
typedef char_traits_off_type pos_type;
typedef mbstate_t state_type;
static void assign(char_type & c, const char_type & d){ c=d; }
static char_type to_char_type(const int_type & i){
return i;
}
static int_type to_int_type(const char_type & c){
return c;
}
inline static bool eq_int_type(const int_type & a, const int_type & b){
if(a==b){
return true;
}
return false;
}
inline static bool eq(const char_type& c1, const char_type& c2){
if(wcsncmp(&c1, &c2, 1) == 0){
return true;
}
return false;
}
inline static bool lt(const char_type& c1, const char_type& c2){
if(wcsncmp(&c1, &c2, 1) < 0){
return true;
}
return false;
}
inline static char_type* move(char_type* s1, const char_type* s2, size_t n){
return (char_type*) memmove(s1, s2, n * sizeof(char_type));
}
inline static char_type* copy(char_type* s1, const char_type* s2, size_t n){
for(unsigned long int i=0; i< n; ++i){
assign(s1[i], s2[i]);
}
return s1 + n;
}
inline static char_type* assign(char_type* s, size_t n, char_type a){
return (char_type *)memset(s, a, n);/*FIXME*/
}
inline static int compare(const char_type* s1, const char_type* s2, size_t n){
return wcsncmp(s1, s2, n);
}
inline static size_t length(const char_type* s){
return wcslen(s);
}
static const char_type* find(const char_type* s, int n, const char_type& a);
inline static char_type eos() { return 0; }
inline static int_type eof() { return WEOF; }
inline static int_type not_eof(const int_type & i) {
if(i == WEOF){
return (int_type)0;
} else {
return i;
}
}
static state_type get_state(pos_type){
state_type a;
return a;
}
};
#endif
}
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/associative_base
2828
2929
3030
31
32
3331
3432
3533
......
513511
514512
515513
516
514
517515
518516
519517
......
522520
523521
524522
525
523
526524
527525
528526
......
636634
637635
638636
639
640
641637
642638
643639
#ifndef __STD_HEADER_ASSOCIATIVE_BASE
#define __STD_HEADER_ASSOCIATIVE_BASE
#pragma GCC visibility push(default)
namespace std{
pair<iterator, bool> insert(const value_type& x){
pair<iterator, bool> retval;
iterator location = lower_bound(value_to_key(x));
iterator location = lower_bound(this->value_to_key(x));
retval.second = true;
//Empty list or need to insert at end
if(end() == location){
return retval;
}
//Something in the list
if(c(value_to_key(x), value_to_key(*location))){
if(c(this->value_to_key(x), this->value_to_key(*location))){
location = backing.insert(location.base_iterator(), x);
retval.first = location;
}else{
}
#pragma GCC visibility pop
#endif//__STD_HEADER_ASSOCIATIVE_BASE
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/func_exception
2424
2525
2626
27
28
2927
3028
3129
......
3533
3634
3735
38
39
4036
4137
#ifndef HEADER_IMPLEMENTATION_FUNC_EXCEPTION
#define HEADER_IMPLEMENTATION_FUNC_EXCEPTION
#pragma GCC visibility push(default)
namespace std{
_UCXXEXPORT void __throw_bad_alloc();
_UCXXEXPORT void __throw_invalid_argument(const char * message = 0);
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/include/string_iostream
2929
3030
3131
32
33
3432
3533
3634
......
140138
141139
142140
143
144
145141
146142
#ifndef __HEADER_STD_STRING_IOSTREAM
#define __HEADER_STD_STRING_IOSTREAM 1
#pragma GCC visibility push(default)
namespace std{
}
#pragma GCC visibility pop
#endif
branches/ErmaC/Trunk/i386/modules/uClibcxx/string.cpp
7676
7777
7878
79
79
8080
8181
8282
83
83
8484
8585
8686
template _UCXXEXPORT bool operator==(const string & lhs, const string & rhs);
template _UCXXEXPORT bool operator==(const char * lhs, const string & rhs);
template _UCXXEXPORT bool operator==(const string & rhs, const char * rhs);
template _UCXXEXPORT bool operator==(const string & lhs, const char * rhs);
template _UCXXEXPORT bool operator!=(const string & lhs, const string & rhs);
template _UCXXEXPORT bool operator!=(const char * lhs, const string & rhs);
template _UCXXEXPORT bool operator!=(const string & rhs, const char * rhs);
template _UCXXEXPORT bool operator!=(const string & lhs, const char * rhs);
template _UCXXEXPORT string operator+(const string & lhs, const char* rhs);
template _UCXXEXPORT string operator+(const char* lhs, const string & rhs);
branches/ErmaC/Trunk/i386/modules/MakeInc.dir
1818
1919
2020
21
22
23
21
22
2423
25
26
27
28
24
25
26
2927
3028
3129
3230
3331
34
35
36
32
33
3734
3835
39
40
41
42
36
37
38
4339
4440
4541
ifeq ($(BUILT_IN),yes)
CFLAGS:= $(RC_CFLAGS) $(OPTIM) $(MORECPP) -arch i386 -g -Wmost -Werror \
-fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \
-mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
-fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) -fno-stack-protector \
-march=pentium4 -msse2 -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc++ -Wmost -Werror \
-fno-builtin -mpreferred-stack-boundary=2 \
-fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float \
CPPFLAGS := $(CPPFLAGS) -arch i386 -static -nostdinc -Wmost -Werror \
-fno-builtin -fno-stack-protector \
-march=pentium4 -msse2 -msoft-float \
-arch i386 -include $(SRCROOT)/autoconf.h
else
CFLAGS := $(CLFAGS) -nostdinc -Wmost -Werror \
-fno-builtin -mpreferred-stack-boundary=2 \
-fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float \
-fno-builtin -fno-stack-protector \
-march=pentium4 -msse2 -msoft-float \
-arch i386 -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -nostdinc++ -Wmost -Werror \
-fno-builtin -mpreferred-stack-boundary=2 \
-fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float \
CPPFLAGS := $(CPPFLAGS) -nostdinc -Wmost -Werror \
-fno-builtin -fno-stack-protector \
-march=pentium4 -msse2 -msoft-float \
-arch i386 -include $(SRCROOT)/autoconf.h
endif
branches/ErmaC/Trunk/i386/modules/Keylayout/layouts/Makefile
88
99
1010
11
11
1212
1313
1414
......
3030
3131
3232
33
33
3434
3535
36
36
3737
3838
3939
INC = -I$(SRCROOT)/i386/libsaio/ -I. -I..
OBJS = cham-mklayout.o32_nodep cham-mklayout.o64_nodep #in case we use our own md, we can't make these files with the standard rules, it too early, md doesn't even exist
OBJS = cham-mklayout.o32 cham-mklayout.o64
OBJS := $(addprefix $(OBJROOT)/, $(OBJS))
$(PROGRAMS): $(OBJS)
@echo "\t[LD32] $(@F)_32"
@$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch i386 \
-o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32_nodep
-o $(SYMROOT)/$(@F)_32 $(OBJROOT)/$(@F).o32
@echo "\t[LD64] $(@F)_64"
@$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -arch x86_64 \
-o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64_nodep
-o $(SYMROOT)/$(@F)_64 $(OBJROOT)/$(@F).o64
@echo "\t[LIPO] $(@F)"
@lipo -create -arch i386 $(SYMROOT)/$(@F)_32 -arch x86_64 $(SYMROOT)/$(@F)_64 \
-output $(SYMROOT)/$(@F)
branches/ErmaC/Trunk/i386/modules/KernelPatcher/Cconfig
1
2
3
4
5
6
7
8
9
10
#
# Chameleon Modules
#
config KERNELPATCHER_MODULE
bool "KernelPatcher Module"
default y
---help---
Say Y here if you want to enable to use of this module.
branches/ErmaC/Trunk/i386/modules/KernelPatcher/Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
MODULE_NAME = KernelPatcher
MODULE_AUTHOR = Evan Lojewski
MODULE_DESCRIPTION = Kernel patcher
MODULE_VERSION = "1.1.0"
MODULE_COMPAT_VERSION = "1.0.0"
MODULE_START = $(MODULE_NAME)_start
MODULE_DEPENDENCIES =
DIR = KernelPatcher
include ../MakeInc.dir
$(SYMROOT)/modules/$(MODULE_NAME).dylib:
@echo "\t[CP] $(MODULE_NAME).dylib"
@cp $(MODULE_NAME).dylib $(SRCROOT)/sym/i386/modules/$(MODULE_NAME).dylib
$(SRCROOT)/sym/i386/boot_modules.c:
@
branches/ErmaC/Trunk/i386/modules/Cconfig
1010
1111
1212
13
1314
source "i386/modules/Sata/Cconfig"
source "i386/modules/Keylayout/Cconfig"
source "i386/modules/ACPIcodec/Cconfig"
source "i386/modules/KernelPatcher/Cconfig"
endmenu
branches/ErmaC/Trunk/i386/modules/AcpiCodec/acpi_codec.c
50565056
50575057
50585058
5059
5059
50605060
50615061
5062
5063
5064
5062
5063
5064
50655065
5066
5067
5068
5069
5066
5067
5068
5069
50705070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
50805083
5081
5082
5083
5084
50845085
5085
5086
5087
5088
5089
5086
5087
5088
5089
5090
50905091
5091
5092
50925093
5093
5094
5095
5096
5097
5098
5094
5095
50995096
5100
5097
5098
51015099
5102
5103
5100
5101
5102
51045103
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5104
5105
5106
5107
51235108
5124
5125
5109
5110
5111
51265112
5127
5128
5129
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
51305134
5131
5135
51325136
5133
5137
51345138
5135
5139
51365140
5137
5141
51385142
51395143
5140
5141
5144
5145
51425146
5143
5147
51445148
5145
5149
51465150
5147
5151
51485152
5149
5150
5153
5154
51515155
51525156
51535157
......
51595163
51605164
51615165
5162
5163
5166
5167
51645168
51655169
51665170
......
51715175
51725176
51735177
5174
5178
51755179
51765180
getBoolForKey(kSTRIPAPIC, &strip_madt, &bootInfo->chameleonConfig);
if ((strip_madt == false) || (!buildMADT(new_table_list, DsdtPtr, &madt_info )))
if ((strip_madt == false) || (!buildMADT(new_table_list, DsdtPtr, &madt_info )))
{
ACPI_TABLE_MADT * madt_file = (void*)0ul;
ACPI_TABLE_MADT * MadtPointer = (void*)0ul;
bool oem_apic=false;
ACPI_TABLE_MADT * madt_file = (void*)0ul;
ACPI_TABLE_MADT * MadtPointer = (void*)0ul;
bool oem_apic=false;
{
bool tmpval;
oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval;
}
{
bool tmpval;
oem_apic=getBoolForKey(kOEMAPIC, &tmpval, &bootInfo->chameleonConfig)&&tmpval;
}
if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul)
{
if (oem_apic == false)
{
MadtPointer = (ACPI_TABLE_MADT *)madt_file;
}
} else
MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer;
if ((madt_file = (ACPI_TABLE_MADT *)get_new_table_in_list(new_table_list, NAMESEG("APIC"), &new_table_index)) != (void *)0ul)
{
if (oem_apic == false)
{
MadtPointer = (ACPI_TABLE_MADT *)madt_file;
}
}
else
MadtPointer = (acpi_tables.MadtPointer64 != (void*)0ul) ? (ACPI_TABLE_MADT *)acpi_tables.MadtPointer64 : (ACPI_TABLE_MADT *)acpi_tables.MadtPointer;
ProcessMadtInfo(MadtPointer, &madt_info);
ProcessMadtInfo(MadtPointer, &madt_info);
}
}
if (gen_ssdt || gen_csta || gen_psta || gen_tsta)
{
ProcessSsdt(new_table_list, DsdtPtr, &madt_info, gen_csta, gen_psta, gen_tsta );
}
}
if (gen_ssdt || gen_csta || gen_psta || gen_tsta)
{
ProcessSsdt(new_table_list, DsdtPtr, &madt_info, gen_csta, gen_psta, gen_tsta );
}
}
if ((rsdp_mod != (void *)0ul) && (rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE) )
if (rsdp_mod == (void *)0ul)
{
if ((rsdp_mod->Revision == 0) || (gen_xsdt == true))
{
process_rsdt(rsdp_mod, gen_xsdt, new_table_list);
goto out;
}
printf("Error: rsdp_mod == null \n");
return EFI_ABORTED;
}
else
if (!(rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE))
{
printf("Error: Incorect ACPI RSD PTR or not found \n");
return EFI_UNSUPPORTED;
printf("Error: rsdp_mod size is incorrect \n");
return EFI_ABORTED;
}
if ((GetChecksum(rsdp_mod, sizeof(ACPI_TABLE_RSDP)) == 0) &&
(Revision == 2) &&
(rsdplength == sizeof(ACPI_TABLE_RSDP)))
{
process_xsdt(rsdp_mod, new_table_list);
}
else
{
printf("Warning : ACPI RSD PTR Revision 2 is incorrect, \n");
printf(" trying to fallback to Revision 1\n");
if ((rsdp_mod != (void *)0ul) && (rsdp_mod->Length >= ACPI_RSDP_REV0_SIZE) )
{
process_rsdt(rsdp_mod, false, new_table_list);
}
else
do {
if ((rsdp_mod->Revision == 0) || (gen_xsdt == true))
{
printf("Error: Incorect ACPI RSD PTR or not found \n");
return EFI_UNSUPPORTED;
if (process_rsdt(rsdp_mod, gen_xsdt, new_table_list))
break;
printf("Error : ACPI RSD PTR Revision 1 is incorrect, \n");
}
}
out:
if ((GetChecksum(rsdp_mod, sizeof(ACPI_TABLE_RSDP)) == 0) &&
(Revision == 2) &&
(rsdplength == sizeof(ACPI_TABLE_RSDP)))
{
if (process_xsdt(rsdp_mod, new_table_list))
break;
printf("Error : ACPI RSD PTR Revision 2 is incorrect \n");
}
Revision = 0; // fallback to Revision 0
if (process_rsdt(rsdp_mod, false, new_table_list))
break;
printf("Error: Incorect ACPI RSD PTR or not found \n");
return EFI_ABORTED;
} while (0);
// Correct the checksum of RSDP
DBG("RSDP: Original checksum %d\n", rsdp_mod->Checksum);
setRsdpchecksum(rsdp_mod);
DBG("New checksum %d\n", rsdp_mod->Checksum);
if (Revision == 2)
{
DBG("RSDP: Original extended checksum %d\n", rsdp_mod->ExtendedChecksum);
DBG("RSDP: Original extended checksum %d\n", rsdp_mod->ExtendedChecksum);
setRsdpXchecksum(rsdp_mod);
DBG("New extended checksum %d\n", rsdp_mod->ExtendedChecksum);
}
verbose("ACPI Revision %d successfully patched\n", Revision);
if (Revision == 2)
if (Revision == 2)
{
/* XXX aserebln why uint32 cast if pointer is uint64 ? */
rsd_p = (U32)rsdp_mod;
rsd_p = (U32)rsdp_mod;
addConfigurationTable(&gEfiAcpiTableGuid, &rsd_p, "ACPI");
}
#if DEBUG_ACPI==2
printf("Press a key to continue... (DEBUG_ACPI)\n");
getc();
int AcpiSetup(void)
{
EFI_STATUS status = setup_Acpi();
return (status == EFI_SUCCESS);
}
branches/ErmaC/Trunk/i386/modules/HelloWorld/HelloWorld.cpp
2020
2121
2222
23
24
2325
2426
2527
......
5557
5658
5759
60
61
62
63
public:
virtual void setId( int id );
virtual void printHello( void );
virtual ~HW();
};
void helloWorld(void* binary, void* arg2, void* arg3, void* arg4)
{
this->id = id;
}
HW::~HW()
{
}
branches/ErmaC/Trunk/i386/modules/Makefile
1111
1212
1313
14
14
1515
1616
1717
......
3434
3535
3636
37
37
3838
3939
4040
41
41
4242
4343
4444
include ${SRCROOT}/Make.rules
# The order of building modules is important.
SUBDIRS =
SUBDIRS = KernelPatcher
ifdef CONFIG_KLIBC_MODULE
SUBDIRS += klibc
endif
ifdef CONFIG_SATA_MODULE
SUBDIRS += sata
SUBDIRS += Sata
endif
ifdef CONFIG_ACPICODEC_MODULE
SUBDIRS += ACPICodec
SUBDIRS += AcpiCodec
endif
CFLAGS= -O3 $(MORECPP) -arch i386 -g -static
branches/ErmaC/Trunk/i386/libsa/Makefile
1414
1515
1616
17
18
17
1918
2019
2120
CFLAGS:= $(CFLAGS) $(RC_CFLAGS) $(MORECPP) -arch i386 \
-fno-builtin -static $(OMIT_FRAME_POINTER_CFLAG) \
-mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float \
-march=pentium4 -msse2 -msoft-float -fno-stack-protector \
-nostdinc -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -nostdinc++
branches/ErmaC/Trunk/i386/util/dyldsymboltool.c
9191
9292
9393
94
95
94
95
96
97
98
99
100
101
102
96103
97104
98105
char* name = strtok(NULL, " ");
name[strlen(name)-1] = 0;// remove newline
sscanf(addr, "%x", &address);
if(strcmp(name, VOID_SYMBOL) == 0) start_addr = address;
add_symbol(&symbols, name, address);
if(strcmp(name, VOID_SYMBOL) == 0)
{
start_addr = address;
}
if(strcmp(name, START_SYMBOL) == 0)
{
if(!start_addr) start_addr = address;
}
else add_symbol(&symbols, name, address);
}
}
branches/ErmaC/Trunk/i386/util/segsize.c
1
2
3
4
5
6
7
8
9
10
11
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
* Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
* Reserved. This file contains Original Code and/or Modifications of
* Original Code as defined in and that are subject to the Apple Public
* Source License Version 2.0 (the "License"). You may not use this file
* except in compliance with the License. Please obtain a copy of the
* License at http://www.apple.com/publicsource and read it before using
* this file.
*
* The Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <sys/file.h>
#include <mach-o/loader.h>
#include <libkern/OSByteOrder.h>
#include <unistd.h>
intinfile;
struct mach_headermh;
void *cmds;
static boolswap_ends;
static unsigned long swap(
unsigned long x
)
{
if (swap_ends)
return OSSwapInt32(x);
else
return x;
}
int
main(int argc, char *argv[])
{
intnc, ncmds;
char *cp;
if (argc == 3) {
infile = open(argv[1], O_RDONLY);
if (infile < 0)
goto usage;
}
else {
usage:
fprintf(stderr, "usage: segsize segment\n");
exit(1);
}
nc = read(infile, &mh, sizeof (mh));
if (nc < 0) {
perror("read mach header");
exit(1);
}
if (nc < (int)sizeof (mh)) {
fprintf(stderr, "read mach header: premature EOF %d\n", nc);
exit(1);
}
if (mh.magic == MH_MAGIC)
swap_ends = false;
else if (mh.magic == MH_CIGAM)
swap_ends = true;
else {
fprintf(stderr, "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");
exit(1);
}
nc = read(infile, cmds, swap(mh.sizeofcmds));
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);
exit(1);
}
for (ncmds = swap(mh.ncmds), cp = cmds;
ncmds > 0; ncmds--) {
// boolisDATA;
// unsignedvmsize;
#define lcp((struct load_command *)cp)
switch(swap(lcp->cmd)) {
case LC_SEGMENT:
#define scp((struct segment_command *)cp)
if(strcmp(scp->segname, argv[2]) == 0)
{
printf("%ld\n", swap(scp->vmsize));
#if 0
if (isDATA)
vmsize = swap(scp->filesize);
else
vmsize = swap(scp->vmsize);
#endif
}
break;
}
cp += swap(lcp->cmdsize);
}
exit(0);
}
branches/ErmaC/Trunk/i386/util/Makefile
1616
1717
1818
19
20
19
20
2121
2222
2323
DIR = util
include ${SRCROOT}/Make.rules
PROGRAMS = machOconv dyldsymboltool
OBJS = dyldsymboltool.o32 dyldsymboltool.o64 machOconv.o32 machOconv.o64
PROGRAMS = machOconv dyldsymboltool segsize
OBJS = dyldsymboltool.o32 dyldsymboltool.o64 machOconv.o32 machOconv.o64 segsize.o32 segsize.o64
ifeq (${CONFIG_BDMESG}, y)
branches/ErmaC/Trunk/i386/util/machOconv.c
3636
3737
3838
39
40
41
39
4240
43
44
45
46
41
42
4743
4844
4945
......
5450
5551
5652
57
58
59
60
61
53
54
55
56
57
6258
63
59
60
6461
65
66
67
68
69
62
63
64
7065
71
72
66
67
68
7369
74
70
7571
7672
7773
78
79
80
74
75
76
77
8178
82
83
84
79
80
81
82
83
8584
86
87
88
89
90
85
86
87
88
89
90
9191
92
92
9393
9494
9595
96
97
98
96
97
98
99
99100
100101
101
102
103
102
103
104
105
104106
105
106
107
107
108
109
110
108111
109112
110
111
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
112141
113142
114143
115
116
144
145
146
147
148
149
150
151
152
153
154
155
117156
118
119
120
121
122
123
124
125
126
127
128
129
157
158
159
160
161
162
130163
131
132
133
134
135
136
137
138
139
140
164
165
166
167
168
169
170
171
172
173
174
141175
142
143
144
145
146
147
148
149
176
177
178
179
180
181
182
183
184
185
186
187
188
150189
151
152
153
154190
155
191
156192
static boolswap_ends;
static unsigned long swap(
unsigned long x
)
static unsigned long swap(unsigned long x)
{
if (swap_ends)
return OSSwapInt32(x);
else
return x;
if (swap_ends)return OSSwapInt32(x);
elsereturn x;
}
int
intnc, ncmds;
char *cp;
if (argc == 2) {
infile = open(argv[1], O_RDONLY);
if (infile < 0)
goto usage;
outfile = fileno(stdout);
if (argc == 2)
{
infile = open(argv[1], O_RDONLY);
if (infile < 0)goto usage;
outfile = fileno(stdout);
}
else if (argc == 3) {
else if (argc == 3)
{
infile = open(argv[1], O_RDONLY);
if (infile < 0)
goto usage;
outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (outfile < 0)
goto usage;
if (infile < 0)goto usage;
outfile = open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644);
if (outfile < 0)goto usage;
}
else {
usage:
else
{
usage:
fprintf(stderr, "usage: machOconv inputfile [outputfile]\n");
exit(1);
exit(1);
}
nc = read(infile, &mh, sizeof (mh));
if (nc < 0) {
perror("read mach header");
exit(1);
if (nc < 0)
{
perror("read mach header");
exit(1);
}
if (nc < (int)sizeof (mh)) {
fprintf(stderr, "read mach header: premature EOF %d\n", nc);
exit(1);
if (nc < (int)sizeof (mh))
{
fprintf(stderr, "read mach header: premature EOF %d\n", nc);
exit(1);
}
if (mh.magic == MH_MAGIC)
swap_ends = false;
else if (mh.magic == MH_CIGAM)
swap_ends = true;
else {
if (mh.magic == MH_MAGIC)swap_ends = false;
else if (mh.magic == MH_CIGAM)swap_ends = true;
else
{
fprintf(stderr, "bad magic number %lx\n", (unsigned long)mh.magic);
exit(1);
exit(1);
}
cmds = calloc(swap(mh.sizeofcmds), sizeof (char));
if (cmds == 0) {
fprintf(stderr, "alloc load commands: no memory\n");
exit(1);
if (cmds == 0)
{
fprintf(stderr, "alloc load commands: no memory\n");
exit(1);
}
nc = read(infile, cmds, swap(mh.sizeofcmds));
if (nc < 0) {
perror("read load commands");
exit(1);
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);
exit(1);
if (nc < (int)swap(mh.sizeofcmds))
{
fprintf(stderr, "read load commands: premature EOF %d\n", nc);
exit(1);
}
for (ncmds = swap(mh.ncmds), cp = cmds;
ncmds > 0; ncmds--) {
unsigned long vmstart = (unsigned long)-1;
// First pass: determine actual load address
for (ncmds = swap(mh.ncmds), cp = cmds;
ncmds > 0; ncmds--)
{
#define lcp((struct load_command *)cp)
#define scp((struct segment_command *)cp)
switch(swap(lcp->cmd))
{
case LC_SEGMENT:
if(vmstart > swap(scp->vmaddr))
{
vmstart = swap(scp->vmaddr);
}
}
cp += swap(lcp->cmdsize);
}
// Second pass: output to file.
for (ncmds = swap(mh.ncmds), cp = cmds;
ncmds > 0; ncmds--)
{
#define lcp((struct load_command *)cp)
#define scp((struct segment_command *)cp)
boolisDATA;
unsignedvmsize;
#define lcp((struct load_command *)cp)
switch(swap(lcp->cmd)) {
switch(swap(lcp->cmd))
{
case LC_SEGMENT:
isDATA = (strcmp(scp->segname, "__DATA") == 0);
if (isDATA)
{
vmsize = swap(scp->filesize);
}
else
{
vmsize = swap(scp->vmsize);
}
case LC_SEGMENT:
#define scp((struct segment_command *)cp)
isDATA = (strcmp(scp->segname, "__DATA") == 0);
if (isDATA)
vmsize = swap(scp->filesize);
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);
exit(1);
}
result = vm_allocate(mach_task_self(), &data, vmsize, true);
if (result != KERN_SUCCESS)
{
mach_error("vm_allocate segment data", result);
exit(1);
}
lseek(infile, swap(scp->fileoff), L_SET);
nc = read(infile, (void *)data, swap(scp->filesize));
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);
exit(1);
}
lseek(infile, swap(scp->fileoff), L_SET);
nc = read(infile, (void *)data, swap(scp->filesize));
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);
exit(1);
}
nc = write(outfile, (void *)data, vmsize);
if (nc < (int)vmsize) {
perror("write segment data");
exit(1);
}
vm_deallocate(mach_task_self(), data, vmsize);
break;
lseek(outfile, swap(scp->vmaddr) - vmstart, L_SET);
nc = write(outfile, (void *)data, vmsize);
if (nc < (int)vmsize)
{
perror("write segment data");
exit(1);
}
vm_deallocate(mach_task_self(), data, vmsize);
break;
}
cp += swap(lcp->cmdsize);
}
cp += swap(lcp->cmdsize);
}
exit(0);
exit(0);
}
branches/ErmaC/Trunk/package/Resources/templates/Localizable.strings
6060
6161
6262
63
64
65
66
67
68
69
70
71
72
73
74
6375
6476
6577
Source: http://cxx.uclibc.org/
Dependencies: klibc";
"KernelPatcher_title" = "Kernel Patcher";
"KernelPatcher_description" = "The KernelPatcher module provides patches for the following:
Enables the use of the kernelcache with /Extra/Extensions and /Extra/Extensions.mkext
Removed the CPUID check
Removes an LAPIC panic
Removes a panic in commpage_stuff_routine
Dependencies: none";
"KextPatcher_title" = "Kext Patcher";
"KernelPatcher_description" = "The KextPatcher module provides patches for the following:
Dependencies: none";
// ============================================================================
// Boot Options - The follow options are split to match the layout OptionalSettings text files.
// but they can be changed to suit however anyone wants to do it.
branches/ErmaC/Trunk/package/buildpkg.sh
524524
525525
526526
527
528
529
530
527531
528532
533
529534
530
531
532
533535
534536
535537
536538
537539
538540
539
541
540542
541
542
543
543
544
545
544546
545
547
546548
547549
548550
......
551553
552554
553555
554
556
555557
556558
557
558559
559
560
560
561561
562
563
564
565
566
567
568
562
563
564
569565
570566
571567
......
575571
576572
577573
578
579
580
574
575
581576
582577
583578
584
579
585580
586
587
588
581
582
583
589584
590585
591586
......
596591
597592
598593
599
594
600595
601596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
602623
624
625
626
627
628
629
630
631
603632
604
633
605634
606
607
608
635
636
637
609638
610
639
611640
612641
613642
......
616645
617646
618647
619
648
620649
621650
622
623651
624652
625653
......
639667
640668
641669
670
671
672
673
674
675
676
677
678
679
680
681
642682
683
684
685
686
687
688
643689
644
645
690
691
646692
647
648
649
650
651
652
653
654
655
656
693
694
695
657696
658
659
660
661
662
663
664
697
698
699
700
701
665702
666703
667704
668705
669706
670707
671
672
673
674
675
708
709
710
711
676712
677713
678
714
679715
680716
681717
###############################
# Supported Modules #
###############################
# ACPICodec.dylib #
# KernelPatcher.dylib #
# KextPatcher.dylib #
# Keylayout.dylib #
# klibc.dylib #
# Resolution.dylib #
# Sata.dylib #
# uClibcxx.dylib #
# Sata.dylib #
# ACPICodec.dylib #
# Keylayout.dylib #
###############################
if [ "$(ls -A "${SYMROOT}/i386/modules")" ]; then
{
addGroupChoices "Module"
# -
if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then
if [[ "${CONFIG_ACPICODEC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/ACPICodec.dylib" ]]; then
{
# Start build klibc package module
choiceId="klibc"
moduleFile="${choiceId}.dylib"
# Start build ACPICodec package module
choiceId="ACPICodec"
moduleFile="ACPICodec.dylib"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" ${PKG_BUILD_DIR}/${choiceId}/Root
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
--subst="moduleName=$choiceId" \
--subst="moduleFile=$moduleFile" \
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
# End build klibc package module
# End build ACPICodec package module
}
fi
# -
if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \
-f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then
if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/KernelPatcher.dylib" ]]; then
{
klibcPackageRefId=""
if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then
klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc")
fi
# Start build uClibc package module
choiceId="uClibc"
moduleFile="uClibcxx.dylib"
# Start build KernelPatcher package module
choiceId="KernelPatcher"
moduleFile="KernelPatcher.dylib"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
# Add the klibc package because the uClibc module is dependent of klibc module
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId $klibcPackageRefId" "${choiceId}"
# End build uClibc package module
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
# End build KernelPatcher package module
}
fi
# -
if [[ "${CONFIG_SATA_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Sata.dylib" ]]; then
if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/KextPatcher.dylib" ]]; then
{
# Start build Sata package module
choiceId="Sata"
moduleFile="Sata.dylib"
# Start build KextPatcher package module
choiceId="KextPatcher"
moduleFile="KextPatcher.dylib"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
# End build Sata package module
# End build KextPatcher package module
}
fi
# -
# Warning Keylayout module need additional files
if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then
{
# Start build Keylayout package module
choiceId="Keylayout"
moduleFile="${choiceId}.dylib"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps}
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src"
if [ -d "$layout_src_dir" ];then
# Create a tar.gz from layout sources
(cd "$layout_src_dir"; \
tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt)
fi
# Adding module
ditto --noextattr --noqtn ${SYMROOT}/i386/modules/$moduleFile ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules
# Adding Keymaps
ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps
# Adding tools
ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
# Adding scripts
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
--subst="moduleName=$choiceId" \
--subst="moduleFile=$moduleFile" \
InstallModule
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
# Don't add a choice for Keylayout module
# addChoice "${choiceId}" "Module" --start-selected="false" "$packageRefId"
# End build Keylayout package module
}
fi
# -
if [[ "${CONFIG_ACPICODEC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/ACPICodec.dylib" ]]; then
if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then
{
# Start build ACPICodec package module
choiceId="ACPICodec"
moduleFile="ACPICodec.dylib"
# Start build klibc package module
choiceId="klibc"
moduleFile="${choiceId}.dylib"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" ${PKG_BUILD_DIR}/${choiceId}/Root
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
--subst="moduleName=$choiceId" \
--subst="moduleFile=$moduleFile" \
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
# End build ACPICodec package module
# End build klibc package module
}
fi
# -
if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then
{
# End build Resolution package module
}
fi
# -
if [[ "${CONFIG_SATA_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Sata.dylib" ]]; then
{
# Start build Sata package module
choiceId="Sata"
moduleFile="Sata.dylib"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
--subst="moduleName=$choiceId" \
--subst="moduleFile=$moduleFile" \
InstallModule
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId" "${choiceId}"
# End build Sata package module
}
fi
# -
# Warning Keylayout module need additional files
if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then
if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \
-f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then
{
# Start build Keylayout package module
choiceId="Keylayout"
moduleFile="${choiceId}.dylib"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/{modules,Keymaps}
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
layout_src_dir="${SRCROOT}/i386/modules/Keylayout/layouts/layouts-src"
if [ -d "$layout_src_dir" ];then
# Create a tar.gz from layout sources
(cd "$layout_src_dir"; \
tar czf "${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps/layouts-src.tar.gz" README *.slt)
klibcPackageRefId=""
if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then
klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc")
fi
# Adding module
ditto --noextattr --noqtn ${SYMROOT}/i386/modules/$moduleFile ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/modules
# Adding Keymaps
ditto --noextattr --noqtn ${SRCROOT}/Keymaps ${PKG_BUILD_DIR}/${choiceId}/Root/Extra/Keymaps
# Adding tools
ditto --noextattr --noqtn ${SYMROOT}/i386/cham-mklayout ${PKG_BUILD_DIR}/${choiceId}/Root/usr/local/bin
# Adding scripts
# Start build uClibc package module
choiceId="uClibc"
moduleFile="uClibcxx.dylib"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/$moduleFile" "${PKG_BUILD_DIR}/${choiceId}/Root"
addTemplateScripts --pkg-rootdir="${PKG_BUILD_DIR}/${choiceId}" \
--subst="moduleName=$choiceId" \
--subst="moduleFile=$moduleFile" \
InstallModule
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/"
# Don't add a choice for Keylayout module
# addChoice "${choiceId}" "Module" --start-selected="false" "$packageRefId"
# End build Keylayout package module
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/Extra/modules"
# Add the klibc package because the uClibc module is dependent of klibc module
addChoice --group="Module" --start-selected="false" --pkg-refs="$packageRefId $klibcPackageRefId" "${choiceId}"
# End build uClibc package module
}
fi
# -
}
else
{
branches/ErmaC/Trunk/CHANGES
1
2
13
24
35
- sync with trunk (2110)
- Merge more cparm's (security, stability, bugs fixes) improvements from his branch.
- cparm : Added two boot options for High resolution display and reboot on kernel panic
- cparm : Added a workaroud for Xcode 4.4.x compatibility 504B030414030100630004731141000000007D0000008B00000003000B0062696E01990700020041450308001AED80DA50DF6080B0390FE095B3BC129E1FC27C104EC97897EF27CD1175766CB18C66FF42EFB7023911BDFD5E4BC9AEEC32FF3473963F70B255581D7B74DE9F
- cparm : Fixed a buffer overflow in the plist loader

Archive Download the corresponding diff file

Revision: 2111