Skip to content

Instantly share code, notes, and snippets.

@Coreforge
Coreforge / aarch64_trap.patch
Created November 20, 2023 17:01
a very quick and dirty adaptation of the arm32 alignment trap to fix one stp instruction for aarch64 code, for the rpi5. Rather printk-heavy
diff --git a/arch/arm64/include/asm/exception.h b/arch/arm64/include/asm/exception.h
index 19713d0f013b..792d0d0473ba 100644
--- a/arch/arm64/include/asm/exception.h
+++ b/arch/arm64/include/asm/exception.h
@@ -72,6 +72,7 @@ void do_sp_pc_abort(unsigned long addr, unsigned long esr, struct pt_regs *regs)
void bad_el0_sync(struct pt_regs *regs, int reason, unsigned long esr);
void do_cp15instr(unsigned long esr, struct pt_regs *regs);
int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs);
+int do_alignment_fixup(unsigned long addr, struct pt_regs *regs);
void do_el0_svc(struct pt_regs *regs);
This file has been truncated, but you can view the full file.
SteamVR System Report created Mon Aug 21 17:46:59 2023
<Report>
SteamVR Version: 1.26.7 (1690491041)
SteamVR Date: 2023-07-27
Steam: Public
Steam Branch:
Steam AppID: 250820
Tracking: lighthouse
OS: Linux version 5.15.0-69-generic (buildd@lcy02-amd64-080) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023
This file has been truncated, but you can view the full file.
SteamVR System Report created Mon Feb 27 15:10:19 2023
<Report>
SteamVR Version: 1.24.7 (1671750570)
SteamVR Date: 2022-12-23
Steam: Public
Steam Branch:
Steam AppID: 250820
Tracking: lighthouse
OS: Linux version 5.15.0-60-generic (buildd@lcy02-amd64-054) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023
@Coreforge
Coreforge / memcpy_unaligned.c
Last active April 20, 2023 18:41
A simple (and not optimal) library to fulfill memory access requirements for BCM2711 PCIe
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
//#include <stdlib.h>
void* memcpy(void* dst, const void* src, size_t n){
volatile char* vc_src = (char*)src;
volatile char* vc_dst = (char*)dst;
// copy byte by byte, hopefully avoiding any alignment issues
size_t pos = 0;
@Coreforge
Coreforge / fbdev.patch
Created March 3, 2021 23:29
patches for linux kernel to get a radeon gpu somewhat working on a raspberry pi
From 5f0a783bb2a819e53dea669128fc3508b4296210 Mon Sep 17 00:00:00 2001
From: Coreforge <BC549b@gmail.com>
Date: Thu, 4 Mar 2021 00:05:51 +0100
Subject: [PATCH 2/2] changes to fbdev to remove 64bit accesses (not replaced
properly yet, just temporary to get it to work. Should only cause every other
pixel to be missing though, not only every fourth one being present)
---
drivers/video/fbdev/core/cfbfillrect.c | 5 +++--
drivers/video/fbdev/core/cfbimgblt.c | 24 ++++++++++++++++--------