Skip to content

Instantly share code, notes, and snippets.

@nuta
nuta / README.md
Last active December 2, 2020 19:22
(Incomplete) Attempt to port Flutter to Resea

GUI (Flutter)

diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn
index 7868f0c14..bcb2c88ec 100644
--- a/shell/platform/embedder/BUILD.gn
+++ b/shell/platform/embedder/BUILD.gn
@@ -252,6 +252,24 @@ shared_library("flutter_engine_library") {
   public_configs = [ "//flutter:config" ]
 }
/// ANSI 256 colors.
/// https://en.wikipedia.org/wiki/ANSI_escape_code
const COLORS256: [Rgb; 256] = [
Rgb(0, 0, 0),
Rgb(128, 0, 0),
Rgb(0, 128, 0),
Rgb(128, 128, 0),
Rgb(0, 0, 128),
Rgb(128, 0, 128),
Rgb(0, 128, 128),
diff --git a/Kconfig b/Kconfig
index 30b56ec..46efaac 100644
--- a/Kconfig
+++ b/Kconfig
@@ -4,6 +4,8 @@ choice
prompt "Target CPU architecture"
config ARCH_X64
bool "x86_64"
+ config ARCH_ARM64
+ bool "Raspberry Pi 3 (AArch64)"
@nuta
nuta / demo.gif
Last active March 28, 2020 16:30
demo.gif
#!/usr/bin/env python3
import argparse
import string
def parse(bdf):
font = { "glyphs": {} }
name = None
glyph = None
lines = list(reversed(bdf.splitlines()))
while len(lines) > 0:
@nuta
nuta / lldb.c
Created March 7, 2020 12:21
lldb stub
//
// LLDB Stub.
//
enum lldb_input_state {
LLDB_INPUT_BEGIN,
LLDB_INPUT_DATA,
LLDB_INPUT_CHECKSUM1,
LLDB_INPUT_CHECKSUM2,
};
diff --git a/kernel/arch/x64/arch.h b/kernel/arch/x64/arch.h
index eccd5bb..d766707 100644
--- a/kernel/arch/x64/arch.h
+++ b/kernel/arch/x64/arch.h
@@ -43,4 +43,16 @@ static inline paddr_t into_paddr(void *addr) {
return ((vaddr_t) addr - KERNEL_BASE_ADDR);
}
+static inline unsigned get_cpu_id(void) {
+ return *((volatile uint32_t *) from_paddr(0xfee00020)) >> 24;
diff --git a/llvm/test/tools/llvm-objcopy/MachO/copy-relocations.test b/llvm/test/tools/llvm-objcopy/MachO/copy-relocations.test
new file mode 100644
index 00000000000..8bfac24ee93
--- /dev/null
+++ b/llvm/test/tools/llvm-objcopy/MachO/copy-relocations.test
@@ -0,0 +1,111 @@
+## Show that llvm-objcopy copies relocation entries where r_extern=0.
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy %t %t2
+# RUN: cmp %t %t2
diff --git a/kernel/arch/x64/include/arch_types.h b/kernel/arch/x64/include/arch_types.h
index 4bed372..289073b 100644
--- a/kernel/arch/x64/include/arch_types.h
+++ b/kernel/arch/x64/include/arch_types.h
@@ -90,7 +90,8 @@ static inline vaddr_t arch_get_stack_pointer(void) {
static inline struct thread *get_current_thread(void) {
struct thread *thread;
- __asm__ __volatile__("rdgsbase %0" : "=r"(thread));
+ // __asm__ __volatile__("rdgsbase %0" : "=r"(thread));