1 /*========================== begin_copyright_notice ============================
2 
3 Copyright (C) 2017-2021 Intel Corporation
4 
5 SPDX-License-Identifier: MIT
6 
7 ============================= end_copyright_notice ===========================*/
8 
9 /**
10 ** File Name     : visa_wa.h
11 **
12 ** Abstract      : Declaration of all SW workarounds implemented in vISA finalizer.
13 **
14 **  ---------------------------------------------------------------------- */
15 
16 #ifndef _VISA_WA_H_
17 #define _VISA_WA_H_
18 
19 #define VISA_WA_DECLARE( wa, wa_comment, wa_bugType ) unsigned int wa : 1;
20 #define VISA_WA_INIT( wa ) wa = 0;
21 #define VISA_WA_ENABLE( pWaTable, wa )    \
22 {                                         \
23     pWaTable->wa = true;                  \
24 }
25 #define VISA_WA_DISABLE( pWaTable, wa )    \
26 {                                         \
27     pWaTable->wa = false;                  \
28 }
29 #define VISA_WA_CHECK(pWaTable, w)  ((pWaTable)->w)
30 
31 enum VISA_WA_BUG_TYPE
32 {
33     VISA_WA_BUG_TYPE_UNKNOWN    = 0,
34     VISA_WA_BUG_TYPE_CORRUPTION = 1,
35     VISA_WA_BUG_TYPE_HANG       = 2,
36     VISA_WA_BUG_TYPE_PERF       = 4,
37     VISA_WA_BUG_TYPE_FUNCTIONAL = 8,
38     VISA_WA_BUG_TYPE_SPEC       = 16,
39     VISA_WA_BUG_TYPE_FAIL       = 32
40 };
41 
42 enum class VISA_BUILD_TYPE {
43     KERNEL = 0,
44     FUNCTION = 1,
45     PAYLOAD = 2
46 };
47 
48 enum CODE_PATCH_TYPE {
49     CodePatch_Disabled = 0,
50     CodePatch_Payload_Prologue = 1,
51     CodePatch_Enable_NoLTO = 2,
52     CodePatch_Enable
53 };
54 
55 enum LINKER_TYPE {
56     Linker_Subroutine = 0,       // VALUE 1
57     Linker_Call2Jump = 1,        // VALUE 2
58     Linker_Inline = 2,           // VALUE 4
59     Linker_RemoveStackFrame = 3, // VALUE 8
60     Linker_RemoveArgRet = 4,     // VALUE 16
61     Linker_RemoveStackArg = 5    // VALUE 32
62 };
63 
64 #endif
65