]> git.proxmox.com Git - mirror_edk2.git/blob - InOsEmuPkg/Include/Protocol/EmuPthreadThunk.h
Add InOsEmuPkg. Like UnixPkg and Nt32Pkg, but EFI code can be common and does not...
[mirror_edk2.git] / InOsEmuPkg / Include / Protocol / EmuPthreadThunk.h
1 /** @file
2 Emulator Thunk to abstract OS services from pure EFI code
3
4 Copyright (c) 2010 - 2011, Apple Inc. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EMU_PTHREAD_THUNK__
17 #define __EMU_PTHREAD_THUNK__
18
19 #define EMU_PTHREAD_THUNK_PROTOCO_GUID \
20 { 0x3B1E4B7C, 0x09D8, 0x944F, { 0xA4, 0x08, 0x13, 0x09, 0xEB, 0x8B, 0x44, 0x27 } }
21
22
23 typedef struct _EMU_PTREAD_THUNK_PROTOCOL EMU_PTREAD_THUNK_PROTOCOL;
24
25
26 typedef
27 UINTN
28 (EFIAPI *PTREAD_THUNK_MUTEXT_LOCK) (
29 IN VOID *Mutex
30 );
31
32
33 typedef
34 UINTN
35 (EFIAPI *PTREAD_THUNK_MUTEXT_UNLOCK) (
36 IN VOID *Mutex
37 );
38
39
40 typedef
41 UINTN
42 (EFIAPI *PTREAD_THUNK_MUTEX_TRY_LOCK) (
43 IN VOID *Mutex
44 );
45
46
47 typedef
48 VOID *
49 (EFIAPI *PTREAD_THUNK_MUTEX_INIT) (
50 IN VOID
51 );
52
53
54 typedef
55 UINTN
56 (EFIAPI *PTREAD_THUNK_MUTEX_DISTROY) (
57 IN VOID *Mutex
58 );
59
60
61
62 typedef
63 VOID *
64 (*PTREAD_THUNK_THEAD_ENTRY) (
65 IN VOID *Context
66 );
67
68 typedef
69 UINTN
70 (EFIAPI *PTREAD_THUNK_CREATE_THREAD) (
71 IN VOID *Thread,
72 IN VOID *Attribute,
73 IN PTREAD_THUNK_THEAD_ENTRY Start,
74 IN VOID *Context
75 );
76
77 typedef
78 VOID
79 (EFIAPI *PTREAD_THUNK_EXIT_THREAD) (
80 IN VOID *ValuePtr
81 );
82
83
84 typedef
85 UINTN
86 (EFIAPI *PTREAD_THUNK_SELF) (
87 VOID
88 );
89
90
91 struct _EMU_PTREAD_THUNK_PROTOCOL {
92 PTREAD_THUNK_MUTEXT_LOCK MutextLock;
93 PTREAD_THUNK_MUTEXT_UNLOCK MutexUnlock;
94 PTREAD_THUNK_MUTEX_TRY_LOCK MutexTryLock;
95 PTREAD_THUNK_MUTEX_INIT MutexInit;
96 PTREAD_THUNK_MUTEX_DISTROY MutexDistroy;
97 PTREAD_THUNK_CREATE_THREAD CreateThread;
98 PTREAD_THUNK_EXIT_THREAD ExitThread;
99 PTREAD_THUNK_SELF Self;
100 };
101
102 extern EFI_GUID gEmuPthreadThunkProtocolGuid;
103
104 #endif
105