%3 = atomicrmw volatile add i64* %2, i64 %0 acq_rel, align 8
lock xaddq %rdi, -8(%rsp)
# Note: just addq if the result operand is unused
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <assert.h> | |
#include <signal.h> | |
#include <event2/event.h> | |
#include <event2/bufferevent.h> | |
#include <event2/buffer.h> | |
#include <event2/thread.h> |
# Crash reproducer for Lemon clang version 13.0.0 (https://github.com/LemonOSProject/llvm-project.git 841704471e60b2d2a8a56c2050abd3047a1a21be) | |
# Driver args: "--driver-mode=g++" "-I" "Kernel/kernel.sys.p" "-I" "Kernel/" "-I" "../Kernel" "-I" "../Kernel/include" "-I" "../Kernel/include/Arch/x86_64" "-I" "../subprojects/lai/include" "-I" "../subprojects/frigg/include" "-I" "../subprojects/cxxshim/stage2/include" "-Xclang" "-fcolor-diagnostics" "-pipe" "-D" "_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wnon-virtual-dtor" "-Wextra" "-Werror" "-std=c++2a" "-g" "-msse3" "-mssse3" "-msse4.1" "-msse4.2" "-mpopcnt" "-mcx16" "-msahf" "-Wno-write-strings" "-Wno-unused-parameter" "-Wno-sign-compare" "-D" "Lemon64" "-ffreestanding" "-nostdlib" "-mcmodel=large" "-mno-red-zone" "-fno-pic" "-mno-mmx" "-mno-sse" "-mno-sse2" "-fno-stack-protector" "-fno-builtin" "-finline-functions" "-fno-exceptions" "-fno-rtti" "-Wno-deprecated-volatile" "-Wno-non-c-typedef-for-linkage" "-MD" "-MQ" "Kernel/kernel.sys.p/src_Objects_Process |
# 1 "../Kernel/src/Objects/Process.cpp" | |
# 1 "<built-in>" 1 | |
# 1 "<built-in>" 3 | |
# 403 "<built-in>" 3 | |
# 1 "<command line>" 1 | |
# 1 "<built-in>" 2 | |
# 1 "../Kernel/src/Objects/Process.cpp" 2 | |
# 1 "../Kernel/include/Objects/Process.h" 1 | |
#include <iostream> | |
#include <llvm/IR/DataLayout.h> | |
#include <llvm/IR/LLVMContext.h> | |
#include <string> | |
int main() { | |
llvm::DataLayout datalayout("e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"); // mips64el data layout | |
llvm::LLVMContext llvm; | |
llvm::IntegerType *i24 = llvm::IntegerType::get(llvm, 24); | |
llvm::IntegerType *i32 = llvm::IntegerType::get(llvm, 32); |
#include <iostream> | |
#include <map> | |
int main() { | |
int x = 0, y = 0; | |
enum Direction {Up, Right, Down, Left}; | |
Direction direction = Up; | |
int max_extent = 1; | |
int extent = 0; | |
std::map<Direction, const char *> dirs {{Up, "up"}, {Right, "right"}, {Down, "down"}, {Left, "left"}}; |
#include <iostream> | |
#include <optional> | |
#include <string> | |
struct Delete { | |
std::string str = "delete"; | |
Delete() = delete; | |
Delete(const Delete &) = delete; | |
Delete(Delete &&) = delete; | |
Delete(const std::string &str_): str(str_) { |
unsigned int get_core_id() { | |
unsigned int ebx; | |
__asm__("cpuid" : "=b" (ebx) : "a" (1)); | |
// When you call cpuid with eax=1, the upper 8 bits of ebx contain the CPU ID. | |
return ebx >> 24; | |
} | |
unsigned int get_x2apic_id() { | |
unsigned int edx; | |
// When calling cpuid with eax=0xb, it seems you need to have ebx=0 to prevent a segfault. |
#!/bin/bash | |
enable_hmargins() { echo -ne "\x1b[?69h"; } | |
disable_hmargins() { echo -ne "\x1b[?69l"; } | |
hmargins() { echo -ne "\x1b[$1;$2s"; } # left, right | |
vmargins() { echo -ne "\x1b[$1;$2r"; } # top, bottom | |
origin_on() { echo -ne "\x1b[?6h"; } | |
origin_off() { echo -ne "\x1b[?6l"; } | |
scroll_up() { echo -ne "\x1b[$1S"; } | |
scroll_down() { echo -ne "\x1b[$1T"; } |
#!/bin/bash | |
enable_hmargins() { echo -ne "\x1b[?69h"; } | |
disable_hmargins() { echo -ne "\x1b[?69l"; } | |
hmargins() { echo -ne "\x1b[$1;$2s"; } # left, right | |
vmargins() { echo -ne "\x1b[$1;$2r"; } # top, bottom | |
origin_on() { echo -ne "\x1b[?6h"; } | |
origin_off() { echo -ne "\x1b[?6l"; } | |
scroll_up() { echo -ne "\x1b[$1S"; } | |
scroll_down() { echo -ne "\x1b[$1T"; } |