瀏覽代碼

spec: comment out 'target_pointer_width = "128"' checks by now

Currently, values for `target_pointer_width` expected by Rustc compiler are only `16`, `32`, and `64`. It will raise compile warning if an `128` is provided.

Minor fixes on `has_bit` internal function in binary module by adding an inline annotation.

Signed-off-by: Zhouqi Jiang <luojia@hust.edu.cn>
Zhouqi Jiang 8 月之前
父節點
當前提交
b4fe19d98b
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 1 0
      sbi-spec/src/binary.rs
  2. 6 4
      sbi-spec/src/lib.rs

+ 1 - 0
sbi-spec/src/binary.rs

@@ -681,6 +681,7 @@ impl SbiRet {
 /// - `base`: the starting bit index. (default: `0`)
 /// - `ignore`: if `base` is equal to this value, ignore the `mask` parameter, and consider all `bit`s set.
 /// - `bit`: the bit index to check for membership in the `mask`.
+#[inline]
 pub(crate) const fn has_bit(mask: usize, base: usize, ignore: usize, bit: usize) -> bool {
     if base == ignore {
         // ignore the `mask`, consider all `bit`s as set.

+ 6 - 4
sbi-spec/src/lib.rs

@@ -304,11 +304,13 @@ mod tests {
             () => {
                 const_assert_eq!(shmem_size::NATIVE, shmem_size::RV64);
             }
-            #[cfg(target_pointer_width = "128")]
-            () => {
-                const_assert_eq!(shmem_size::NATIVE, shmem_size::RV128);
-            }
         }
+        // FIXME(2024-08-03): gate target pointer width at 128
+        // Currently, values for `target_pointer_width` expected by Rustc compiler are only `16`, `32`, and `64`.
+        // #[cfg(target_pointer_width = "128")]
+        // () => {
+        //     const_assert_eq!(shmem_size::NATIVE, shmem_size::RV128);
+        // }
     }
     // §16
     #[test]