Index: branches/ErmaC/Enoch/i386/libsaio/bootstruct.h =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/bootstruct.h (revision 2757) +++ branches/ErmaC/Enoch/i386/libsaio/bootstruct.h (revision 2758) @@ -33,9 +33,9 @@ /* * Kernel boot args global also used by booter for its own data. */ -extern boot_args *bootArgs; -extern boot_args_legacy *bootArgsLegacy; -extern Node *gMemoryMapNode; +extern boot_args *bootArgs; +extern boot_args_legacy *bootArgsLegacy; +extern Node *gMemoryMapNode; #define VGA_TEXT_MODE 0 //defined in /usr/../boot.h Index: branches/ErmaC/Enoch/i386/libsaio/device_inject.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/device_inject.c (revision 2757) +++ branches/ErmaC/Enoch/i386/libsaio/device_inject.c (revision 2758) @@ -58,7 +58,7 @@ */ if (!getValueForKey(kDeviceProperties, &val, &cnt, &bootInfo->chameleonConfig) && string) { - val = (const char*)string; + val = (const char *)string; cnt = strlength * 2; } @@ -231,7 +231,7 @@ memset(data, 0, length); uint32_t off = 0; - data[off+1] = ((strlen(nm) * 2) + 6) >> 8; + data[off+1] = (uint8_t)(((strlen(nm) * 2) + 6) >> 8); data[off] = ((strlen(nm) * 2) + 6) & 0x00FF; off += 4; @@ -291,8 +291,8 @@ // devprop_generate_string optimized by cparm char *devprop_generate_string(DevPropString *string) { - int len = string->length * 2 + 1; - char *buffer = (char*)malloc(len); + int len = ((string->length * 2) + 1); + char *buffer = (char *)malloc(len); char *ptr = buffer; if(!buffer) Index: branches/ErmaC/Enoch/i386/libsaio/platform.h =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/platform.h (revision 2757) +++ branches/ErmaC/Enoch/i386/libsaio/platform.h (revision 2758) @@ -424,6 +424,7 @@ int MemoryModules; // number of memory modules installed int DIMM[MAX_RAM_SLOTS]; // Information and SPD mapping for each slot } DMI; + struct RAM { uint64_t Frequency; // Ram Frequency Index: branches/ErmaC/Enoch/i386/libsaio/disk.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/disk.c (revision 2757) +++ branches/ErmaC/Enoch/i386/libsaio/disk.c (revision 2758) @@ -103,12 +103,12 @@ //========================================================================== // Maps (E)BIOS return codes to message strings. - struct NamedValue { unsigned char value; const char *name; }; +// ========================================================================= /* * Map a disk drive to bootable volumes contained within. */ @@ -141,6 +141,7 @@ static bool getOSVersion(BVRef bvr, char *str); static bool cache_valid = false; +// ============================================================================= static const struct NamedValue bios_errors[] = { { 0x10, "Media error" }, @@ -152,6 +153,7 @@ { 0x00, NULL } }; +// ============================================================================= static const struct NamedValue fdiskTypes[] = { { FDISK_DOS12, "DOS_FAT_12" }, // 0x01 @@ -180,11 +182,9 @@ }; //============================================================================== - extern void spinActivityIndicator(int sectors); -//========================================================================== - +//============================================================================== static int getDriveInfo( int biosdev, struct driveInfo *dip ) { static struct driveInfo cached_di; @@ -231,8 +231,7 @@ return 0; } -//========================================================================== - +//============================================================================== static const char *getNameForValue( const struct NamedValue *nameTable, unsigned char value ) { const struct NamedValue *np; @@ -249,8 +248,7 @@ } //============================================================================== - -static const char * bios_error(int errnum) +static const char *bios_error(int errnum) { static char errorstr[] = "Error 0x00"; const char * errname; @@ -393,15 +391,13 @@ } //============================================================================== - int testBiosread(int biosdev, unsigned long long secno) { return Biosread(biosdev, secno); } //============================================================================== - -static int readBytes(int biosdev, unsigned long long blkno, unsigned int byteoff, unsigned int byteCount, void * buffer) +static int readBytes(int biosdev, unsigned long long blkno, unsigned int byteoff, unsigned int byteCount, void *buffer) { // ramdisks require completely different code for reading. if(p_ramdiskReadBytes != NULL && biosdev >= 0x100) @@ -438,7 +434,6 @@ } //============================================================================== - static int isExtendedFDiskPartition( const struct fdisk_part *part ) { static unsigned char extParts[] = @@ -461,7 +456,6 @@ } //============================================================================== - static int getNextFDiskPartition( int biosdev, int *partno, const struct fdisk_part **outPart ) { static int sBiosdev = -1; @@ -552,7 +546,6 @@ } //============================================================================== - /* * Trying to figure out the filsystem type of a given partition. * X = fdisk partition type @@ -646,7 +639,6 @@ } //============================================================================== - static BVRef newFDiskBVRef( int biosdev, int partno, unsigned int blkoff, @@ -743,7 +735,6 @@ } //============================================================================== - static BVRef newAPMBVRef( int biosdev, int partno, unsigned int blkoff, const DPME * part, FSInit initFunc, FSLoadFile loadFunc, @@ -943,7 +934,6 @@ * So, for example, if you have two primary partitions and * one extended partition they will be numbered 1, 2, 5. */ - static BVRef diskScanFDiskBootVolumes( int biosdev, int *countPtr ) { const struct fdisk_part *part; @@ -1252,8 +1242,7 @@ } //============================================================================== - -static BVRef diskScanAPMBootVolumes( int biosdev, int * countPtr ) +static BVRef diskScanAPMBootVolumes( int biosdev, int *countPtr ) { struct DiskBVMap *map; struct Block0 *block0_p; @@ -1376,7 +1365,6 @@ } //============================================================================== - static bool isPartitionUsed(gpt_ent * partition) { @@ -1386,8 +1374,7 @@ } //============================================================================== - -static BVRef diskScanGPTBootVolumes(int biosdev, int * countPtr) +static BVRef diskScanGPTBootVolumes(int biosdev, int *countPtr) { verbose("\tAttempting to scan GPT boot volumes [biosdev=%02Xh]:\n", biosdev); @@ -1708,10 +1695,9 @@ } //============================================================================== - static bool getOSVersion(BVRef bvr, char *str) { - bool valid = false; + bool valid = false; config_file_t systemVersion; char dirSpec[512]; @@ -1835,7 +1821,6 @@ } //============================================================================== - static void scanFSLevelBVRSettings(BVRef chain) { BVRef bvr; @@ -1901,7 +1886,6 @@ } //============================================================================== - void rescanBIOSDevice(int biosdev) { struct DiskBVMap *oldMap = diskResetBootVolumes(biosdev); @@ -1917,7 +1901,6 @@ } //============================================================================== - struct DiskBVMap* diskResetBootVolumes(int biosdev) { struct DiskBVMap * map; @@ -1951,7 +1934,6 @@ } //============================================================================== - // Frees a DiskBVMap and all of its BootVolume's void diskFreeMap(struct DiskBVMap *map) { @@ -1969,8 +1951,7 @@ } //============================================================================== - -BVRef diskScanBootVolumes(int biosdev, int * countPtr) +BVRef diskScanBootVolumes(int biosdev, int *countPtr) { struct DiskBVMap *map; BVRef bvr; @@ -2019,7 +2000,6 @@ } //============================================================================== - BVRef getBVChainForBIOSDev(int biosdev) { BVRef chain = NULL; @@ -2038,7 +2018,6 @@ } //============================================================================== - BVRef newFilteredBVChain(int minBIOSDev, int maxBIOSDev, unsigned int allowFlags, unsigned int denyFlags, int *count) { BVRef chain = NULL; @@ -2164,7 +2143,6 @@ } //============================================================================== - int freeFilteredBVChain(const BVRef chain) { int ret = 1; @@ -2197,8 +2175,7 @@ } //============================================================================== - -bool matchVolumeToString( BVRef bvr, const char* match, long matchLen) +bool matchVolumeToString( BVRef bvr, const char *match, long matchLen) { char testStr[128]; @@ -2242,13 +2219,12 @@ } //============================================================================== - /* If Rename Partition has defined an alias, then extract it for description purpose. * The format for the rename string is the following: * hd(x,y)|uuid|"label" "alias";hd(m,n)|uuid|"label" "alias"; etc... */ -static bool getVolumeLabelAlias(BVRef bvr, char* str, long strMaxLen) +static bool getVolumeLabelAlias(BVRef bvr, char *str, long strMaxLen) { char *aliasList, *entryStart, *entryNext; @@ -2302,7 +2278,6 @@ } //============================================================================== - void getBootVolumeDescription( BVRef bvr, char *str, long strMaxLen, bool useDeviceDescription ) { unsigned char type; @@ -2375,9 +2350,7 @@ strncpy(bvr->label, p, sizeof(bvr->label) ); } - //============================================================================== - int readBootSector(int biosdev, unsigned int secno, void *buffer) { int error; @@ -2408,11 +2381,9 @@ } //============================================================================== - /* * Format of boot1f32 block. */ - #define BOOT1F32_MAGIC "BOOT " #define BOOT1F32_MAGICLEN 11 @@ -2453,27 +2424,22 @@ return 0; } - //============================================================================== // Handle seek request from filesystem modules. - void diskSeek(BVRef bvr, long long position) { bvr->fs_boff = position / BPS; bvr->fs_byteoff = position % BPS; } - //============================================================================== // Handle read request from filesystem modules. - int diskRead(BVRef bvr, long addr, long length) { return readBytes(bvr->biosdev, bvr->fs_boff + bvr->part_boff, bvr->fs_byteoff, length, (void *) addr); } //============================================================================== - int rawDiskRead( BVRef bvr, unsigned int secno, void *buffer, unsigned int len ) { int secs; @@ -2521,7 +2487,6 @@ } //============================================================================== - int rawDiskWrite( BVRef bvr, unsigned int secno, void *buffer, unsigned int len ) { int secs; @@ -2566,7 +2531,6 @@ } //============================================================================== - int diskIsCDROM(BVRef bvr) { struct driveInfo di; @@ -2579,7 +2543,6 @@ } //============================================================================== - int biosDevIsCDROM(int biosdev) { struct driveInfo di; Index: branches/ErmaC/Enoch/i386/libsaio/stringTable.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/stringTable.c (revision 2757) +++ branches/ErmaC/Enoch/i386/libsaio/stringTable.c (revision 2758) @@ -41,8 +41,7 @@ /* * Compare a string to a key with quoted characters */ -static inline int -keyncmp(const char *str, const char *key, int n) +static inline int keyncmp(const char *str, const char *key, int n) { int c; while (n--) { @@ -90,9 +89,7 @@ } /* Remove key and its associated value from the table. */ - -bool -removeKeyFromTable(const char *key, char *table) +bool removeKeyFromTable(const char *key, char *table) { register int len; register char *tab; @@ -266,8 +263,7 @@ #endif -char * -newStringForKey(char *key, config_file_t *config) +char *newStringForKey(char *key, config_file_t *config) { const char *val; char *newstr; @@ -291,7 +287,6 @@ * both