Stephen Warren | 4b0e5d0 | 2012-11-28 11:44:50 -0700 | [diff] [blame] | 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/>. |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 15 | * |
| 16 | * See file CREDITS for list of people who contributed to this |
| 17 | * project. |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #include "cbootimage.h" |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 21 | #include "data_layout.h" |
| 22 | #include "context.h" |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 23 | #include "parse.h" |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 24 | #include "t20/nvboot_bct_t20.h" |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 25 | #include <string.h> |
| 26 | |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 27 | int enable_debug; |
| 28 | cbootimage_soc_config * g_soc_config; |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 29 | |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 30 | static void format_u32_hex8(char const * message, void * data); |
| 31 | static void format_u32(char const * message, void * data); |
| 32 | |
| 33 | typedef void (*format_function)(char const * message, void * data); |
| 34 | |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 35 | typedef struct { |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 36 | parse_token id; |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 37 | char const * message; |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 38 | format_function format; |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 39 | } value_data; |
| 40 | |
Stephen Warren | b258a01 | 2012-11-29 17:53:51 -0700 | [diff] [blame] | 41 | static value_data const values[] = { |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 42 | { token_boot_data_version, "Version = ", format_u32_hex8 }, |
Penny Chiu | 19eae54 | 2014-04-11 17:50:41 +0800 | [diff] [blame^] | 43 | { token_block_size, "BlockSize = ", format_u32_hex8 }, |
| 44 | { token_page_size, "PageSize = ", format_u32_hex8 }, |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 45 | { token_partition_size, "PartitionSize = ", format_u32_hex8 }, |
| 46 | { token_odm_data, "OdmData = ", format_u32_hex8 }, |
| 47 | { token_bootloader_used, "# Bootloader used = ", format_u32 }, |
| 48 | { token_bootloaders_max, "# Bootloaders max = ", format_u32 }, |
| 49 | { token_bct_size, "# BCT size = ", format_u32 }, |
| 50 | { token_hash_size, "# Hash size = ", format_u32 }, |
| 51 | { token_crypto_offset, "# Crypto offset = ", format_u32 }, |
| 52 | { token_crypto_length, "# Crypto length = ", format_u32 }, |
| 53 | { token_max_bct_search_blks, "# Max BCT search blocks = ", format_u32 }, |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 54 | }; |
| 55 | |
Stephen Warren | b258a01 | 2012-11-29 17:53:51 -0700 | [diff] [blame] | 56 | static value_data const bl_values[] = { |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 57 | { token_bl_version, "Version = ", format_u32_hex8 }, |
| 58 | { token_bl_start_blk, "Start block = ", format_u32 }, |
| 59 | { token_bl_start_page, "Start page = ", format_u32 }, |
| 60 | { token_bl_length, "Length = ", format_u32 }, |
| 61 | { token_bl_load_addr, "Load address = ", format_u32_hex8 }, |
| 62 | { token_bl_entry_point, "Entry point = ", format_u32_hex8 }, |
| 63 | { token_bl_attribute, "Attributes = ", format_u32_hex8 }, |
Vincent Palatin | 9947584 | 2011-03-07 16:09:25 -0500 | [diff] [blame] | 64 | }; |
| 65 | |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 66 | /*****************************************************************************/ |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 67 | static void format_u32_hex8(char const * message, void * data) |
| 68 | { |
| 69 | printf("%s0x%08x;\n", message, *((u_int32_t *) data)); |
| 70 | } |
| 71 | |
| 72 | static void format_u32(char const * message, void * data) |
| 73 | { |
| 74 | printf("%s%d;\n", message, *((u_int32_t *) data)); |
| 75 | } |
| 76 | |
| 77 | /*****************************************************************************/ |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 78 | static void usage(void) |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 79 | { |
| 80 | printf("Usage: bct_dump bctfile\n"); |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 81 | printf(" bctfile BCT filename to read and display\n"); |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 82 | } |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 83 | /*****************************************************************************/ |
| 84 | static int max_width(field_item const * table) |
| 85 | { |
| 86 | int width = 0; |
| 87 | int i; |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 88 | |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 89 | for (i = 0; table[i].name != NULL; ++i) { |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 90 | int length = strlen(table[i].name); |
| 91 | |
| 92 | if (width < length) |
| 93 | width = length; |
| 94 | } |
| 95 | |
| 96 | return width; |
| 97 | } |
| 98 | /*****************************************************************************/ |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 99 | static enum_item const * find_enum_item(build_image_context *context, |
| 100 | enum_item const * table, |
| 101 | u_int32_t value) |
| 102 | { |
| 103 | int i; |
| 104 | |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 105 | for (i = 0; table[i].name != NULL; ++i) { |
| 106 | if (table[i].value == value) |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 107 | return table + i; |
| 108 | } |
| 109 | |
| 110 | return NULL; |
| 111 | } |
| 112 | /*****************************************************************************/ |
| 113 | static void display_enum_value(build_image_context *context, |
| 114 | enum_item const * table, |
| 115 | u_int32_t value) |
| 116 | { |
| 117 | enum_item const * e_item = find_enum_item(context, table, value); |
| 118 | |
| 119 | if (e_item) |
| 120 | printf("%s", e_item->name); |
| 121 | else |
| 122 | printf("<UNKNOWN ENUM VALUE (%d)>", value); |
| 123 | } |
| 124 | /*****************************************************************************/ |
| 125 | static int display_field_value(build_image_context *context, |
| 126 | field_item const * item, |
| 127 | u_int32_t value) |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 128 | { |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 129 | switch (item->type) { |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 130 | case field_type_enum: |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 131 | display_enum_value(context, item->enum_table, value); |
| 132 | break; |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 133 | |
| 134 | case field_type_u32: |
| 135 | printf("0x%08x", value); |
| 136 | break; |
| 137 | |
| 138 | case field_type_u8: |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 139 | printf("%d", value); |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 140 | break; |
| 141 | |
| 142 | default: |
| 143 | printf("<UNKNOWN FIELD TYPE (%d)>", item->type); |
| 144 | return 1; |
| 145 | } |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | /*****************************************************************************/ |
| 150 | int main(int argc, char *argv[]) |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 151 | { |
| 152 | int e; |
| 153 | build_image_context context; |
| 154 | u_int32_t bootloaders_used; |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 155 | u_int32_t parameters_used; |
Vincent Palatin | 9947584 | 2011-03-07 16:09:25 -0500 | [diff] [blame] | 156 | u_int32_t sdram_used; |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 157 | nvboot_dev_type type; |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 158 | u_int32_t data; |
| 159 | int i; |
| 160 | int j; |
| 161 | |
| 162 | if (argc != 2) |
| 163 | usage(); |
| 164 | |
| 165 | memset(&context, 0, sizeof(build_image_context)); |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 166 | context.bct_filename = argv[1]; |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 167 | |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 168 | e = read_bct_file(&context); |
| 169 | if (e != 0) |
| 170 | return e; |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 171 | |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 172 | /* Display root values */ |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 173 | for (i = 0; i < sizeof(values) / sizeof(values[0]); ++i) { |
Penny Chiu | 0cb60ab | 2014-04-11 17:50:40 +0800 | [diff] [blame] | 174 | if (!g_soc_config->token_supported(values[i].id)) |
| 175 | continue; |
| 176 | |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 177 | e = g_soc_config->get_value(values[i].id, |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 178 | &data, |
| 179 | context.bct); |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 180 | |
| 181 | if (e != 0) |
| 182 | data = -1; |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 183 | |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 184 | values[i].format(values[i].message, &data); |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 185 | } |
| 186 | |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 187 | /* Display bootloader values */ |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 188 | e = g_soc_config->get_value(token_bootloader_used, |
Anton Staaf | 2b6c88c | 2011-03-02 09:22:25 -0800 | [diff] [blame] | 189 | &bootloaders_used, |
| 190 | context.bct); |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 191 | |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 192 | if ((e == 0) && (bootloaders_used > 0)) { |
| 193 | int bl_count = sizeof(bl_values) / sizeof(bl_values[0]); |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 194 | |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 195 | printf("#\n" |
| 196 | "# These values are set by cbootimage using the\n" |
| 197 | "# bootloader provided by the Bootloader=...\n" |
| 198 | "# configuration option.\n" |
| 199 | "#\n"); |
| 200 | |
| 201 | for (i = 0; i < bootloaders_used; ++i) { |
| 202 | for (j = 0; j < bl_count; ++j) { |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 203 | e = g_soc_config->getbl_param(i, |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 204 | bl_values[j].id, |
| 205 | &data, |
| 206 | context.bct); |
| 207 | printf("# Bootloader[%d].", i); |
| 208 | |
| 209 | if (e != 0) |
| 210 | data = -1; |
| 211 | |
Penny Chiu | 3d0bff5 | 2014-04-11 17:50:37 +0800 | [diff] [blame] | 212 | bl_values[j].format(bl_values[j].message, &data); |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 213 | } |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 214 | } |
| 215 | } |
| 216 | |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 217 | /* Display flash device parameters */ |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 218 | e = g_soc_config->get_value(token_num_param_sets, |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 219 | ¶meters_used, |
| 220 | context.bct); |
| 221 | |
| 222 | for (i = 0; (e == 0) && (i < parameters_used); ++i) { |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 223 | field_item const * device_field_table = NULL; |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 224 | char const * prefix = NULL; |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 225 | field_item const * item; |
| 226 | |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 227 | e = g_soc_config->get_dev_param(&context, |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 228 | i, |
| 229 | token_dev_type, |
| 230 | &type); |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 231 | printf("\n" |
| 232 | "DevType[%d] = ", i); |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 233 | display_enum_value(&context, g_soc_config->devtype_table, type); |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 234 | printf(";\n"); |
| 235 | |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 236 | switch (type) { |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 237 | case nvboot_dev_type_spi: |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 238 | device_field_table = g_soc_config->spiflash_table; |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 239 | prefix = "SpiFlashParams"; |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 240 | break; |
| 241 | |
| 242 | case nvboot_dev_type_sdmmc: |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 243 | device_field_table = g_soc_config->sdmmc_table; |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 244 | prefix = "SdmmcParams"; |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 245 | break; |
| 246 | |
| 247 | case nvboot_dev_type_nand: |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 248 | device_field_table = g_soc_config->nand_table; |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 249 | prefix = "NandParams"; |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 250 | break; |
| 251 | |
| 252 | default: |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 253 | device_field_table = NULL; |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 254 | prefix = ""; |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 255 | break; |
| 256 | } |
| 257 | |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 258 | if (!device_field_table) |
| 259 | continue; |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 260 | |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 261 | int width = max_width(device_field_table); |
| 262 | |
| 263 | for (item = device_field_table; item->name != NULL; ++item) { |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 264 | g_soc_config->get_dev_param(&context, |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 265 | i, |
| 266 | item->token, |
| 267 | &data); |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 268 | printf("DeviceParam[%d].%s.%-*s = ", |
| 269 | i, prefix, width, item->name); |
| 270 | |
| 271 | if (e != 0) |
| 272 | printf("<ERROR reading parameter (%d)>", e); |
| 273 | else |
| 274 | display_field_value(&context, item, data); |
| 275 | |
| 276 | printf(";\n"); |
Anton Staaf | 496f965 | 2011-03-02 09:23:27 -0800 | [diff] [blame] | 277 | } |
| 278 | } |
| 279 | |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 280 | /* Display SDRAM parameters */ |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 281 | e = g_soc_config->get_value(token_num_sdram_sets, |
Vincent Palatin | 9947584 | 2011-03-07 16:09:25 -0500 | [diff] [blame] | 282 | &sdram_used, |
| 283 | context.bct); |
| 284 | |
| 285 | for (i = 0; (e == 0) && (i < sdram_used); ++i) { |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 286 | field_item const *item; |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 287 | |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 288 | printf("\n"); |
| 289 | |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 290 | int width = max_width(g_soc_config->sdram_field_table); |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 291 | |
Penny Chiu | 5f4e2a3 | 2012-12-21 21:17:37 +0800 | [diff] [blame] | 292 | for (item = g_soc_config->sdram_field_table; item->name != NULL; ++item) { |
| 293 | e = g_soc_config->get_sdram_param(&context, |
Peer Chen | 6f2cbc7 | 2012-03-13 11:12:39 +0800 | [diff] [blame] | 294 | i, |
| 295 | item->token, |
| 296 | &data); |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 297 | printf("SDRAM[%d].%-*s = ", i, width, item->name); |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 298 | |
| 299 | if (e != 0) |
| 300 | printf("<ERROR reading parameter (%d)>", e); |
| 301 | else |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 302 | display_field_value(&context, item, data); |
Anton Staaf | e517a4f | 2011-03-14 12:28:06 -0700 | [diff] [blame] | 303 | |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 304 | printf(";\n"); |
Vincent Palatin | 9947584 | 2011-03-07 16:09:25 -0500 | [diff] [blame] | 305 | } |
| 306 | } |
| 307 | |
Anton Staaf | c624427 | 2011-02-24 10:17:50 -0800 | [diff] [blame] | 308 | /* Clean up memory. */ |
| 309 | cleanup_context(&context); |
| 310 | |
| 311 | return e; |
| 312 | } |
Anton Staaf | 20379c1 | 2011-03-14 15:38:59 -0700 | [diff] [blame] | 313 | /*****************************************************************************/ |