]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/Sec/Ia32/GasketTemplate.c
Fix reverse gasket issue that was breaking watch dog timer.
[mirror_edk2.git] / UnixPkg / Sec / Ia32 / GasketTemplate.c
CommitLineData
7ee3b613
A
1/** @file
2 Template file used to create Gasket.S
3
4 This file is built on the command line via gcc GasketTemplate.c -S
5 and it will create GasketTemplate.s and this was used to create
6 Gasket.S. You still have to add the extra stack alignment code to
7 the assembly functions.
8
f9b8ab56
HT
9Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
10Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
11This program and the accompanying materials
7ee3b613
A
12are licensed and made available under the terms and conditions of the BSD License
13which accompanies this distribution. The full text of the license may be found at
14http://opensource.org/licenses/bsd-license.php
15
16THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18
19**/
20
21
22#include <stdint.h>
23#include <sys/stat.h>
24
25typedef int8_t INT8;
26typedef uint8_t UINT8;
27typedef int16_t INT16;
28typedef uint16_t UINT16;
29typedef int32_t INT32;
30typedef uint32_t UINT32;
31typedef int64_t INT64;
32typedef uint64_t UINT64;
33typedef UINT32 UINTN;
34
35
36typedef int (*GASKET_VOID) ();
37typedef int (*GASKET_UINTN) (UINTN);
2ec364f9 38typedef int (*GASKET_UINT64) (UINT64);
7ee3b613
A
39typedef int (*GASKET_UINTN_UINTN) (UINTN, UINTN);
40typedef int (*GASKET_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN);
41typedef int (*GASKET_UINTN_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN, UINTN);
42typedef int (*GASKET_UINTN_10ARGS) (UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN);
43typedef int (*GASKET_UINT64_UINTN) (UINT64, UINTN);
44typedef UINT64 (*GASKET_UINTN_UINT64_UINTN) (UINTN, UINT64, UINTN);
45typedef int (*GASKET_UINTN_UINT16) (UINTN, UINT16);
46
47int GasketVoid (void *api);
48int GasketUintn (void *api, UINTN a);
49int GasketUintnUintn (void *api, UINTN a, UINTN b);
50int GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c);
51int GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d);
52int GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j);
53int GasketUint64Uintn (void *api, UINT64 a, UINTN b);
54UINT64 GasketUintnUiny64Uintn (void *api, UINTN a, UINT64 b, UINTN c);
55int GasketUintnUint16 (void *api, UINTN a, UINT16 b);
56
57
58
59int
60GasketVoid (void *api)
61{
62 GASKET_VOID func;
63
64 func = (GASKET_VOID)api;
65 return func ();
66}
67
68int
69GasketUintn (void *api, UINTN a)
70{
71 GASKET_UINTN func;
72
73 func = (GASKET_UINTN)api;
74 return func (a);
75}
76
77int
78GasketUintnUintn (void *api, UINTN a, UINTN b)
79{
80 GASKET_UINTN_UINTN func;
81
82 func = (GASKET_UINTN_UINTN)api;
83 return func (a, b);
84}
85
86
87int
88GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c)
89{
90 GASKET_UINTN_UINTN_UINTN func;
91
92 func = (GASKET_UINTN_UINTN_UINTN)api;
93 return func (a, b, c);
94}
95
96int
97GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d)
98{
99 GASKET_UINTN_UINTN_UINTN_UINTN func;
100
101 func = (GASKET_UINTN_UINTN_UINTN_UINTN)api;
102 return func (a, b, c, d);
103}
104
105int
106GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j)
107{
108 GASKET_UINTN_10ARGS func;
109
110 func = (GASKET_UINTN_10ARGS)api;
111 return func (a, b, c, d, e, f, g, h, i, j);
112}
113
114
115int
116GasketUint64Uintn (void *api, UINT64 a, UINTN b)
117{
118 GASKET_UINT64_UINTN func;
119
120 func = (GASKET_UINT64_UINTN)api;
121 return func (a, b);
122}
123
124UINT64
67f86803 125GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c)
7ee3b613
A
126{
127 GASKET_UINTN_UINT64_UINTN func;
128
129 func = (GASKET_UINTN_UINT64_UINTN)api;
130 return func (a, b, c);
131}
132
133int
134GasketUintnUint16 (void *api, UINTN a, UINT16 b)
135{
136 GASKET_UINTN_UINT16 func;
137
138 func = (GASKET_UINTN_UINT16)api;
139 return func (a, b);
140}
141
b9c8e50e 142void
143ReverseGasketUint64 (void *api, UINT64 a)
144{
145 GASKET_UINTN func;
146
2ec364f9 147 func = (GASKET_UINT64)api;
b9c8e50e 148 func (a);
149 return;
150}
7ee3b613
A
151
152