-
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.
The idle thread does not have any stack, thus implementing the function in assembler avoids convincing the compiler not to use any stack for a C function. Signed-off-by: Axel Heider <[email protected]>
- Loading branch information
Showing
14 changed files
with
62 additions
and
93 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
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,20 @@ | ||
/* | ||
* Copyright 2014, General Dynamics C4 Systems | ||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | ||
* Copyright 2021, Axel Heider <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
#include <machine/assembler.h> | ||
|
||
/* The idle thread does not have any stack, thus its simple loop is implemented | ||
* in assembly. That avoids having to find ways to convince the compiler not to | ||
* ever generate any code that uses the stack. There seems no clean and portable | ||
* way for this, and there is no guarantee any solution in C will always work. | ||
*/ | ||
.section .text, "ax" | ||
BEGIN_FUNC(idle_thread) | ||
1: wfi | ||
b 1b | ||
END_FUNC(idle_thread) |
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,20 @@ | ||
/* | ||
* 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 <machine/assembler.h> | ||
|
||
/* The idle thread does not have any stack, thus its simple loop is implemented | ||
* in assembly. That avoids having to find ways to convince the compiler not to | ||
* ever generate any code that uses the stack. There seems no clean and portable | ||
* way for this, and there is no guarantee any solution in C will always work. | ||
*/ | ||
.section .text, "ax" | ||
BEGIN_FUNC(idle_thread) | ||
1: wfi | ||
j 1b | ||
END_FUNC(idle_thread) |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
/* | ||
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) | ||
* Copyright 2021, Axel Heider <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-only | ||
*/ | ||
|
||
#include <machine/assembler.h> | ||
|
||
/* The idle thread does not have any stack, thus its simple loop is implemented | ||
* in assembly. That avoids having to find ways to convince the compiler not to | ||
* ever generate any code that uses the stack. There seems no clean and portable | ||
* way for this, and there is no guarantee any solution in C will always work. | ||
*/ | ||
.section .text, "ax" | ||
BEGIN_FUNC(idle_thread) | ||
1: hlt | ||
jmp 1b | ||
END_FUNC(idle_thread) |
This file was deleted.
Oops, something went wrong.