-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathldrddi.h.mako
More file actions
72 lines (65 loc) · 2.05 KB
/
Copy pathldrddi.h.mako
File metadata and controls
72 lines (65 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<%!
import re
from templates import helper as th
%><%
n=namespace
N=n.upper()
x=tags['$x']
X=x.upper()
%>/*
*
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
* @file ${name}.h
*
*/
#pragma once
namespace loader
{
///////////////////////////////////////////////////////////////////////////////
// Forward declaration for driver_t so this header can reference loader::driver_t*
// without requiring inclusion of ze_loader_internal.h (which includes this file).
struct driver_t;
///////////////////////////////////////////////////////////////////////////////
%for obj in th.extract_objs(specs, r"handle"):
%if 'class' in obj:
<%
_handle_t = th.subt(n, tags, obj['name'])
_object_t = re.sub(r"(\w+)_handle_t", r"\1_object_t", _handle_t)
_factory_t = re.sub(r"(\w+)_handle_t", r"\1_factory_t", _handle_t)
%>using ${th.append_ws(_object_t, 35)} = object_t < ${_handle_t} >;
using ${th.append_ws(_factory_t, 35)} = singleton_factory_t < ${_object_t}, ${_handle_t} >;
%endif
%endfor
__${x}dlllocal ze_result_t ${X}_APICALL
${n}loaderInitDriverDDITables(loader::driver_t *driver);
}
namespace loader_driver_ddi
{
__${x}dlllocal void ${X}_APICALL
${n}DestroyDDiDriverTables(${n}_dditable_driver_t* pDdiTable);
%for obj in th.extract_objs(specs, r"function"):
%if not (re.match(r"Init", obj['name']) or re.match(r"\w+InitDrivers$", th.make_func_name(n, tags, obj)) or re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj))):
__${x}dlllocal ${obj['return_type']} ${X}_APICALL
${th.make_func_name(n, tags, obj)}(
%for line in th.make_param_lines(n, tags, obj):
${line}
%endfor
);
%endif
%endfor
}
#if defined(__cplusplus)
extern "C" {
#endif
%for tbl in th.get_pfntables(specs, meta, n, tags):
__${x}dlllocal void ${X}_APICALL
${tbl['export']['name']}Legacy();
__${x}dlllocal ze_result_t ${X}_APICALL
${tbl['export']['name']}FromDriver(loader::driver_t *driver);
%endfor
#if defined(__cplusplus)
};
#endif