aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2023-12-11 14:28:32 -0500
committerIan Moffett <ian@osmora.org>2023-12-11 14:35:44 -0500
commita1d3154381e1bfdbca59bcdf9d4d719b0316fcda (patch)
treeaafa8f1d3e0278e9f8161878de194a041f51288f /share
parentd9add153a3a55202089e1c2759db8e00af4676d1 (diff)
kernel/amd64: Update arch(9)
This commit cleans up arch(9) as a few things were noticed. First, it would make sense to identify cores (described by the cpu_info structure) in every arch ported, thus the lapic_id has been changed to id so it can be shared. Some annotations have also been added for the sake of clarity. The manpage for arch(9) has also been cleaned up. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/arch.931
1 files changed, 29 insertions, 2 deletions
diff --git a/share/man/man9/arch.9 b/share/man/man9/arch.9
index 6948e81..94ccd6a 100644
--- a/share/man/man9/arch.9
+++ b/share/man/man9/arch.9
@@ -48,16 +48,43 @@ struct which contains CPU specific fields.
Example
.Ft cpu_info
-structure for x86_64 is shown below:
+structure shown below:
.Bd -literal
struct cpu_info {
+ /* Per-arch fields */
void *pmap; /* Current pmap */
- volatile uint32_t lapic_freq;
+ uint32_t id;
+ struct spinlock lock;
+ /* AMD64 */
...
};
.Ed
+There will be some per-architecture fields that, for the sake
+of keeping things tidy, should remain at the top of the struct.
+These fields will be described below.
+
+The
+.Ft pmap
+field points to the current virtual memory context
+which shall be NULL if not used.
+
+The
+.Ft id
+field simply identifies the CPU with a specific "ID".
+
+The
+.Ft lock
+field is a spinlock to prevent race conditions
+while accessing this structure. This must be acquired
+when accessing a
+.Ft cpu_info
+instance.
+
+There are also some common helper macros that shall
+be implemented, these are described below.
+
The macro
.Ft this_cpu()
calls an internal function that fetches the