Skip to content

Instantly share code, notes, and snippets.

@maquefel
maquefel / unmatched_locking_api.md
Created January 26, 2022 07:32
Locking API testsuite failing on Unmatched

[ 0.000000] Linux version 5.16.0-11358-gfa2e1ba3e9e3 (maquefel@redslave) (riscv64-unknown-linux-gnu-gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.37) #6 SMP Wed Jan 26 10:26:51 MSK 2022 [ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000 [ 0.000000] Machine model: SiFive HiFive Unmatched A00 [ 0.000000] earlycon: sifive0 at MMIO 0x0000000010010000 (options '') [ 0.000000] printk: bootconsole [sifive0] enabled [ 0.000000] efi: UEFI not found. [ 0.000000] Zone ranges: [ 0.000000] DMA32 [mem 0x0000000080200000-0x00000000ffffffff] [ 0.000000] Normal [mem 0x0000000100000000-0x000000047fffffff] [ 0.000000] Movable zone start for each node

@maquefel
maquefel / 0001-board-sifive-spl-boot-from-ram.patch
Created November 26, 2021 10:03
Unmatche U-Boot RAM SPL patch
From 7bc59a1da11d7b7c2f1f9669ac773e2d11230f12 Mon Sep 17 00:00:00 2001
From: Nikita Shubin <n.shubin@yadro.com>
Date: Wed, 21 Jul 2021 04:46:40 +0000
Subject: [PATCH] board: sifive: spl: boot from ram
---
board/sifive/hifive_unmatched_fu740/spl.c | 2 +
.../sifive_hifive_unmatched_fu740_defconfig | 38 +++++++------------
2 files changed, 15 insertions(+), 25 deletions(-)
@maquefel
maquefel / continuous_podman_cheat_sheet.md
Last active October 31, 2023 21:25
Continuous podman cheat sheet

Continuous podman cheat sheet

Cross-build container image.

podman image import <new_name>

$ podman image import small-rootfs-for-build.tar.xz container-small-x86_64

$ podman images
@maquefel
maquefel / main.c
Created July 19, 2019 09:46
main.c template MIT
// SPDX-License-Identifier: MIT
/*
Copyright (c) 2019 Nikita Shubin <me@maquefel.me>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@maquefel
maquefel / LICENSE
Created December 14, 2018 11:27 — forked from yamnikov-oleg/LICENSE
Shared (interprocess) mutexes on Linux
MIT License
Copyright (c) 2018 Oleg Yamnikov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
#ifndef __LIST_H
#define __LIST_H
/* This file is from Linux Kernel (include/linux/list.h)
* and modified by simply removing hardware prefetching of list items.
* Here by copyright, credits attributed to wherever they belong.
* Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu)
*/
/*
* Simple doubly linked list implementation.
*
!/bin/bash
# QEMU name and PID
OPTS="-name windows-10-pro"
OPTS="$OPTS -pidfile /tmp/windows-10-pro.pid"
# Processor
OPTS="$OPTS -cpu host,kvm=off"
OPTS="$OPTS -smp 8,sockets=1,cores=4,threads=2"
@maquefel
maquefel / windows10qemu.sh
Created November 22, 2017 06:32 — forked from Manouchehri/windows10qemu.sh
Running Windows 10 in a UEFI enabled QEMU environment with KVM.
# Installing
qemu-system-x86_64 -bios /usr/share/ovmf/ovmf_x64.bin -enable-kvm -cpu host -smp 4 -m 2048 -cdrom ~/Downloads/Win10_English_x64.iso -net nic,model=virtio -net user -drive file=~/vm/win10.hd.img.raw,format=raw,if=virtio -vga qxl -drive file=~/Downloads/virtio-win-0.1.105.iso,index=1,media=cdrom
# Running
qemu-system-x86_64 -bios /usr/share/ovmf/ovmf_x64.bin -enable-kvm -cpu host -smp 4 -m 4096 -net nic,model=virtio -net user -drive file=~/vm/win10.hd.img.raw,format=raw,if=virtio -vga qxl -usbdevice tablet -rtc base=utc
@maquefel
maquefel / container_of_test.c
Created August 25, 2017 09:41
container_of gist
#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
struct inner {
static inline int printbinary(char *buf, unsigned long x, int nbits)
{
unsigned long mask = 1UL << (nbits - 1);
while (mask != 0) {
*buf++ = (mask & x ? '1' : '0');
mask >>= 1;
}
*buf = '\0';
return nbits;