aboutsummaryrefslogtreecommitdiff
path: root/include/elf/amdgpu.h
blob: e3c90dc74e85df935c757c3aaa64f1a22167b17a (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* AMDGPU ELF support for BFD.

   Copyright (C) 2019-2021 Free Software Foundation, Inc.

   This file is part of BFD, the Binary File Descriptor library.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#ifndef _ELF_AMDGPU_H
#define _ELF_AMDGPU_H

/* e_ident[EI_ABIVERSION] values, when e_ident[EI_OSABI] is
   ELFOSABI_AMDGPU_HSA.  */

#define ELFABIVERSION_AMDGPU_HSA_V2 0
#define ELFABIVERSION_AMDGPU_HSA_V3 1
#define ELFABIVERSION_AMDGPU_HSA_V4 2
#define ELFABIVERSION_AMDGPU_HSA_V5 3

/* Processor selection mask for EF_AMDGPU_MACH_* values.  */

#define EF_AMDGPU_MACH 0x0ff
#define EF_AMDGPU_MACH_AMDGCN_MIN 0x020

#define EF_AMDGPU_MACH_AMDGCN_GFX600  0x020
#define EF_AMDGPU_MACH_AMDGCN_GFX601  0x021
#define EF_AMDGPU_MACH_AMDGCN_GFX700  0x022
#define EF_AMDGPU_MACH_AMDGCN_GFX701  0x023
#define EF_AMDGPU_MACH_AMDGCN_GFX702  0x024
#define EF_AMDGPU_MACH_AMDGCN_GFX703  0x025
#define EF_AMDGPU_MACH_AMDGCN_GFX704  0x026
#define EF_AMDGPU_MACH_AMDGCN_GFX801  0x028
#define EF_AMDGPU_MACH_AMDGCN_GFX802  0x029
#define EF_AMDGPU_MACH_AMDGCN_GFX803  0x02a
#define EF_AMDGPU_MACH_AMDGCN_GFX810  0x02b
#define EF_AMDGPU_MACH_AMDGCN_GFX900  0x02c
#define EF_AMDGPU_MACH_AMDGCN_GFX902  0x02d
#define EF_AMDGPU_MACH_AMDGCN_GFX904  0x02e
#define EF_AMDGPU_MACH_AMDGCN_GFX906  0x02f
#define EF_AMDGPU_MACH_AMDGCN_GFX908  0x030
#define EF_AMDGPU_MACH_AMDGCN_GFX909  0x031
#define EF_AMDGPU_MACH_AMDGCN_GFX90C  0x032
#define EF_AMDGPU_MACH_AMDGCN_GFX1010 0x033
#define EF_AMDGPU_MACH_AMDGCN_GFX1011 0x034
#define EF_AMDGPU_MACH_AMDGCN_GFX1012 0x035
#define EF_AMDGPU_MACH_AMDGCN_GFX1030 0x036
#define EF_AMDGPU_MACH_AMDGCN_GFX1031 0x037
#define EF_AMDGPU_MACH_AMDGCN_GFX1032 0x038
#define EF_AMDGPU_MACH_AMDGCN_GFX1033 0x039
#define EF_AMDGPU_MACH_AMDGCN_GFX602  0x03a
#define EF_AMDGPU_MACH_AMDGCN_GFX705  0x03b
#define EF_AMDGPU_MACH_AMDGCN_GFX805  0x03c
#define EF_AMDGPU_MACH_AMDGCN_GFX1035 0x03d
#define EF_AMDGPU_MACH_AMDGCN_GFX1034 0x03e
#define EF_AMDGPU_MACH_AMDGCN_GFX90A  0x03f
#define EF_AMDGPU_MACH_AMDGCN_GFX940  0x040
#define EF_AMDGPU_MACH_AMDGCN_GFX1013 0x042
#define EF_AMDGPU_MACH_AMDGCN_GFX1036 0x045

/* Code object v3 machine flags.  */

#define EF_AMDGPU_FEATURE_XNACK_V3   0x100
#define EF_AMDGPU_FEATURE_SRAMECC_V3 0x200

/* Code object v4 (and later) machine flags.  */

#define EF_AMDGPU_FEATURE_XNACK_V4             0x300
#define EF_AMDGPU_FEATURE_XNACK_UNSUPPORTED_V4 0x000
#define EF_AMDGPU_FEATURE_XNACK_ANY_V4         0x100
#define EF_AMDGPU_FEATURE_XNACK_OFF_V4         0x200
#define EF_AMDGPU_FEATURE_XNACK_ON_V4          0x300

#define EF_AMDGPU_FEATURE_SRAMECC_V4             0xc00
#define EF_AMDGPU_FEATURE_SRAMECC_UNSUPPORTED_V4 0x000
#define EF_AMDGPU_FEATURE_SRAMECC_ANY_V4         0x400
#define EF_AMDGPU_FEATURE_SRAMECC_OFF_V4         0x800
#define EF_AMDGPU_FEATURE_SRAMECC_ON_V4          0xc00

/* Notes. */

#define NT_AMDGPU_METADATA                32

#endif /* _ELF_AMDGPU_H */