Skip to content

Commit 2d77081

Browse files
authored
Merge pull request #385 from riscv-non-isa/atomic-abi
Define new tag for atomic ABI
2 parents 30746d4 + 8a4b743 commit 2d77081

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

riscv-elf.adoc

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ non-standard ABI extensions.
10721072
| Tag_RISCV_priv_spec | 8 | uleb128 | *Deprecated*, indicates the major version of the privileged specification.
10731073
| Tag_RISCV_priv_spec_minor | 10 | uleb128 | *Deprecated*, indicates the minor version of the privileged specification.
10741074
| Tag_RISCV_priv_spec_revision | 12 | uleb128 | *Deprecated*, indicates the revision version of the privileged specification.
1075+
| Tag_RISCV_atomic_abi | 14 | uleb128 | Indicates which version of the atomics ABI is being used.
10751076
| Tag_RISCV_x3_reg_usage | 16 | uleb128 | Indicates the usage definition of the X3 register.
10761077
| Reserved for non-standard attribute | >= 32768 | - | -
10771078
|===
@@ -1177,7 +1178,47 @@ Merge policy:::
11771178
The linker should report errors if object files of different privileged
11781179
specification versions are merged.
11791180

1180-
===== Tag_RISCV_x3_reg_usage, 14, uleb128=value
1181+
===== Tag_RISCV_atomic_abi, 14, uleb128=version
1182+
1183+
Tag_RISCV_atomic_abi denotes the atomic ABI used within this object
1184+
file. Its values are defined as follows:
1185+
1186+
[cols="1,2,5"]
1187+
[width=100%]
1188+
|===
1189+
| Value | Symbolic Name | Description
1190+
1191+
| 0 | UNKNOWN | This object uses unknown atomic ABI.
1192+
| 1 | A6C | This object uses the A6 classical atomic ABI, which is defined in table A.6 in <<riscv-unpriv-20191213>>.
1193+
| 2 | A6S | This object uses the strengthened A6 ABI, which uses the atomic mapping defined by <<Mappings from C/C++ primitives to RISC-V primitives>> and does not rely on any note 3 annotated mappings.
1194+
| 3 | A7 | This object uses the A7 atomic ABI, which uses the atomic mapping defined by <<Mappings from C/C++ primitives to RISC-V primitives>> and may rely on note 3 annotated mappings.
1195+
|===
1196+
1197+
Merge policy:::
1198+
The linker should report errors if object files with incompatible atomics ABIs
1199+
are merged; the compatibility rules for atomic ABIs can be found in the
1200+
compatibility column in the following table.
1201+
1202+
[cols="6,2,3"]
1203+
[width=100%]
1204+
|===
1205+
| Input Values | Compatible? | Ouput Value
1206+
1207+
| UNKNOWN and A6C | Yes | A6C
1208+
| UNKNOWN and A6S | Yes | A6S
1209+
| UNKNOWN and A7 | Yes | A7
1210+
| A6C and A6S | Yes | A6C
1211+
| A6C and A7 | No | -
1212+
| A6S and A7 | Yes | A7
1213+
|===
1214+
1215+
NOTE: Merging object files with the same ABI will result in the same ABI.
1216+
1217+
NOTE: Programs that implement atomic operations without relying on the
1218+
A-extension are classified as UNKNOWN for now. A new value for those
1219+
may be defined in the future.
1220+
1221+
===== Tag_RISCV_x3_reg_usage, 16, uleb128=value
11811222

11821223
Tag_RISCV_x3_reg_usage indicates the usage of `x3`/`gp` register. `x3`/`gp` could be used for
11831224
global pointer relaxation, as a reserved platform register, or as a temporary register.
@@ -1666,5 +1707,9 @@ https://www.akkadia.org/drepper/tls.pdf, Ulrich Drepper
16661707
ISA, Document", Editors Andrew Waterman and Krste Asanovi´c,
16671708
RISC-V International.
16681709

1710+
* [[[riscv-unpriv-20191213]]] "The RISC-V Instruction Set Manual, Volume I: User-Level
1711+
ISA, Document release 20191213", Editors Andrew Waterman and Krste Asanovi´c,
1712+
RISC-V International.
1713+
16691714
* [[[riscv-zc-extension-group]]] "ZC* extension specification"
16701715
https://github.com/riscv/riscv-code-size-reduction

0 commit comments

Comments
 (0)