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
$ make CROSS_COMPILE=riscv64-unknown-elf- PLATFORM=qemu/virt | |
CC lib/sbi/riscv_asm.o | |
CC lib/sbi/riscv_atomic.o | |
AS lib/sbi/riscv_hardfp.o | |
CC lib/sbi/riscv_locks.o | |
CC lib/sbi/riscv_unpriv.o | |
CC lib/sbi/sbi_console.o | |
CC lib/sbi/sbi_ecall.o | |
CC lib/sbi/sbi_emulate_csr.o | |
CC lib/sbi/sbi_fifo.o |
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
// https://www.hackerrank.com/challenges/count-triplets-1/problem | |
#include <assert.h> | |
#include <ctype.h> | |
#include <limits.h> | |
#include <math.h> | |
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
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
```sh | |
make PLATFORM=qemu/virt | |
qemu-system-riscv64 -M virt -m 256M -nographic -kernel build/platform/qemu/virt/firmware/fw_payload.elf | |
``` | |
qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware. | |
qemu-system-riscv64: warning: This default will change in a future QEMU release. Please use the -bios option to avoid breakages when this happens. | |
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details. | |
OpenSBI v0.5 (Oct 13 2019 13:07:42) |
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
$ tree ../linux-stable/arch/riscv/boot | |
../linux-stable/arch/riscv/boot | |
├── Image | |
├── Image.gz | |
├── Makefile | |
├── dts | |
│ ├── Makefile | |
│ └── sifive | |
│ ├── Makefile | |
│ ├── fu540-c000.dtsi |
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
qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware. | |
qemu-system-riscv64: warning: This default will change in a future QEMU release. Please use the -bios option to avoid breakages when this happens. | |
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details. | |
OpenSBI v0.5 (Oct 14 2019 06:54:36) | |
____ _____ ____ _____ | |
/ __ \ / ____| _ \_ _| | |
| | | |_ __ ___ _ __ | (___ | |_) || | | |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | | | |
| |__| | |_) | __/ | | |____) | |_) || |_ |
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
alloc_page: | |
- alloc_pages(gfp_mask, 0) | |
- alloc_pages_node(numa_node_id()=0, gfp_mask, order=0) | |
- __alloc_pages(gfp_mask, order, node_data[0]->node_zonelists + (gfp_mask & GFP_ZONEMASK)); |
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
// assume that ELEVATOR_NO_MERGE | |
static int __make_request(request_queue_t *q, struct bio *bio) | |
{ | |
struct request *req, *freereq = NULL; | |
int el_ret, rw, nr_sectors, cur_nr_sectors, barrier, err; | |
sector_t sector; | |
sector = bio->bi_sector; | |
nr_sectors = bio_sectors(bio); | |
cur_nr_sectors = bio_cur_sectors(bio); |
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
// I/O for the block layer | |
struct bio { | |
sector_t bi_sector; | |
struct bio *bi_next; /* request queue link */ | |
struct block_device *bi_bdev; | |
unsigned long bi_flags; /* status, command, etc */ | |
unsigned long bi_rw; /* bottom bits READ/WRITE, | |
* top bits priority | |
*/ |
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
$ ag "tty_operations" | |
net/irda/ircomm/ircomm_tty.c | |
83:static struct tty_operations ops = { | |
net/bluetooth/rfcomm/tty.c | |
877:static struct tty_operations rfcomm_ops = { | |
drivers/sbus/char/aurora.c | |
2200:static struct tty_operations aurora_ops = { |
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
struct as_rq { | |
/* | |
* rbtree index, key is the starting offset | |
*/ | |
struct rb_node rb_node; | |
sector_t rb_key; | |
struct request *request; | |
struct io_context *io_context; /* The submitting task */ |