blob: 4504a618a548a5c109bd7aae2d7b7d5431959565 [file] [log] [blame]
Louis Yung-Chieh Loe1a25ab2010-04-20 10:52:41 -07001/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6#include "cgpt.h"
7
8/* stub code */
9static int start[] = { 34, 10034 };
10
11int GPTInit(GPTData_t *gpt) {
Louis Yung-Chieh Lo4bbf21e2010-04-21 17:29:05 -070012 gpt->current_kernel = 1;
13 return 0;
Louis Yung-Chieh Loe1a25ab2010-04-20 10:52:41 -070014}
15
16int GPTNextKernelEntry(GPTData_t *gpt, uint64_t *start_sector, uint64_t *size) {
Louis Yung-Chieh Lo4bbf21e2010-04-21 17:29:05 -070017 gpt->current_kernel ^= 1;
18 if (start_sector) *start_sector = start[gpt->current_kernel];
19 if (size) *size = 10000;
20 return 0;
Louis Yung-Chieh Loe1a25ab2010-04-20 10:52:41 -070021}
22
23int GPTUpdateKernelEntry(GPTData_t *gpt, uint32_t update_type) {
Louis Yung-Chieh Lo4bbf21e2010-04-21 17:29:05 -070024 gpt->modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_ENTRIES1) <<
25 gpt->current_kernel;
26 return 0;
Louis Yung-Chieh Loe1a25ab2010-04-20 10:52:41 -070027}