]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/Sec/Ia32/GasketTemplate.c
Started trying to get the UnixPkg to compile for X64 with UnixABI. So far only have...
[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);
38typedef int (*GASKET_UINTN_UINTN) (UINTN, UINTN);
39typedef int (*GASKET_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN);
40typedef int (*GASKET_UINTN_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN, UINTN);
41typedef int (*GASKET_UINTN_10ARGS) (UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN, UINTN);
42typedef int (*GASKET_UINT64_UINTN) (UINT64, UINTN);
43typedef UINT64 (*GASKET_UINTN_UINT64_UINTN) (UINTN, UINT64, UINTN);
44typedef int (*GASKET_UINTN_UINT16) (UINTN, UINT16);
45
46int GasketVoid (void *api);
47int GasketUintn (void *api, UINTN a);
48int GasketUintnUintn (void *api, UINTN a, UINTN b);
49int GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c);
50int GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d);
51int GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j);
52int GasketUint64Uintn (void *api, UINT64 a, UINTN b);
53UINT64 GasketUintnUiny64Uintn (void *api, UINTN a, UINT64 b, UINTN c);
54int GasketUintnUint16 (void *api, UINTN a, UINT16 b);
55
56
57
58int
59GasketVoid (void *api)
60{
61 GASKET_VOID func;
62
63 func = (GASKET_VOID)api;
64 return func ();
65}
66
67int
68GasketUintn (void *api, UINTN a)
69{
70 GASKET_UINTN func;
71
72 func = (GASKET_UINTN)api;
73 return func (a);
74}
75
76int
77GasketUintnUintn (void *api, UINTN a, UINTN b)
78{
79 GASKET_UINTN_UINTN func;
80
81 func = (GASKET_UINTN_UINTN)api;
82 return func (a, b);
83}
84
85
86int
87GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c)
88{
89 GASKET_UINTN_UINTN_UINTN func;
90
91 func = (GASKET_UINTN_UINTN_UINTN)api;
92 return func (a, b, c);
93}
94
95int
96GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d)
97{
98 GASKET_UINTN_UINTN_UINTN_UINTN func;
99
100 func = (GASKET_UINTN_UINTN_UINTN_UINTN)api;
101 return func (a, b, c, d);
102}
103
104int
105GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j)
106{
107 GASKET_UINTN_10ARGS func;
108
109 func = (GASKET_UINTN_10ARGS)api;
110 return func (a, b, c, d, e, f, g, h, i, j);
111}
112
113
114int
115GasketUint64Uintn (void *api, UINT64 a, UINTN b)
116{
117 GASKET_UINT64_UINTN func;
118
119 func = (GASKET_UINT64_UINTN)api;
120 return func (a, b);
121}
122
123UINT64
67f86803 124GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c)
7ee3b613
A
125{
126 GASKET_UINTN_UINT64_UINTN func;
127
128 func = (GASKET_UINTN_UINT64_UINTN)api;
129 return func (a, b, c);
130}
131
132int
133GasketUintnUint16 (void *api, UINTN a, UINT16 b)
134{
135 GASKET_UINTN_UINT16 func;
136
137 func = (GASKET_UINTN_UINT16)api;
138 return func (a, b);
139}
140
141
142