/* $Id$ */
/** @file
* Apple.c
*/
/*
* Copyright (C) 2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#include "Partition.h"
#pragma pack(1)
typedef struct APPLE_PT_HEADER {
typedef struct APPLE_PT_ENTRY {
/* Some more data we don't really need */
#pragma pack()
static UINT16
{
return SwapBytes16(x);
}
static UINT32
{
return SwapBytes32(x);
}
/**
Install child handles if the Handle supports Apple partition table format.
@param[in] This Calling context.
@param[in] Handle Parent Handle
@param[in] DiskIo Parent DiskIo interface
@param[in] BlockIo Parent BlockIo interface
@param[in] DevicePath Parent Device Path
@retval EFI_SUCCESS Child handle(s) was added
@retval EFI_MEDIA_CHANGED Media changed Detected
@retval other no child handle was added
**/
)
{
//UINTN MaxIndex;
/** @todo: wrong, as this PT can be on both HDD or CD */
//EFI_DEVICE_PATH_PROTOCOL Dev;
VolSpaceSize = 0;
return EFI_NOT_FOUND;
}
do {
/* read PT header first */
Lba = 0;
);
{
break;
}
{
break;
}
/* Fail if media block size isn't an exact multiple */
{
break;
}
/* Now iterate over PT entries and install child handles */
PartitionEntries = 1;
{
);
goto done; /* would break, but ... */
}
{
continue;
}
/* First partition contains partitions count */
if (Partition == 1)
{
}
Print(L"HFS partition (%d of %d) at LBA 0x%x size=%dM\n",
/* Convert from partition to media blocks */
This,
FALSE);
Found = EFI_SUCCESS;
}
}
} while (0);
done:
return Found;
}