Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Side by Side Diff: src/platform/vboot_reference/cgptlib/cgpt.c

Issue 1761004: A simple test infrastructure -- idea stolen from Gaurav. (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* 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 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #include "cgpt.h" 6 #include "cgpt.h"
7 7
8 /* stub code */ 8 /* stub code */
9 static int start[] = { 34, 10034 }; 9 static int start[] = { 34, 10034 };
10 10
11 int GPTInit(GPTData_t *gpt) { 11 int GPTInit(GPTData_t *gpt) {
12 gpt->current_kernel = 1; 12 gpt->current_kernel = 1;
13 return 0; 13 return 0;
14 } 14 }
15 15
16 int GPTNextKernelEntry(GPTData_t *gpt, uint64_t *start_sector, uint64_t *size) { 16 int GPTNextKernelEntry(GPTData_t *gpt, uint64_t *start_sector, uint64_t *size) {
17 gpt->current_kernel ^= 1; 17 gpt->current_kernel ^= 1;
18 if (start_sector) *start_sector = start[gpt->current_kernel]; 18 if (start_sector) *start_sector = start[gpt->current_kernel];
19 if (size) *size = 10000; 19 if (size) *size = 10000;
20 return 0; 20 return 0;
21 } 21 }
22 22
23 int GPTUpdateKernelEntry(GPTData_t *gpt, uint32_t update_type) { 23 int GPTUpdateKernelEntry(GPTData_t *gpt, uint32_t update_type) {
24 gpt->modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_ENTRIES1) << 24 gpt->modified |= (GPT_MODIFIED_HEADER1 | GPT_MODIFIED_ENTRIES1) <<
25 gpt->current_kernel; 25 gpt->current_kernel;
26 return 0; 26 return 0;
27 } 27 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/cgptlib/cgpt.h ('k') | src/platform/vboot_reference/cgptlib/tests/cgpt_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698