cgpt: Separate out certain GPT manipluation functions

For kernel NAND support, some vboot/cgptlib functionality is
needed from depthcharge. This patch moves certain function
declarations to a new header in firmware/include and puts
their definitions in a common place.

TEST=make runalltests passes and packages build
BRANCH=none
BUG=chromium:403432

Change-Id: Idd42b1f9f531651d78bb4afb80ca90c24aae93d9
Reviewed-on: https://chromium-review.googlesource.com/224996
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Daniel Ehrenberg <dehrenberg@chromium.org>
Tested-by: Daniel Ehrenberg <dehrenberg@chromium.org>
This commit is contained in:
Dan Ehrenberg
2014-10-21 16:15:54 -07:00
committed by chrome-internal-fetch
parent f18038b750
commit 7c2beb0838
7 changed files with 315 additions and 284 deletions

View File

@@ -10,24 +10,11 @@
#define VBOOT_REFERENCE_VBOOT_KERNEL_H_
#include "cgptlib.h"
#include "gpt_misc.h"
#include "load_firmware_fw.h"
#include "load_kernel_fw.h"
#include "vboot_api.h"
/**
* Allocate and read GPT data from the drive. The sector_bytes and
* drive_sectors fields should be filled on input. The primary and secondary
* header and entries are filled on output.
*
* Returns 0 if successful, 1 if error.
*/
int AllocAndReadGptData(VbExDiskHandle_t disk_handle, GptData *gptdata);
/**
* Write any changes for the GPT data back to the drive, then free the buffers.
*/
int WriteAndFreeGptData(VbExDiskHandle_t disk_handle, GptData *gptdata);
/**
* Accessors for unit tests only.
*/