Skip to content

Commit 6e0246f

Browse files
cyyselfcmuellner
authored andcommitted
Drop __riscv_vendor_feature_bits
As discussed in #96, current interface is insufficient to support some cases, like a vendor buying a CPU IP from the upstream vendor but using their own mvendorid and custom features from the upstream vendor. In this case, we might need to add these extensions for each downstream vendor many times. Thus, making __riscv_vendor_feature_bits guarded by mvendorid is not a good idea. So, drop __riscv_vendor_feature_bits for now, and we should have time to discuss a better solution.
1 parent 9bfcb77 commit 6e0246f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/c-api.adoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ This feature is activated by the `target_version/target_clones` function attribu
839839

840840
=== Extension Bitmask
841841

842-
The Extension Bitmask is used to probe whether features are enabled during runtime. This is achieved through three bitmask structures: `__riscv_feature_bits` for standard extensions, `__riscv_vendor_feature_bits` for vendor-specific extensions and `__riscv_cpu_model` for the CPU model. Additionally, `__init_riscv_feature_bits` is used to update the contents of these structures according to the system configuration.
842+
The Extension Bitmask is used to probe whether features are enabled during runtime. This is achieved through three bitmask structures: `__riscv_feature_bits` for standard extensions and `__riscv_cpu_model` for the CPU model. Additionally, `__init_riscv_feature_bits` is used to update the contents of these structures according to the system configuration.
843843

844844
The bitmask structures use the following definitions:
845845

@@ -849,11 +849,6 @@ struct {
849849
unsigned long long features[];
850850
} __riscv_feature_bits;
851851

852-
struct {
853-
unsigned length;
854-
unsigned long long features[];
855-
} __riscv_vendor_feature_bits;
856-
857852
struct {
858853
unsigned mvendorid;
859854
unsigned long long marchid;
@@ -873,7 +868,7 @@ To initiate these structures based on the system's extension status, the followi
873868
void __init_riscv_feature_bits(void *);
874869
```
875870

876-
The `__init_riscv_feature_bits` function updates `length`, `mvendorid`, `marchid`, `mimpid` and the `features` in `__riscv_feature_bits` and `__riscv_vendor_feature_bits` according to the enabled extensions in the system.
871+
The `__init_riscv_feature_bits` function updates `length`, `mvendorid`, `marchid`, `mimpid` and the `features` in `__riscv_feature_bits` according to the enabled extensions in the system.
877872

878873
The `__init_riscv_feature_bits` function accepts an argument of type `void *`. This argument allows the platform to provide pre-computed data and access it without additional effort. For example, Linux could pass the vDSO object to avoid an extra system call.
879874

0 commit comments

Comments
 (0)