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
Pmu = 0x504d55, | |
// PMU function IDs. | |
pub const SBI_PMU_NUM_COUNTERS: usize = 0x00; | |
pub const SBI_PMU_COUNTER_CONFIG_MATCHING: usize = 0x02; | |
pub const SBI_PMU_COUNTER_START: usize = 0x03; | |
pub const SBI_PMU_COUNTER_STOP: usize = 0x04; | |
pub const SBI_PMU_COUNTER_FW_READ: usize = 0x05; | |
pub const SBI_PMU_COUNTER_FW_READ_HI: usize = 0x06; |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define _assert_fail(msg, ...) do { puts(msg); exit(1); } while (0) | |
#define CONST __attribute__((__const__)) | |
#define seL4_Null ((void*)0) | |
#define LIBSEL4_INLINE_FUNC static inline | |
typedef uint32_t seL4_CPtr; | |
typedef uint32_t seL4_Word; |
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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define _assert_fail(msg, ...) do { puts(msg); exit(1); } while (0) | |
#define CONST __attribute__((__const__)) | |
#define seL4_Null ((void*)0) | |
#define LIBSEL4_INLINE_FUNC static inline | |
typedef uint32_t seL4_CPtr; | |
typedef uint32_t seL4_Word; |
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
#[test] | |
fn grapheme_iter() { | |
let text = "a👩🔬"; | |
let mut c = unicode_segmentation::GraphemeCursor::new(text.len(), text.len(), true); | |
dbg!(text.len()); | |
dbg!(text.char_indices().map(|(i, c)| (i, c)).collect::<Vec<_>>()); | |
assert_eq!( | |
c.prev_boundary(&text[(text.len() - 4)..], text.len() - 4), | |
Err(GraphemeIncomplete::PrevChunk) |
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
Booting Resea v0.9.0 (dc57ce1)... | |
[kernel] Booted CPU #0 | |
[vm] ready | |
[benchmark_server] starting benchmark server... | |
[benchmark] starting IPC benchmark... | |
{"type":"metric","key":"reading cycle counter","value":30} | |
[benchmark] reading cycle counter: cycles: avg=31, min=30, max=376 | |
[benchmark] reading cycle counter: l1d_cache_access: avg=0, min=0, max=0 | |
[benchmark] reading cycle counter: l2d_cache_access: avg=0, min=0, max=0 | |
[benchmark] reading cycle counter: mem_access: avg=10, min=10, max=174 |
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
use core::{marker::PhantomData, ptr::NonNull}; | |
use memoffset::offset_of; | |
/// An intrusive doubly-linked list node. | |
pub struct ListNode<T> { | |
/// The previous node. It points to itself if the list has only sigle entry. | |
prev: NonNull<ListNode<T>>, | |
/// The next node. It points to itself if the list has only sigle entry. | |
next: NonNull<ListNode<T>>, | |
_pd: PhantomData<T>, |
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
use std::cmp::min; | |
use std::ops; | |
use std::slice; | |
pub trait Interval: Ord + Clone { | |
fn is_empty(&self) -> bool; | |
fn includes(&self, other: &Self) -> bool; | |
fn overlaps_with(&self, other: &Self) -> bool; | |
/// ```text | |
/// self: ...xxxx.... |
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
FROM ubuntu:latest | |
RUN apt update -y && apt install -y musl-tools | |
ADD hello.c /hello.c | |
RUN musl-gcc -static hello.c -o /hello | |
RUN mkdir /empty_dir | |
FROM scratch | |
WORKDIR / | |
COPY --from=0 /hello /hello | |
COPY --from=0 /empty_dir /tmp |
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
wget http://bochs.sourceforge.net/svn-snapshot/bochs-20210227.tar.gz | |
./configure --enable-x86-debugger --enable-x86-64 --enable-cpu-level=6 --enable-readline \ | |
--enable-smp --disable-show-ips --enable-all-optimizations --with-nogui --enable-logging --enable-debugger \ | |
--enable-usb --enable-e1000 --enable-cdrom --enable-option-checking --enable-avx --enable-evex |
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
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/x86 5.10.0-rc7 Kernel Configuration | |
# | |
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0" | |
CONFIG_CC_IS_GCC=y | |
CONFIG_GCC_VERSION=90300 | |
CONFIG_LD_VERSION=234000000 | |
CONFIG_CLANG_VERSION=0 | |
CONFIG_LLD_VERSION=0 |
NewerOlder