1 /*
2 * Implementation of stub functions for calls to the TCG BIOS
3 * extension in 32bit memory area.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; If not, see <http://www.gnu.org/licenses/>.
17 *
18 * Copyright (C) IBM Corporation, 2006
19 *
20 * Author: Stefan Berger <stefanb@us.ibm.com>
21 */
22
23 /*******************************************************************
24 Support for TCPA ACPI logging
25 ******************************************************************/
26
27 ASM_START
28 MACRO POST_MEASURE
29 push word #0x000f
30 push #?2
31 push word #0x000f
32 push #?1
33 call _tcpa_measure_post
34 add sp, #8
35 MEND
36 ASM_END
37
38 void
39 tcpa_do_measure_POSTs()
40 {
41 ASM_START
42
43 POST_MEASURE(post, nmi)
44 POST_MEASURE(floppy_drive_post, hard_drive_post)
45 POST_MEASURE(hard_drive_post, ebda_post)
46 POST_MEASURE(ebda_post, eoi_jmp_post)
47 POST_MEASURE(eoi_jmp_post, timer_tick_post)
48 POST_MEASURE(timer_tick_post, int76_handler)
49
50 ret
51 ASM_END
52 }
53
54 /*
55 * C-dispatcher for the TCG BIOS functions
56 */
57 #define TCG_MAGIC 0x41504354L
58 void
int1a_function32(regs,ES,DS,FLAGS)59 int1a_function32(regs, ES, DS, FLAGS)
60 pushad_regs_t regs;
61 Bit16u ES, DS, FLAGS;
62 {
63 Bit16u rc;
64
65 BX_DEBUG_INT1A("int1a_32: AX=%04x\n", regs.u.r16.ax);
66
67 switch (regs.u.r8.ah) {
68 case 0xbb:
69 /*
70 * all functions except for TCG_StatusCheck need to have the
71 * TCG_MAGIC in 'ebx'.
72 */
73 if (regs.u.r8.al != 0 &&
74 regs.u.r32.ebx != TCG_MAGIC) {
75 SET_CF();
76 return;
77 }
78 switch(regs.u.r8.al) {
79 case 0x00:
80 case 0x01:
81 case 0x02:
82 case 0x03:
83 case 0x04:
84 case 0x05:
85 case 0x06:
86 case 0x07:
87 TCGInterruptHandler(((Bit32u)get_SS() << 4) + (Bit32u)®s,
88 ES, DS,
89 ((Bit32u)get_SS() << 4) + (Bit32u)&FLAGS);
90 break;
91
92 default:
93 SET_CF();
94 }
95 break;
96 default:
97 SET_CF();
98 break;
99 }
100 BX_DEBUG_INT1A("int1a_32: FLAGS=%04x\n", FLAGS);
101 }
102