aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2020-10-08 20:14:42 +0200
committerjohannst <johannes.stoelp@gmail.com>2020-10-08 20:14:42 +0200
commit3b4a6097dee760d22eecd97ebe041c69da6b056a (patch)
treebf1536956a327c77c0975d1a6a0d04e230fd0aad
parent8d2529404437262c5bf0521063221906aeecfb22 (diff)
downloadmatcha-threads-3b4a6097dee760d22eecd97ebe041c69da6b056a.tar.gz
matcha-threads-3b4a6097dee760d22eecd97ebe041c69da6b056a.zip
remove incorrect const
-rw-r--r--lib/arch/arm64/api.h4
-rw-r--r--lib/arch/arm64/init_stack.cc2
-rw-r--r--lib/arch/arm64/yield.s6
-rw-r--r--lib/arch/x86_64/api.h4
-rw-r--r--lib/arch/x86_64/init_stack.cc2
-rw-r--r--lib/arch/x86_64/yield.s6
-rw-r--r--lib/executor.cc2
-rw-r--r--lib/executor.h2
8 files changed, 14 insertions, 14 deletions
diff --git a/lib/arch/arm64/api.h b/lib/arch/arm64/api.h
index b2babc9..729bd1a 100644
--- a/lib/arch/arm64/api.h
+++ b/lib/arch/arm64/api.h
@@ -2,5 +2,5 @@
#pragma once
-extern "C" void yield(const void* new_stack, void* const* old_stack);
-void* init_stack(void* stack_ptr, void (*entry)(void*), void* ctx);
+extern "C" void yield(const void* new_stack, void** old_stack);
+void* init_stack(void* stack_ptr, void (*entry)(void*), const void* ctx);
diff --git a/lib/arch/arm64/init_stack.cc b/lib/arch/arm64/init_stack.cc
index b28d957..f00320b 100644
--- a/lib/arch/arm64/init_stack.cc
+++ b/lib/arch/arm64/init_stack.cc
@@ -3,7 +3,7 @@
extern "C" void thread_create();
-void* init_stack(void* stack_ptr, void (*entry)(void*), void* ctx) {
+void* init_stack(void* stack_ptr, void (*entry)(void*), const void* ctx) {
static_assert(sizeof(uint64_t) == sizeof(std::uintptr_t), "Pointer must be 64bit!");
// Setup initial stack frame which will be popped when yielding
diff --git a/lib/arch/arm64/yield.s b/lib/arch/arm64/yield.s
index 63a4051..5f427bb 100644
--- a/lib/arch/arm64/yield.s
+++ b/lib/arch/arm64/yield.s
@@ -3,9 +3,9 @@
.arch armv8-a
.section .text, "ax", @progbits
- # extern "C" void yield(const void* new_stack, void* const* old_stack);
- # ^^^^^^^^^ ^^^^^^^^^
- # rdi rsi
+ # extern "C" void yield(const void* new_stack, void** old_stack);
+ # ^^^^^^^^^ ^^^^^^^^^
+ # x0 x1
.global yield
.type yield, @function
yield:
diff --git a/lib/arch/x86_64/api.h b/lib/arch/x86_64/api.h
index b2babc9..729bd1a 100644
--- a/lib/arch/x86_64/api.h
+++ b/lib/arch/x86_64/api.h
@@ -2,5 +2,5 @@
#pragma once
-extern "C" void yield(const void* new_stack, void* const* old_stack);
-void* init_stack(void* stack_ptr, void (*entry)(void*), void* ctx);
+extern "C" void yield(const void* new_stack, void** old_stack);
+void* init_stack(void* stack_ptr, void (*entry)(void*), const void* ctx);
diff --git a/lib/arch/x86_64/init_stack.cc b/lib/arch/x86_64/init_stack.cc
index 748fb56..c249bc8 100644
--- a/lib/arch/x86_64/init_stack.cc
+++ b/lib/arch/x86_64/init_stack.cc
@@ -3,7 +3,7 @@
extern "C" void thread_create();
-void* init_stack(void* stack_ptr, void (*entry)(void*), void* ctx) {
+void* init_stack(void* stack_ptr, void (*entry)(void*), const void* ctx) {
static_assert(sizeof(uint64_t) == sizeof(std::uintptr_t), "Pointer must be 64bit!");
// Setup initial stack frame which will be popped when yielding
diff --git a/lib/arch/x86_64/yield.s b/lib/arch/x86_64/yield.s
index d40bcd7..2c5f1d6 100644
--- a/lib/arch/x86_64/yield.s
+++ b/lib/arch/x86_64/yield.s
@@ -3,9 +3,9 @@
.intel_syntax noprefix
.section .text, "ax", @progbits
- # extern "C" void yield(const void* new_stack, void* const* old_stack);
- # ^^^^^^^^^ ^^^^^^^^^
- # rdi rsi
+ # extern "C" void yield(const void* new_stack, void** old_stack);
+ # ^^^^^^^^^ ^^^^^^^^^
+ # rdi rsi
.global yield
.type yield, @function
yield:
diff --git a/lib/executor.cc b/lib/executor.cc
index 774354f..bfc268a 100644
--- a/lib/executor.cc
+++ b/lib/executor.cc
@@ -26,7 +26,7 @@ namespace nMatcha {
}
}
- void Executor::yield_to(const Thread* t) const {
+ void Executor::yield_to(const Thread* t) {
::yield(t->mStackPtr, &mStackPtr);
}
} // namespace nMatcha
diff --git a/lib/executor.h b/lib/executor.h
index 0f2eca9..ac007b1 100644
--- a/lib/executor.h
+++ b/lib/executor.h
@@ -34,6 +34,6 @@ namespace nMatcha {
void* mStackPtr;
std::forward_list<std::unique_ptr<Thread>> mThreads;
- void yield_to(const Thread* t) const;
+ void yield_to(const Thread* t);
};
} // namespace nMatcha