split out instructions from openpower/isa/system.mdwn split-insns
authorJacob Lifshay <programmerjake@gmail.com>
Mon, 7 Aug 2023 23:04:00 +0000 (16:04 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Mon, 7 Aug 2023 23:06:58 +0000 (16:06 -0700)
openpower/isa/system.mdwn
openpower/isa/system/hrfid.mdwn [new file with mode: 0644]
openpower/isa/system/hrfid_code.mdwn [new file with mode: 0644]
openpower/isa/system/rfid.mdwn [new file with mode: 0644]
openpower/isa/system/rfid_code.mdwn [new file with mode: 0644]
openpower/isa/system/rfscv.mdwn [new file with mode: 0644]
openpower/isa/system/rfscv_code.mdwn [new file with mode: 0644]
openpower/isa/system/sc.mdwn [new file with mode: 0644]
openpower/isa/system/sc_code.mdwn [new file with mode: 0644]
openpower/isa/system/scv.mdwn [new file with mode: 0644]
openpower/isa/system/scv_code.mdwn [new file with mode: 0644]

index 74f06c50b1bfaacf1c8164a0b3a08f2a54db8bae..7d3dab1d542e3bc6131bb6fd1c1ca44c339cf5c8 100644 (file)
 
 <!-- These instructions provide the means by which a program can call upon the system to perform a service. -->
 
-# System Call
+[[!inline pagenames="openpower/isa/system/sc" raw="yes"]]
 
-SC-Form
+[[!inline pagenames="openpower/isa/system/scv" raw="yes"]]
 
-* sc LEV
+[[!inline pagenames="openpower/isa/system/rfscv" raw="yes"]]
 
-Pseudo-code:
+[[!inline pagenames="openpower/isa/system/rfid" raw="yes"]]
 
-    SRR0 <-iea CIA + 4
-    SRR1[33:36] <- 0
-    SRR1[42:47] <- 0
-    SRR1[0:32]  <- MSR[0:32]
-    SRR1[37:41] <- MSR[37:41]
-    SRR1[48:63] <- MSR[48:63]
-    MSR <- new_value
-    NIA <- 0x0000_0000_0000_0C00
-
-Special Registers Altered:
-
-    SRR0 SRR1 MSR
-
-# System Call Vectored
-
-SC-Form
-
-* scv LEV
-
-Pseudo-code:
-
-    LR <- CIA + 4
-    SRR1[33:36] <- undefined([0]*4)
-    SRR1[42:47] <- undefined([0]*6)
-    SRR1[0:32]  <- MSR[0:32]
-    SRR1[37:41] <- MSR[37:41]
-    SRR1[48:63] <- MSR[48:63]
-    MSR <- new_value
-    NIA <- vectored
-
-Special Registers Altered:
-
-    LR CTR MSR
-
-# Return From System Call Vectored
-
-XL-Form
-
-* rfscv
-
-Pseudo-code:
-
-    if (MSR[29:31] != 0b010) | (CTR[29:31] != 0b000) then
-        MSR[29:31] <- CTR[29:31]
-    MSR[48] <- CTR[49]
-    MSR[58] <- CTR[49]
-    MSR[59] <- CTR[49]
-    MSR[0:2] <- CTR[0:2]
-    MSR[4:28] <- CTR[4:28]
-    MSR[32] <- CTR[32]
-    MSR[37:41] <- CTR[37:41]
-    MSR[49:50] <- CTR[49:50]
-    MSR[52:57] <- CTR[52:57]
-    MSR[60:63] <- CTR[60:63]
-    NIA <-iea LR[0:61] || 0b00
-
-Special Registers Altered:
-
-    MSR
-
-# Return From Interrupt Doubleword
-
-XL-Form
-
-* rfid
-
-Pseudo-code:
-
-    MSR[51] <- (MSR[3] & SRR1[51]) | ((¬MSR[3] & MSR[51]))
-    MSR[3] <- (MSR[3] & SRR1[3])
-    if (MSR[29:31] != 0b010) | (SRR1[29:31] != 0b000) then
-        MSR[29:31] <- SRR1[29:31]
-    MSR[48] <- SRR1[48] | SRR1[49]
-    MSR[58] <- SRR1[58] | SRR1[49]
-    MSR[59] <- SRR1[59] | SRR1[49]
-    MSR[0:2] <- SRR1[0:2]
-    MSR[4:28] <- SRR1[4:28]
-    MSR[32] <- SRR1[32]
-    MSR[37:41] <- SRR1[37:41]
-    MSR[49:50] <- SRR1[49:50]
-    MSR[52:57] <- SRR1[52:57]
-    MSR[60:63] <- SRR1[60:63]
-    NIA <-iea SRR0[0:61] || 0b00
-
-Special Registers Altered:
-
-    MSR
-
-# Hypervisor Return From Interrupt Doubleword
-
-XL-Form
-
-* hrfid
-
-Pseudo-code:
-
-    if (MSR[29:31] != 0b010) | (HSRR1[29:31] != 0b000) then
-        MSR[29:31] <- HSRR1[29:31]
-    MSR[48] <- HSRR1[48] | HSRR1[49]
-    MSR[58] <- HSRR1[58] | HSRR1[49]
-    MSR[59] <- HSRR1[59] | HSRR1[49]
-    MSR[0:28] <- HSRR1[0:28]
-    MSR[32] <- HSRR1[32]
-    MSR[37:41] <- HSRR1[37:41]
-    MSR[49:57] <- HSRR1[49:57]
-    MSR[60:63] <- HSRR1[60:63]
-    NIA <-iea HSRR0[0:61] || 0b00
-
-Special Registers Altered:
-
-    MSR
-
-<!-- Checked March 2021 -->
+[[!inline pagenames="openpower/isa/system/hrfid" raw="yes"]]
diff --git a/openpower/isa/system/hrfid.mdwn b/openpower/isa/system/hrfid.mdwn
new file mode 100644 (file)
index 0000000..4616743
--- /dev/null
@@ -0,0 +1,15 @@
+# Hypervisor Return From Interrupt Doubleword
+
+XL-Form
+
+* hrfid
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/system/hrfid_code" raw="yes"]]
+
+Special Registers Altered:
+
+    MSR
+
+<!-- Checked March 2021 -->
diff --git a/openpower/isa/system/hrfid_code.mdwn b/openpower/isa/system/hrfid_code.mdwn
new file mode 100644 (file)
index 0000000..4fe186d
--- /dev/null
@@ -0,0 +1,11 @@
+    if (MSR[29:31] != 0b010) | (HSRR1[29:31] != 0b000) then
+        MSR[29:31] <- HSRR1[29:31]
+    MSR[48] <- HSRR1[48] | HSRR1[49]
+    MSR[58] <- HSRR1[58] | HSRR1[49]
+    MSR[59] <- HSRR1[59] | HSRR1[49]
+    MSR[0:28] <- HSRR1[0:28]
+    MSR[32] <- HSRR1[32]
+    MSR[37:41] <- HSRR1[37:41]
+    MSR[49:57] <- HSRR1[49:57]
+    MSR[60:63] <- HSRR1[60:63]
+    NIA <-iea HSRR0[0:61] || 0b00
diff --git a/openpower/isa/system/rfid.mdwn b/openpower/isa/system/rfid.mdwn
new file mode 100644 (file)
index 0000000..7377509
--- /dev/null
@@ -0,0 +1,13 @@
+# Return From Interrupt Doubleword
+
+XL-Form
+
+* rfid
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/system/rfid_code" raw="yes"]]
+
+Special Registers Altered:
+
+    MSR
diff --git a/openpower/isa/system/rfid_code.mdwn b/openpower/isa/system/rfid_code.mdwn
new file mode 100644 (file)
index 0000000..ec2c796
--- /dev/null
@@ -0,0 +1,15 @@
+    MSR[51] <- (MSR[3] & SRR1[51]) | ((¬MSR[3] & MSR[51]))
+    MSR[3] <- (MSR[3] & SRR1[3])
+    if (MSR[29:31] != 0b010) | (SRR1[29:31] != 0b000) then
+        MSR[29:31] <- SRR1[29:31]
+    MSR[48] <- SRR1[48] | SRR1[49]
+    MSR[58] <- SRR1[58] | SRR1[49]
+    MSR[59] <- SRR1[59] | SRR1[49]
+    MSR[0:2] <- SRR1[0:2]
+    MSR[4:28] <- SRR1[4:28]
+    MSR[32] <- SRR1[32]
+    MSR[37:41] <- SRR1[37:41]
+    MSR[49:50] <- SRR1[49:50]
+    MSR[52:57] <- SRR1[52:57]
+    MSR[60:63] <- SRR1[60:63]
+    NIA <-iea SRR0[0:61] || 0b00
diff --git a/openpower/isa/system/rfscv.mdwn b/openpower/isa/system/rfscv.mdwn
new file mode 100644 (file)
index 0000000..d977633
--- /dev/null
@@ -0,0 +1,13 @@
+# Return From System Call Vectored
+
+XL-Form
+
+* rfscv
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/system/rfscv_code" raw="yes"]]
+
+Special Registers Altered:
+
+    MSR
diff --git a/openpower/isa/system/rfscv_code.mdwn b/openpower/isa/system/rfscv_code.mdwn
new file mode 100644 (file)
index 0000000..c316f0c
--- /dev/null
@@ -0,0 +1,13 @@
+    if (MSR[29:31] != 0b010) | (CTR[29:31] != 0b000) then
+        MSR[29:31] <- CTR[29:31]
+    MSR[48] <- CTR[49]
+    MSR[58] <- CTR[49]
+    MSR[59] <- CTR[49]
+    MSR[0:2] <- CTR[0:2]
+    MSR[4:28] <- CTR[4:28]
+    MSR[32] <- CTR[32]
+    MSR[37:41] <- CTR[37:41]
+    MSR[49:50] <- CTR[49:50]
+    MSR[52:57] <- CTR[52:57]
+    MSR[60:63] <- CTR[60:63]
+    NIA <-iea LR[0:61] || 0b00
diff --git a/openpower/isa/system/sc.mdwn b/openpower/isa/system/sc.mdwn
new file mode 100644 (file)
index 0000000..0a3f036
--- /dev/null
@@ -0,0 +1,13 @@
+# System Call
+
+SC-Form
+
+* sc LEV
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/system/sc_code" raw="yes"]]
+
+Special Registers Altered:
+
+    SRR0 SRR1 MSR
diff --git a/openpower/isa/system/sc_code.mdwn b/openpower/isa/system/sc_code.mdwn
new file mode 100644 (file)
index 0000000..256f18c
--- /dev/null
@@ -0,0 +1,8 @@
+    SRR0 <-iea CIA + 4
+    SRR1[33:36] <- 0
+    SRR1[42:47] <- 0
+    SRR1[0:32]  <- MSR[0:32]
+    SRR1[37:41] <- MSR[37:41]
+    SRR1[48:63] <- MSR[48:63]
+    MSR <- new_value
+    NIA <- 0x0000_0000_0000_0C00
diff --git a/openpower/isa/system/scv.mdwn b/openpower/isa/system/scv.mdwn
new file mode 100644 (file)
index 0000000..8de1e9a
--- /dev/null
@@ -0,0 +1,13 @@
+# System Call Vectored
+
+SC-Form
+
+* scv LEV
+
+Pseudo-code:
+
+[[!inline pagenames="openpower/isa/system/scv_code" raw="yes"]]
+
+Special Registers Altered:
+
+    LR CTR MSR
diff --git a/openpower/isa/system/scv_code.mdwn b/openpower/isa/system/scv_code.mdwn
new file mode 100644 (file)
index 0000000..0e042f4
--- /dev/null
@@ -0,0 +1,8 @@
+    LR <- CIA + 4
+    SRR1[33:36] <- undefined([0]*4)
+    SRR1[42:47] <- undefined([0]*6)
+    SRR1[0:32]  <- MSR[0:32]
+    SRR1[37:41] <- MSR[37:41]
+    SRR1[48:63] <- MSR[48:63]
+    MSR <- new_value
+    NIA <- vectored