-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Axel Heider <[email protected]>
- Loading branch information
Showing
14 changed files
with
109 additions
and
67 deletions.
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
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,24 @@ | ||
/* | ||
* Copyright 2014, General Dynamics C4 Systems | ||
* Copyright 2021, Axel Heider <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
#include <config.h> | ||
#include <util.h> | ||
|
||
void NORETURN Arch_halt(void) | ||
{ | ||
/* Disable interrupts and loop over WFI. | ||
* ToDo: If the platform runs ATF, we could issue the PSCI call CPU_OFF. The | ||
* other nodes are still running, currently there is no way to halt | ||
* them also. ATF defines a PSCI call SYSTEM_OFF. | ||
*/ | ||
asm volatile("cpsid iaf"); | ||
for (;;) { | ||
wfi(); | ||
} | ||
|
||
UNREACHABLE(); | ||
} |
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
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,21 @@ | ||
/* | ||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | ||
* Copyright 2021, Axel Heider <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
void NORETURN Arch_halt(void) | ||
{ | ||
/* Disable interrupts and loop over WFI. | ||
* ToDo: If the platform runs ATF, we could issue the PSCI call CPU_OFF. The | ||
* other nodes are still running, currently there is no way to halt | ||
* them also. ATF defines a PSCI call SYSTEM_OFF that might be used. | ||
*/ | ||
MSR("daif", (DAIF_DEBUG | DAIF_SERROR | DAIF_IRQ | DAIF_FIRQ)); | ||
for (;;) { | ||
wfi(); | ||
} | ||
|
||
UNREACHABLE(); | ||
} |
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 |
---|---|---|
|
@@ -95,6 +95,7 @@ add_sources( | |
PREFIX src/arch/riscv | ||
CFILES | ||
c_traps.c | ||
halt.c | ||
idle.c | ||
api/faults.c | ||
api/benchmark.c | ||
|
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,22 @@ | ||
/* | ||
* Copyright 2015, 2016 Hesham Almatary <[email protected]>* | ||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | ||
* Copyright 2021, Axel Heider <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
#include <config.h> | ||
#include <util.h> | ||
#include <arch/sbi.h> | ||
|
||
void NORETURN Arch_halt(void) | ||
{ | ||
/* Use SBI to halt the system. | ||
* ToDo: Systems may not have an SBI, in this case disabling all interrupts | ||
* an looping over WFI is the best we can do. | ||
*/ | ||
sbi_shutdown(); | ||
|
||
UNREACHABLE(); | ||
} |
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 |
---|---|---|
|
@@ -365,6 +365,7 @@ add_sources( | |
PREFIX src/arch/x86 | ||
CFILES | ||
c_traps.c | ||
halt.c | ||
idle.c | ||
api/faults.c | ||
object/interrupt.c | ||
|
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,23 @@ | ||
/* | ||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | ||
* Copyright 2021, Axel Heider <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
#include <config.h> | ||
#include <util.h> | ||
|
||
void NORETURN Arch_halt(void) | ||
{ | ||
/* Disable interrupts and loop over HLT on this core. | ||
* ToDo: The other nodes are still running, currently there is no way to | ||
* halt them also. | ||
*/ | ||
asm volatile("cli"); | ||
for (;;) { | ||
asm volatile("hlt" ::: "memory"); | ||
} | ||
|
||
UNREACHABLE(); | ||
} |
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