diff options
author | Ayke van Laethem <[email protected]> | 2020-08-06 23:28:45 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-08-31 09:02:23 +0200 |
commit | 3ee47a9c1b0787e567d7af0f661cf02b8b5d5aed (patch) | |
tree | a8447560da0c9059b5e163d1668b52996e9c4da6 /src/runtime/arch_xtensa.go | |
parent | da7db81087d8326c887391b58794d3bea1cae6bc (diff) | |
download | tinygo-3ee47a9c1b0787e567d7af0f661cf02b8b5d5aed.tar.gz tinygo-3ee47a9c1b0787e567d7af0f661cf02b8b5d5aed.zip |
esp: add support for the Espressif ESP32 chip
This is only very minimal support. More support (such as tinygo flash,
or peripheral access) should be added in later commits, to keep this one
focused.
Importantly, this commit changes the LLVM repo from llvm/llvm-project to
tinygo-org/llvm-project. This provides a little bit of versioning in
case something changes in the Espressif fork. If we want to upgrade to
LLVM 11 it's easy to switch back to llvm/llvm-project until Espressif
has updated their fork.
Diffstat (limited to 'src/runtime/arch_xtensa.go')
-rw-r--r-- | src/runtime/arch_xtensa.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/runtime/arch_xtensa.go b/src/runtime/arch_xtensa.go new file mode 100644 index 000000000..440521b6c --- /dev/null +++ b/src/runtime/arch_xtensa.go @@ -0,0 +1,15 @@ +// +build xtensa + +package runtime + +const GOARCH = "arm" // xtensa pretends to be arm + +// The bitness of the CPU (e.g. 8, 32, 64). +const TargetBits = 32 + +// Align on a word boundary. +func align(ptr uintptr) uintptr { + return (ptr + 3) &^ 3 +} + +func getCurrentStackPointer() uintptr |