BVFree bvFreeFunc,␊ |
int probe, int type, unsigned int bvrFlags )␊ |
{␊ |
BVRef bvr = (BVRef) MALLOC( sizeof(*bvr) );␊ |
BVRef bvr = (BVRef) malloc( sizeof(*bvr) );␊ |
if ( bvr )␊ |
{␊ |
bzero(bvr, sizeof(*bvr));␊ |
|
BVFree bvFreeFunc,␊ |
int probe, int type, unsigned int bvrFlags )␊ |
{␊ |
BVRef bvr = (BVRef) MALLOC( sizeof(*bvr) );␊ |
BVRef bvr = (BVRef) malloc( sizeof(*bvr) );␊ |
if ( bvr )␊ |
{␊ |
bzero(bvr, sizeof(*bvr));␊ |
|
BVFree bvFreeFunc,␊ |
int probe, int type, unsigned int bvrFlags )␊ |
{␊ |
BVRef bvr = (BVRef) MALLOC( sizeof(*bvr) );␊ |
BVRef bvr = (BVRef) malloc( sizeof(*bvr) );␊ |
if ( bvr )␊ |
{␊ |
bzero(bvr, sizeof(*bvr));␊ |
|
do {␊ |
// Create a new mapping.␊ |
␊ |
map = (struct DiskBVMap *) MALLOC( sizeof(*map) );␊ |
map = (struct DiskBVMap *) malloc( sizeof(*map) );␊ |
if ( map )␊ |
{␊ |
map->biosdev = biosdev;␊ |
|
struct Block0 *block0_p;␊ |
unsigned int blksize;␊ |
unsigned int factor;␊ |
void *buffer = MALLOC(BPS);␊ |
void *buffer = malloc(BPS);␊ |
␊ |
/* Check for alternate block size */␊ |
if (readBytes( biosdev, 0, 0, BPS, buffer ) != 0) {␊ |
|
blksize = OSSwapBigToHostInt16(block0_p->sbBlkSize);␊ |
if (blksize != BPS) {␊ |
free(buffer);␊ |
buffer = MALLOC(blksize);␊ |
buffer = malloc(blksize);␊ |
}␊ |
factor = blksize / BPS;␊ |
} else {␊ |
|
do {␊ |
// Create a new mapping.␊ |
␊ |
map = (struct DiskBVMap *) MALLOC( sizeof(*map) );␊ |
map = (struct DiskBVMap *) malloc( sizeof(*map) );␊ |
if ( map )␊ |
{␊ |
int error;␊ |
|
int fatbits;␊ |
␊ |
// Allocating buffer for 4 sectors.␊ |
const void * probeBuffer = MALLOC(PROBEFS_SIZE);␊ |
const void * probeBuffer = malloc(PROBEFS_SIZE);␊ |
if (probeBuffer == NULL)␊ |
goto exit;␊ |
␊ |
|
static BVRef diskScanGPTBootVolumes( int biosdev, int * countPtr )␊ |
{␊ |
struct DiskBVMap * map = NULL;␊ |
void *buffer = MALLOC(BPS);␊ |
void *buffer = malloc(BPS);␊ |
int error;␊ |
if ( error = readBytes( biosdev, /*secno*/0, 0, BPS, buffer ) != 0) {␊ |
verbose("Failed to read boot sector from BIOS device %02xh. Error=%d\n", biosdev, error);␊ |
|
UInt32 bufferSize = IORound(gptCount * gptSize, BPS);␊ |
if(bufferSize == 0)␊ |
goto scanErr;␊ |
buffer = MALLOC(bufferSize);␊ |
buffer = malloc(bufferSize);␊ |
␊ |
if(readBytes(biosdev, gptBlock, 0, bufferSize, buffer) != 0)␊ |
goto scanErr;␊ |
|
verbose("Read GPT\n");␊ |
␊ |
// Allocate a new map for this BIOS device and insert it into the chain␊ |
map = MALLOC(sizeof(*map));␊ |
map = malloc(sizeof(*map));␊ |
map->biosdev = biosdev;␊ |
map->bvr = NULL;␊ |
map->bvrcnt = 0;␊ |
|
/*␊ |
* Allocate and copy the matched bvr entry into a new one.␊ |
*/␊ |
newBVR = (BVRef) MALLOC(sizeof(*newBVR));␊ |
newBVR = (BVRef) malloc(sizeof(*newBVR));␊ |
bcopy(bvr, newBVR, sizeof(*newBVR));␊ |
␊ |
/*␊ |
|
{␊ |
if ( gBootSector == NULL )␊ |
{␊ |
gBootSector = (struct disk_blk0 *) MALLOC(sizeof(*gBootSector));␊ |
gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector));␊ |
if ( gBootSector == NULL ) return -1;␊ |
}␊ |
bootSector = gBootSector;␊ |
|
{␊ |
if ( gBootSector == NULL )␊ |
{␊ |
gBootSector = (struct disk_blk0 *) MALLOC(sizeof(*gBootSector));␊ |
gBootSector = (struct disk_blk0 *) malloc(sizeof(*gBootSector));␊ |
if ( gBootSector == NULL ) return -1;␊ |
}␊ |
bootSector = (struct disk_boot1f32_blk *) gBootSector;␊ |