瀏覽代碼

Allow compiling on x86_64 for publishing.

David Craven 7 年之前
父節點
當前提交
467327cb15
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/csr.rs

+ 9 - 0
src/csr.rs

@@ -1,5 +1,6 @@
 //! Functions for accessing Control and Status Registers
 
+#[cfg(target_arch = "riscv")]
 macro_rules! csr_asm {
     ($op:ident, $csr:expr, $value:expr) => (
         {
@@ -16,6 +17,14 @@ macro_rules! csr_asm {
     )
 }
 
+
+#[cfg(not(target_arch = "riscv"))]
+macro_rules! csr_asm {
+    ($op:ident, $csr:expr, $value:expr) => {
+        0
+    }
+}
+
 macro_rules! r {
     ($MOD:ident, $TYPE:ident, $CSR:expr) => (
         pub struct R {