Debian Codegraph @

util/nvidia/cbootimage/src/context.c

raw symbols SCIP
1 /*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * See file CREDITS for list of people who contributed to this
17 * project.
18 */
19
20 #include "cbootimage.h"
21 #include "data_layout.h"
22 #include "set.h"
23
24 void
25 cleanup_context(build_image_context *context)
26 {
27 destroy_block_list(context->memory);
28 free(context->bct);
29 }
30
31 int
32 init_context(build_image_context *context)
33 {
34 uint32_t value;
35
36 /* Set defaults */
37 context->memory = new_block_list();
38 context->next_bct_blk = 0; /* Default to block 0 */
39 value = 1;
40 context_set_value(context, token_redundancy, &value);
41 context_set_value(context, token_version, &value);
42 value = 2;
43 context_set_value(context, token_bct_copy, &value);
44
45 return 0;
46 }