Index: trunk/i386/libsaio/xml.c =================================================================== --- trunk/i386/libsaio/xml.c (revision 2632) +++ trunk/i386/libsaio/xml.c (revision 2633) @@ -41,7 +41,7 @@ if(tmp->id == id) { tmp->string = malloc(strlen(string)+1); - snprintf(tmp->string, strlen(string)+1,"%s", string); + strncpy(tmp->string, string, strlen(string)+1); return; } tmp = tmp->next; @@ -49,7 +49,7 @@ string_ref *new_ref = malloc(sizeof(string_ref)); new_ref->string = malloc(strlen(string)+1); - snprintf(new_ref->string, (strlen(string)+1)* sizeof(char),"%s", string); + strncpy(new_ref->string, string, (strlen(string)+1)* sizeof(char)); new_ref->id = id; new_ref->next = ref_strings; ref_strings = new_ref; Index: trunk/i386/libsaio/asm.s =================================================================== --- trunk/i386/libsaio/asm.s (revision 2632) +++ trunk/i386/libsaio/asm.s (revision 2633) @@ -303,17 +303,15 @@ movzwl %sp, %esp movzwl %bp, %ebp - // Modify caller's return address on the stack - // from linear address to segment offset. - - popl %eax - // Reenable maskable interrupts. sti - jmp *%ax + // Modify caller's return address on the stack + // from linear address to segment offset. + ret $2 + .code32 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: trunk/i386/libsaio/console.c =================================================================== --- trunk/i386/libsaio/console.c (revision 2632) +++ trunk/i386/libsaio/console.c (revision 2633) @@ -130,7 +130,7 @@ cursor = msgbuf; msglog("%s\n", "Chameleon " I386BOOT_CHAMELEONVERSION " (svn-r" I386BOOT_CHAMELEONREVISION ")" " [" I386BOOT_BUILDDATE "]"); getRTCdatetime(); - verbose("Logging started: %04d/%02d/%02d, %02d:%02d:%02d\n", datetime.year, datetime.mon, datetime.day, datetime.hour, datetime.mins, datetime.secs); + msglog("Logging started: %04d/%02d/%02d, %02d:%02d:%02d\n", datetime.year, datetime.mon, datetime.day, datetime.hour, datetime.mins, datetime.secs); } int msglog(const char * fmt, ...) Index: trunk/i386/libsaio/hfs.c =================================================================== --- trunk/i386/libsaio/hfs.c (revision 2632) +++ trunk/i386/libsaio/hfs.c (revision 2633) @@ -568,7 +568,7 @@ if (offset > fileLength) { - printf("ReadFile(HFS%c): Offset is too large.\n", gIsHFSPlus ? "+" : ""); + printf("ReadFile(HFS%s): Offset is too large.\n", gIsHFSPlus ? "+" : ""); return -1; } @@ -727,7 +727,7 @@ if ((SWAP_BE32(hfsPlusFile->userInfo.fdType) == kHardLinkFileType) && (SWAP_BE32(hfsPlusFile->userInfo.fdCreator) == kHFSPlusCreator)) { - sprintf(gLinkTemp, "%s/%s%ld", HFSPLUSMETADATAFOLDER, HFS_INODE_PREFIX, SWAP_BE32(hfsPlusFile->bsdInfo.special.iNodeNum)); + sprintf(gLinkTemp, "%s/%s%d", HFSPLUSMETADATAFOLDER, HFS_INODE_PREFIX, SWAP_BE32(hfsPlusFile->bsdInfo.special.iNodeNum)); result = ResolvePathToCatalogEntry(gLinkTemp, flags, entry, kHFSRootFolderID, &tmpDirIndex); } } Index: trunk/i386/libsaio/acpi_patcher.c =================================================================== --- trunk/i386/libsaio/acpi_patcher.c (revision 2632) +++ trunk/i386/libsaio/acpi_patcher.c (revision 2633) @@ -104,7 +104,7 @@ // Try finding 'filename' in the usual places // Start searching any potential location for ACPI Table - snprintf(dirSpec, sizeof(dirSpec), "%s", filename); + strncpy(dirSpec, filename, sizeof(dirSpec) ); fd = open(dirSpec, 0); if (fd < 0) { @@ -390,11 +390,11 @@ /* Try using the file specified with the DSDT option */ if (getValueForKey(kDSDT, &filename, &len, &bootInfo->chameleonConfig)) { - snprintf(dirSpec, sizeof(dirSpec), filename); + strncpy(dirSpec, filename, sizeof(dirSpec) ); } else { - sprintf(dirSpec, "DSDT.aml"); + strcpy(dirSpec, "DSDT.aml"); //verbose("dirSpec, DSDT.aml"); } @@ -428,7 +428,14 @@ { char filename[512]; - sprintf(filename, i > 0 ? "SSDT-%d.aml" : "SSDT.aml", i); + if (i > 0) + { + sprintf(filename, "SSDT-%d.aml", i); + } + else + { + strcpy(filename, "SSDT.aml"); + } if ( (new_ssdt[ssdt_count] = loadACPITable(filename)) ) { @@ -513,7 +520,7 @@ if (tableSign(table, "DSDT")) { DBG("DSDT found\n"); - verbose("Custom DSDT table was found\n"); + DBG("Custom DSDT table was found\n"); if(new_dsdt) { rsdt_entries[i-dropoffset]=(uint32_t)new_dsdt; @@ -630,7 +637,7 @@ if (drop_ssdt && tableSign(table, "SSDT")) { - DBG("dropped (OEM)\n"); + DBG("OEM SSDT tables was dropped\n"); dropoffset++; continue; } Index: trunk/i386/libsaio/spd.c =================================================================== --- trunk/i386/libsaio/spd.c (revision 2632) +++ trunk/i386/libsaio/spd.c (revision 2633) @@ -246,7 +246,7 @@ } else { - sprintf(asciiSerial, "0000000000000000"); + strcpy(asciiSerial, "0000000000000000"); } return strdup(asciiSerial); Index: trunk/i386/libsaio/pci_root.c =================================================================== --- trunk/i386/libsaio/pci_root.c (revision 2632) +++ trunk/i386/libsaio/pci_root.c (revision 2633) @@ -94,11 +94,11 @@ // Try using the file specified with the DSDT option if (getValueForKey(kDSDT, &dsdt_filename, &len, &bootInfo->chameleonConfig)) { - snprintf(dsdt_dirSpec, sizeof(dsdt_dirSpec), dsdt_filename); + strncpy(dsdt_dirSpec, dsdt_filename, sizeof(dsdt_dirSpec) ); } else { - sprintf(dsdt_dirSpec, "DSDT.aml"); + strcpy(dsdt_dirSpec, "DSDT.aml"); } int fd = search_and_get_acpi_fd(dsdt_dirSpec, &dsdt_filename); Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 2632) +++ trunk/i386/libsaio/nvidia.c (revision 2633) @@ -2284,7 +2284,7 @@ } } - snprintf(biosVersion, sizeof(biosVersion), "%s", (nvBiosOveride > 0) ? nvFilename : version_str); + strncpy(biosVersion, (nvBiosOveride > 0) ? nvFilename : version_str, sizeof(biosVersion) ); snprintf(kNVCAP, sizeof(kNVCAP), "NVCAP_%04x", nvda_dev->device_id); if (getValueForKey(kNVCAP, &value, &len, &bootInfo->chameleonConfig) && len == NVCAP_LEN * 2) Index: trunk/i386/libsaio/ati.c =================================================================== --- trunk/i386/libsaio/ati.c (revision 2632) +++ trunk/i386/libsaio/ati.c (revision 2633) @@ -2162,7 +2162,7 @@ if (from_pci) { rom_addr = (option_rom_header_t *)(pci_config_read32(card->pci_dev->dev.addr, PCI_ROM_ADDRESS) & ~0x7ff); - verbose(" @0x%x\n", rom_addr); + verbose(" @0x%x\n", (unsigned) rom_addr); } else { @@ -2171,7 +2171,7 @@ if (!validate_rom(rom_addr, card->pci_dev)) { - verbose("There is no ROM @0x%x\n", rom_addr); + verbose("There is no ROM @0x%x\n", (unsigned) rom_addr); return false; } card->rom_size = rom_addr->rom_size * 512; @@ -2393,14 +2393,14 @@ return false; } verbose("Found ATI card! Device ID:[%04X:%04X] Subsystem ID:[%08X] - Radeon [%04X:%08X] %s\n", - pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id, card->info->device_id, card->info->subsys_id, card->info->model_name); + pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id, card->info->device_id, card->info->subsys_id, card->info->model_name); card->fb = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_0) & ~0x0f); card->mmio = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f); card->io = (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_4) & ~0x03); verbose("Framebuffer @0x%08X MMIO @0x%08X I/O Port @0x%08X ROM Addr @0x%08X\n", - card->fb, card->mmio, card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS)); + (unsigned) card->fb, (unsigned) card->mmio, (unsigned) card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS)); card->posted = radeon_card_posted(); verbose("ATI card %s, ", card->posted ? "POSTed" : "non-POSTed"); Index: trunk/i386/libsaio/cpu.c =================================================================== --- trunk/i386/libsaio/cpu.c (revision 2632) +++ trunk/i386/libsaio/cpu.c (revision 2633) @@ -261,6 +261,7 @@ uint8_t currcoef = 0; uint8_t maxdiv = 0; uint8_t maxcoef = 0; + uint8_t pic0_mask; const char *newratio; char str[128]; @@ -512,6 +513,9 @@ p->CPU.Features |= CPU_FEATURE_HTT; } + pic0_mask = inb(0x21U); + outb(0x21U, 0xFFU); // mask PIC0 interrupts for duration of timing tests + tscFrequency = measure_tsc_frequency(); DBG("cpu freq classic = 0x%016llx\n", tscFrequency); // if usual method failed @@ -806,6 +810,8 @@ #endif + outb(0x21U, pic0_mask); // restore PIC0 interrupts + p->CPU.MaxCoef = maxcoef; p->CPU.MaxDiv = maxdiv; p->CPU.CurrCoef = currcoef; Index: trunk/i386/libsaio/disk.c =================================================================== --- trunk/i386/libsaio/disk.c (revision 2632) +++ trunk/i386/libsaio/disk.c (revision 2633) @@ -742,7 +742,7 @@ //============================================================================== -BVRef newAPMBVRef( int biosdev, int partno, unsigned int blkoff, +static BVRef newAPMBVRef( int biosdev, int partno, unsigned int blkoff, const DPME * part, FSInit initFunc, FSLoadFile loadFunc, FSReadFile readFunc, @@ -1537,7 +1537,7 @@ { char stringuuid[100]; efi_guid_unparse_upper((EFI_GUID*)gptMap->ent_type, stringuuid); - verbose("Reading GPT partition %d, type %s\n", gptID, stringuuid); + verbose("Reading GPT partition %d, type %s\n", (unsigned) gptID, stringuuid); // Getting fdisk like partition type. fsType = probeFileSystem(biosdev, gptMap->ent_lba_start); @@ -2360,7 +2360,7 @@ } // Set the devices label - snprintf(bvr->label, sizeof(bvr->label), p); + strncpy(bvr->label, p, sizeof(bvr->label) ); } Index: trunk/i386/libsaio/biosfn.c =================================================================== --- trunk/i386/libsaio/biosfn.c (revision 2632) +++ trunk/i386/libsaio/biosfn.c (revision 2633) @@ -1018,16 +1018,15 @@ void sleep(int n) { - // FIXME: doesn't handle midnight wraparound - unsigned int endtime = (time18() + 18*n); -#ifdef __i386__ - while (time18() < endtime) + while (n >= 2048) { - __asm__ volatile ("rep; nop"); + delay(2048000000); + n -= 2048; } -#else - while (time18() < endtime); -#endif + if (n > 0) + { + delay(n * 1000000); + } } Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 2632) +++ trunk/i386/libsaio/fake_efi.c (revision 2633) @@ -477,7 +477,7 @@ } *len = strlen(src); - dst = (EFI_CHAR16*) malloc( ((*len)+1) * 2 ); + dst = (EFI_CHAR16 *) malloc( ((*len)+1) * 2 ); for (; i < (*len); i++) { dst[i] = src[i]; @@ -723,6 +723,7 @@ length = strlen(bootInfo->bootFile); DT__AddProperty(chosenNode, "boot-file", length + 1, bootInfo->bootFile); + // DT__AddProperty(chosenNode, "boot-device-path", bootDPsize, gBootDP); // DT__AddProperty(chosenNode, "boot-file-path", bootFPsize, gBootFP); @@ -738,13 +739,9 @@ // UInt8 index = 0; EFI_UINT16 PMTimerValue = 0; - EFI_UINT32 randomValue, tempValue, cpuTick; - EFI_UINT32 ecx, esi, edi = 0; - EFI_UINT32 rcx, rdx, rsi, rdi; + EFI_UINT32 randomValue = 0, cpuTick = 0; + EFI_UINT32 ecx = 0, edx = 0, esi = 0, edi = 0; - randomValue = tempValue = ecx = esi = edi = 0; // xor %ecx, %ecx - cpuTick = rcx = rdx = rsi = rdi = 0; - // LEAF_1 - Feature Information (Function 01h). if (Platform.CPU.CPUID[CPUID_1][2] & 0x40000000) // Checking ecx:bit-30 { @@ -753,12 +750,12 @@ // EFI_UINT32 seedBuffer[16] = {0}; // - // Main loop to get 16 qwords (four bytes each). + // Main loop to get 16 dwords (four bytes each). // for (index = 0; index < 16; index++) // 0x17e12: { randomValue = computeRand(); // callq 0x18e20 - cpuTick = getCPUTick(); // callq 0x121a7 + cpuTick = (EFI_UINT32) getCPUTick(); // callq 0x121a7 randomValue = (randomValue ^ cpuTick); // xor %rdi, %rax seedBuffer[index] = randomValue; // mov %rax,(%r15,%rsi,8) } // jb 0x17e12 @@ -776,6 +773,11 @@ // do // 0x17e55: { + // + // FIXME: PM Timer is usually @ 0x408, but its position is relocatable + // via PCI-to-ISA bridge. The location is reported in ACPI FADT, + // PM Timer Block address - zenith432 + // PMTimerValue = inw(0x408); // in (%dx), %ax esi = PMTimerValue; // movzwl %ax, %esi @@ -784,18 +786,18 @@ continue; // jb 0x17e55 (retry) } - cpuTick = getCPUTick(); // callq 0x121a7 -// printf("value: 0x%llx\n", getCPUTick()); - rcx = (cpuTick >> 8); // mov %rax, %rcx + cpuTick = (EFI_UINT32) getCPUTick(); // callq 0x121a7 +// printf("value: 0x%x\n", getCPUTick()); + ecx = (cpuTick >> 8); // mov %rax, %rcx // shr $0x8, %rcx - rdx = (cpuTick >> 10); // mov %rax, %rdx + edx = (cpuTick >> 0x10); // mov %rax, %rdx // shr $0x10, %rdx - rdi = rsi; // mov %rsi, %rdi - rdi = (rdi ^ cpuTick); // xor %rax, %rdi - rdi = (rdi ^ rcx); // xor %rcx, %rdi - rdi = (rdi ^ rdx); // xor %rdx, %rdi + edi = esi; // mov %rsi, %rdi + edi = (edi ^ cpuTick); // xor %rax, %rdi + edi = (edi ^ ecx); // xor %rcx, %rdi + edi = (edi ^ edx); // xor %rdx, %rdi - seedBuffer[index] = (rdi & 0xff); // mov %dil, (%r15,%r12,1) + seedBuffer[index] = (edi & 0xff); // mov %dil, (%r15,%r12,1) edi = (edi & 0x2f); // and $0x2f, %edi edi = (edi + esi); // add %esi, %edi @@ -825,7 +827,7 @@ if (getValueForKey(kSMBIOSKey, &override_pathname, &len, &bootInfo->chameleonConfig) && len > 0) { // Specify a path to a file, e.g. SMBIOS=/Extra/macProXY.plist - sprintf(dirSpecSMBIOS, override_pathname); + strcpy(dirSpecSMBIOS, override_pathname); err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig); } else Index: trunk/i386/libsaio/saio_internal.h =================================================================== --- trunk/i386/libsaio/saio_internal.h (revision 2632) +++ trunk/i386/libsaio/saio_internal.h (revision 2633) @@ -33,7 +33,7 @@ extern void halt(void) __attribute__((noreturn)); extern void startprog(unsigned int address, void *arg) __attribute__((noreturn)); extern void loader(UInt32 code, UInt32 cmdptr); -extern uint64_t computeRand(void); +extern uint32_t computeRand(void); /* bios.s */ extern void bios(biosBuf_t *bb); @@ -95,8 +95,8 @@ extern int getchar(void); extern int printf(const char *format, ...); extern int error(const char *format, ...); -extern int verbose(const char *format, ...); -extern void stop(const char *format, ...) __attribute__ ((noreturn)); +extern int verbose(const char *format, ...) __attribute__((format(printf,1,2))); +extern void stop(const char *format, ...) __attribute__ ((noreturn, format(printf,1,2))); //Azi: replace getc/getchar with ? console.c extern void pause(); extern uint64_t getRTCdatetime(); Index: trunk/i386/boot2/drivers.c =================================================================== --- trunk/i386/boot2/drivers.c (revision 2632) +++ trunk/i386/boot2/drivers.c (revision 2633) @@ -212,7 +212,7 @@ || (gRAMDiskVolume && gRAMDiskBTAliased) ) { // Next try a specfic OS version folder ie 10.5 - sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion); + sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion[0]); if (FileLoadDrivers(dirSpecExtra, 0) != 0) { // Next we'll try the base strlcpy(dirSpecExtra, "bt(0,0)/Extra/", sizeof(dirSpecExtra)); @@ -355,7 +355,7 @@ // Make sure this is a kext. length = strlen(name); - if (strncmp(name + length - 5, ".kext", 5)) + if (strncmp(name + length - 5, ".kext", sizeof(".kext") )) { continue; } @@ -525,7 +525,7 @@ } else { - snprintf(gFileSpec, 4096, "%s", dirSpec); + strncpy(gFileSpec, dirSpec, 4096); } bundlePathLength = strlen(gFileSpec) + 1; @@ -715,7 +715,7 @@ driver->bundlePathLength = module->bundlePathLength; // Save the plist, module and bundle. - strlcpy(driver->plistAddr, module->plistAddr,driver->plistLength); + strlcpy(driver->plistAddr, module->plistAddr, driver->plistLength); if (length != 0) { memcpy(driver->executableAddr, executableAddr, length); Index: trunk/i386/boot2/boot.c =================================================================== --- trunk/i386/boot2/boot.c (revision 2632) +++ trunk/i386/boot2/boot.c (revision 2633) @@ -345,7 +345,7 @@ if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { - snprintf(kernelCachePath, sizeof(kernelCachePath), "/com.apple.recovery.boot/kernelcache", kernelCacheFile); + strncpy(kernelCachePath, "/com.apple.recovery.boot/kernelcache", sizeof(kernelCachePath) ); ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); if ((flags & kFileTypeMask) != kFileTypeFlat) Index: trunk/i386/boot2/gui.h =================================================================== --- trunk/i386/boot2/gui.h (revision 2632) +++ trunk/i386/boot2/gui.h (revision 2633) @@ -143,8 +143,8 @@ void showInfoBox(char *title, char *text); -int dprintf( window_t * window, const char * fmt, ...); -int gprintf( window_t * window, const char * fmt, ...); +int dprintf( window_t * window, const char * fmt, ...) __attribute__((format(printf,2,3))); +int gprintf( window_t * window, const char * fmt, ...) __attribute__((format(printf,2,3))); int vprf(const char * fmt, va_list ap); int drawInfoMenu(); Index: trunk/i386/boot2/ramdisk.c =================================================================== --- trunk/i386/boot2/ramdisk.c (revision 2632) +++ trunk/i386/boot2/ramdisk.c (revision 2633) @@ -29,7 +29,7 @@ &bootInfo->chameleonConfig)) { // Use user specified md0 file - snprintf(filename, sizeof(filename), "%s", override_filename); + strncpy(filename, override_filename, sizeof(filename) ); fh = open(filename, 0); if(fh < 0) @@ -47,12 +47,12 @@ if(fh < 0) { - sprintf(filename, "rd(0,0)/Extra/Postboot.img"); + strcpy(filename, "rd(0,0)/Extra/Postboot.img"); fh = open(filename, 0); if(fh < 0) { - sprintf(filename, "/Extra/Postboot.img"); // Check /Extra if not in rd(0,0) + strcpy(filename, "/Extra/Postboot.img"); // Check /Extra if not in rd(0,0) fh = open(filename, 0); } } Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 2632) +++ trunk/i386/boot2/options.c (revision 2633) @@ -752,12 +752,12 @@ (i < bootInfo->memoryMapCount) && (bufflen < 1024); /* prevent buffer overflow */ i++) { bufflen += snprintf(buff+bufflen, 1024-bufflen, "Base 0x%08x%08x, ", - (unsigned long)(mp->base >> 32), - (unsigned long)(mp->base)); + (unsigned)(mp->base >> 32), + (unsigned)(mp->base)); bufflen += snprintf(buff+bufflen, 1024-bufflen, "length 0x%08x%08x, type %d\n", - (unsigned long)(mp->length >> 32), - (unsigned long)(mp->length), - mp->type); + (unsigned)(mp->length >> 32), + (unsigned)(mp->length), + (int) mp->type); mp++; } return buff; Index: trunk/i386/config/symbol.c =================================================================== --- trunk/i386/config/symbol.c (revision 2632) +++ trunk/i386/config/symbol.c (revision 2633) @@ -180,9 +180,13 @@ return; } if (sym->type == S_INT) + { sprintf(str, "%d", val2); + } else + { sprintf(str, "0x%x", val2); + } sym->curr.val = strdup(str); } Index: trunk/i386/modules/Resolution/915resolution.c =================================================================== --- trunk/i386/modules/Resolution/915resolution.c (revision 2632) +++ trunk/i386/modules/Resolution/915resolution.c (revision 2633) @@ -296,13 +296,13 @@ if (map->chipset == CT_UNKNOWN) { - verbose(" Unknown chipset type: %08x.\n", map->chipset_id); + verbose(" Unknown chipset type: %08x.\n", (unsigned) map->chipset_id); //verbose("915resolution only works with Intel 800/900 series graphic chipsets.\n"); //verbose("Chipset Id: %x\n", map->chipset_id); close_vbios(map); return 0; } else { - verbose(" Detected chipset/proc id (DRAM controller): %08x\n", map->chipset_id); + verbose(" Detected chipset/proc id (DRAM controller): %08x\n", (unsigned) map->chipset_id); } @@ -922,7 +922,7 @@ /*if (mode.pixel_clock && (mode.h_active == x) && (mode.v_active == y) && !force) {*/ if (!getMode(&mode)) { - verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode %d patched!\n", mode.h_active, mode.v_active, i); + verbose("\n Edid detailed timing descriptor found: %dx%d\n vbios mode %d patched!\n", mode.h_active, mode.v_active, (int) i); mode_timing[i].usH_Total = mode.h_active + mode.h_blanking; mode_timing[i].usH_Active = mode.h_active; mode_timing[i].usH_SyncStart = mode.h_active + mode.h_sync_offset; Index: trunk/i386/modules/AcpiCodec/acpi_codec.c =================================================================== --- trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2632) +++ trunk/i386/modules/AcpiCodec/acpi_codec.c (revision 2633) @@ -635,7 +635,7 @@ if (GetChecksum(header, header->Length) == 0) { DBG("Found valid AML file : %s ", filename); - verbose("[ %s ] read and stored at: %x", acpi_file, tableAddr); + verbose("[ %s ] read and stored at: 0x%x", acpi_file, (unsigned) tableAddr); printf("\n"); return tableAddr; } @@ -4167,7 +4167,7 @@ memcpy(fadt_mod, fadt, fadt->Header.Length); fadt_mod->Header.Length = 0x74; fadt_mod->Header.Revision = 0x01; - verbose("Warning: ACPI FADT length was < 0x74 which is the minimum for the ACPI FADT V1 specification, \n", fadt->Header.Revision ); + verbose("Warning: ACPI FADT length was < 0x74 which is the minimum for the ACPI FADT V1 specification, \n" /*, fadt->Header.Revision */ ); verbose(" trying to convert it to Version 1. \n"); } @@ -4760,7 +4760,7 @@ ret = GetFileInfo("rd(0,0)/Extra/", "Acpi", &flags, &time); if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) { - sprintf(dirspec, "rd(0,0)/Extra/Acpi/"); + strcpy(dirspec, "rd(0,0)/Extra/Acpi/"); acpidir_found = true; } @@ -4770,7 +4770,7 @@ ret = GetFileInfo("/Extra/", "Acpi", &flags, &time); if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) { - sprintf(dirspec, "/Extra/Acpi/"); + strcpy(dirspec, "/Extra/Acpi/"); acpidir_found = true; } @@ -4779,7 +4779,7 @@ ret = GetFileInfo("bt(0,0)/Extra/", "Acpi", &flags, &time); if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)) { - sprintf(dirspec, "bt(0,0)/Extra/Acpi/"); + strcpy(dirspec, "bt(0,0)/Extra/Acpi/"); acpidir_found = true; } Index: trunk/i386/libsa/libsa.h =================================================================== --- trunk/i386/libsa/libsa.h (revision 2632) +++ trunk/i386/libsa/libsa.h (revision 2633) @@ -137,8 +137,8 @@ /* * printf.c */ -extern int sprintf(char *s, const char *format, ...); -extern int snprintf(char *s, size_t size, const char *format, ...); +extern int sprintf(char *s, const char *format, ...) __attribute__((format(printf,2,3))); +extern int snprintf(char *s, size_t size, const char *format, ...) __attribute__((format(printf,3,4))); extern int slvprintf(char *buffer, int len, const char *fmt, va_list arg); /* Index: trunk/i386/util/dyldsymboltool.c =================================================================== --- trunk/i386/util/dyldsymboltool.c (revision 2632) +++ trunk/i386/util/dyldsymboltool.c (revision 2633) @@ -144,7 +144,7 @@ //dylib.dylib_info.cmdsize += offset; //dylib.header.sizeofcmds += offset; - sprintf(dylib.module_name, "%s", DYLIB_NAME); + strcpy(dylib.module_name, DYLIB_NAME); /* Load Commands - Symtable */ dylib.symtab.cmd = LC_SYMTAB; Index: trunk/CHANGES =================================================================== --- trunk/CHANGES (revision 2632) +++ trunk/CHANGES (revision 2633) @@ -1,3 +1,7 @@ +- Zenith432 : Protect timing code in scan_cpu() from interrupts, use bios for sleep() +- Zenith432 : Fix setupChosenNode, Tweak asm.s +- Zenith432 : Change identity snprintf to strncpy + misc printf issues +- cparm : Implement strlcat() - Zenith432 : Sanitize 16-bit assembly - Zenith432 : Fix bug in malloc_init, use bios for enableA20() - meklort : Slightly improve decive selection name - add os version.