[rtems-central commit] spec: Use compiler for IO load/store
Sebastian Huber
sebh at rtems.org
Fri Nov 19 07:51:56 UTC 2021
Module: rtems-central
Branch: master
Commit: 94a1824375f7b0c13b82afd0512972ffbcf058bc
Changeset: http://git.rtems.org/rtems-central/commit/?id=94a1824375f7b0c13b82afd0512972ffbcf058bc
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Sat Nov 13 15:23:48 2021 +0100
spec: Use compiler for IO load/store
This has two reasons. Firstly, the clang compiler does not understand
the GCC assembler constains. Secondly, it allows compiler generated
workarounds for chip errata.
---
spec/bsp/sparc/if/grlib-load-08.yml | 6 +-----
spec/bsp/sparc/if/grlib-load-16.yml | 6 +-----
spec/bsp/sparc/if/grlib-load-32.yml | 6 +-----
spec/bsp/sparc/if/grlib-load-64.yml | 6 +-----
spec/bsp/sparc/if/grlib-store-08.yml | 2 +-
spec/bsp/sparc/if/grlib-store-16.yml | 2 +-
spec/bsp/sparc/if/grlib-store-32.yml | 2 +-
spec/bsp/sparc/if/grlib-store-64.yml | 2 +-
8 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/spec/bsp/sparc/if/grlib-load-08.yml b/spec/bsp/sparc/if/grlib-load-08.yml
index 52b2349..aefcc8e 100644
--- a/spec/bsp/sparc/if/grlib-load-08.yml
+++ b/spec/bsp/sparc/if/grlib-load-08.yml
@@ -7,11 +7,7 @@ definition:
default:
attributes: null
body: |
- ${/c/if/uint8_t:/name} value;
-
- __asm__ volatile ( "ldub [%1], %0" : "=&r" ( value ) : "r" ( ${.:/params[0]/name} ) );
-
- return value;
+ return *address;
params:
- const volatile ${/c/if/uint8_t:/name} *${.:/params[0]/name}
return: ${/c/if/uint8_t:/name}
diff --git a/spec/bsp/sparc/if/grlib-load-16.yml b/spec/bsp/sparc/if/grlib-load-16.yml
index a15d031..59ac4ff 100644
--- a/spec/bsp/sparc/if/grlib-load-16.yml
+++ b/spec/bsp/sparc/if/grlib-load-16.yml
@@ -7,11 +7,7 @@ definition:
default:
attributes: null
body: |
- ${/c/if/uint16_t:/name} value;
-
- __asm__ volatile ( "lduh [%1], %0" : "=&r" ( value ) : "r" ( ${.:/params[0]/name} ) );
-
- return value;
+ return *address;
params:
- const volatile ${/c/if/uint16_t:/name} *${.:/params[0]/name}
return: ${/c/if/uint16_t:/name}
diff --git a/spec/bsp/sparc/if/grlib-load-32.yml b/spec/bsp/sparc/if/grlib-load-32.yml
index 776a591..9e843f6 100644
--- a/spec/bsp/sparc/if/grlib-load-32.yml
+++ b/spec/bsp/sparc/if/grlib-load-32.yml
@@ -7,11 +7,7 @@ definition:
default:
attributes: null
body: |
- ${/c/if/uint32_t:/name} value;
-
- __asm__ volatile ( "ld [%1], %0" : "=&r" ( value ) : "r" ( ${.:/params[0]/name} ) );
-
- return value;
+ return *address;
params:
- const volatile ${/c/if/uint32_t:/name} *${.:/params[0]/name}
return: ${/c/if/uint32_t:/name}
diff --git a/spec/bsp/sparc/if/grlib-load-64.yml b/spec/bsp/sparc/if/grlib-load-64.yml
index 010da08..85f9a4b 100644
--- a/spec/bsp/sparc/if/grlib-load-64.yml
+++ b/spec/bsp/sparc/if/grlib-load-64.yml
@@ -7,11 +7,7 @@ definition:
default:
attributes: null
body: |
- ${/c/if/uint64_t:/name} value;
-
- __asm__ volatile ( "ldd [%1], %0" : "=&U" ( value ) : "r" ( ${.:/params[0]/name} ) );
-
- return value;
+ return *address;
params:
- const volatile ${/c/if/uint64_t:/name} *${.:/params[0]/name}
return: ${/c/if/uint64_t:/name}
diff --git a/spec/bsp/sparc/if/grlib-store-08.yml b/spec/bsp/sparc/if/grlib-store-08.yml
index 9a6ac6b..8fbdf4b 100644
--- a/spec/bsp/sparc/if/grlib-store-08.yml
+++ b/spec/bsp/sparc/if/grlib-store-08.yml
@@ -7,7 +7,7 @@ definition:
default:
attributes: null
body: |
- __asm__ volatile ( "stb %0, [%1]" : : "r" ( ${.:/params[1]/name} ), "r" ( ${.:/params[0]/name} ) );
+ *address = value;
params:
- volatile ${/c/if/uint8_t:/name} *${.:/params[0]/name}
- ${/c/if/uint8_t:/name} ${.:/params[1]/name}
diff --git a/spec/bsp/sparc/if/grlib-store-16.yml b/spec/bsp/sparc/if/grlib-store-16.yml
index 236a907..6776025 100644
--- a/spec/bsp/sparc/if/grlib-store-16.yml
+++ b/spec/bsp/sparc/if/grlib-store-16.yml
@@ -7,7 +7,7 @@ definition:
default:
attributes: null
body: |
- __asm__ volatile ( "sth %0, [%1]" : : "r" ( ${.:/params[1]/name} ), "r" ( ${.:/params[0]/name} ) );
+ *address = value;
params:
- volatile ${/c/if/uint16_t:/name} *${.:/params[0]/name}
- ${/c/if/uint16_t:/name} ${.:/params[1]/name}
diff --git a/spec/bsp/sparc/if/grlib-store-32.yml b/spec/bsp/sparc/if/grlib-store-32.yml
index 978bf8e..5ce3835 100644
--- a/spec/bsp/sparc/if/grlib-store-32.yml
+++ b/spec/bsp/sparc/if/grlib-store-32.yml
@@ -7,7 +7,7 @@ definition:
default:
attributes: null
body: |
- __asm__ volatile ( "st %0, [%1]" : : "r" ( ${.:/params[1]/name} ), "r" ( ${.:/params[0]/name} ) );
+ *address = value;
params:
- volatile ${/c/if/uint32_t:/name} *${.:/params[0]/name}
- ${/c/if/uint32_t:/name} ${.:/params[1]/name}
diff --git a/spec/bsp/sparc/if/grlib-store-64.yml b/spec/bsp/sparc/if/grlib-store-64.yml
index 1f36ecf..fa1786b 100644
--- a/spec/bsp/sparc/if/grlib-store-64.yml
+++ b/spec/bsp/sparc/if/grlib-store-64.yml
@@ -7,7 +7,7 @@ definition:
default:
attributes: null
body: |
- __asm__ volatile ( "std %0, [%1]" : : "U" ( ${.:/params[1]/name} ), "r" ( ${.:/params[0]/name} ) );
+ *address = value;
params:
- volatile ${/c/if/uint64_t:/name} *${.:/params[0]/name}
- ${/c/if/uint64_t:/name} ${.:/params[1]/name}
More information about the vc
mailing list