-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve debug and atomics, read CPU ID from CSR
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# kernel low-level utility code for Qemu Virt hardware environment | ||
# | ||
# (c) Chris Williams, 2018. | ||
# See LICENSE for usage and copying. | ||
|
||
.section .text | ||
.global platform_get_cpu_id | ||
|
||
# Look up the running core's ID | ||
# <= a0 = CPU core / hart ID | ||
platform_get_cpu_id: | ||
csrrc a0, mhartid, x0 | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# kernel low-level utility code for SiFive U34 hardware | ||
# | ||
# (c) Chris Williams, 2018. | ||
# See LICENSE for usage and copying. | ||
|
||
.section .text | ||
.global platform_get_cpu_id | ||
|
||
# Look up the running core's ID | ||
# <= a0 = CPU core / hart ID | ||
platform_get_cpu_id: | ||
csrrc a0, mhartid, x0 | ||
ret |