debuggers.hg

view tools/firmware/rombios/32bit/32bitbios.c @ 13681:c07326324f8d

[HVM] Add TCG BIOS extensions to the high memory area along with
some often-used libc utility functions. The TCG extensions are
described here:

https://www.trustedcomputinggroup.org/specs/PCClient/TCG_PCClientImplementationforBIOS_1-20_1-00.pdf

I have tried to keep the patching with rombios.c to a minimum, but
some amount of code needs to be inserted at various locations.

The code is currently deactivated, but can be activated by setting
BX_TCGBIOS to '1'.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author kaf24@localhost.localdomain
date Fri Jan 26 16:38:32 2007 +0000 (2007-01-26)
parents 480436ef6255
children edbff1762a55
line source
1 /*
2 * 32bitbios - jumptable for those function reachable from 16bit area
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Copyright (C) IBM Corporation, 2006
19 *
20 * Author: Stefan Berger <stefanb@us.ibm.com>
21 */
22 #include "rombios_compat.h"
23 #include "jumptable.h"
24 #include "32bitprotos.h"
26 /* same prototypes as in the 16bit BIOS */
27 Bit32u multiply(Bit32u a, Bit32u b)
28 {
29 return a*b;
30 }
32 Bit32u add(Bit32u a, Bit32u b)
33 {
34 return a+b;
35 }
37 static Bit32u stat_a = 0x1;
38 Bit32u set_static(Bit32u a)
39 {
40 Bit32u _a = stat_a;
41 stat_a = a;
42 return _a;
43 }
46 /*
47 the jumptable that will be copied into the rombios in the 0xf000 segment
48 for every function that is to be called from the lower BIOS, make an entry
49 here.
50 */
51 #define TABLE_ENTRY(idx, func) [idx] = (uint32_t)func
52 uint32_t jumptable[IDX_LAST+1] __attribute__((section (JUMPTABLE_SECTION_NAME))) =
53 {
54 TABLE_ENTRY(IDX_MULTIPLY , multiply),
55 TABLE_ENTRY(IDX_ADD , add),
56 TABLE_ENTRY(IDX_SET_STATIC , set_static),
58 TABLE_ENTRY(IDX_TCPA_ACPI_INIT, tcpa_acpi_init),
59 TABLE_ENTRY(IDX_TCPA_EXTEND_ACPI_LOG, tcpa_extend_acpi_log),
61 TABLE_ENTRY(IDX_TCGINTERRUPTHANDLER, TCGInterruptHandler),
63 TABLE_ENTRY(IDX_TCPA_CALLING_INT19H, tcpa_calling_int19h),
64 TABLE_ENTRY(IDX_TCPA_RETURNED_INT19H, tcpa_returned_int19h),
65 TABLE_ENTRY(IDX_TCPA_ADD_EVENT_SEPARATORS, tcpa_add_event_separators),
66 TABLE_ENTRY(IDX_TCPA_WAKE_EVENT, tcpa_wake_event),
67 TABLE_ENTRY(IDX_TCPA_ADD_BOOTDEVICE, tcpa_add_bootdevice),
68 TABLE_ENTRY(IDX_TCPA_START_OPTION_ROM_SCAN, tcpa_start_option_rom_scan),
69 TABLE_ENTRY(IDX_TCPA_OPTION_ROM, tcpa_option_rom),
70 TABLE_ENTRY(IDX_TCPA_IPL, tcpa_ipl),
71 TABLE_ENTRY(IDX_TCPA_MEASURE_POST, tcpa_measure_post),
73 TABLE_ENTRY(IDX_TCPA_INITIALIZE_TPM, tcpa_initialize_tpm),
75 TABLE_ENTRY(IDX_LAST , 0) /* keep last */
76 };