Skip to content

Instantly share code, notes, and snippets.

View classilla's full-sized avatar
🕶️
DEAL WITH IT.

Cameron Kaiser classilla

🕶️
DEAL WITH IT.
View GitHub Profile
@classilla
classilla / firefox-pgo.diff
Last active April 8, 2024 14:33
PGO fixes and livability improvements for LTO in Firefox on ppc64le Linux. Read web page first! -- https://www.talospace.com/2024/03/firefox-124-on-power.html
diff -r ac0e1ee8218f build/moz.configure/lto-pgo.configure
--- a/build/moz.configure/lto-pgo.configure Tue Feb 20 13:51:00 2024 +0000
+++ b/build/moz.configure/lto-pgo.configure Sat Feb 24 22:47:17 2024 -0800
@@ -2,17 +2,17 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# PGO
@classilla
classilla / kvmppc_osx_bzero32_patcher.diff
Created August 25, 2018 02:24
Patch to apply to KVM-PR PPC sources for improved Mac OS X performance on machines with emulated dcbz.
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index ca160395..8f4ba2bc 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -23,16 +23,17 @@
#include <linux/export.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <asm/reg.h>
diff -r 4cb22dd449d6 third_party/libwebrtc/moz.build
--- a/third_party/libwebrtc/moz.build Mon Aug 07 08:16:50 2023 +0000
+++ b/third_party/libwebrtc/moz.build Tue Aug 08 13:57:02 2023 -0700
@@ -603,16 +603,26 @@
"/third_party/libwebrtc/modules/desktop_capture/primitives_gn",
"/third_party/libwebrtc/modules/portal/portal_gn",
"/third_party/libwebrtc/third_party/drm/drm_gn",
"/third_party/libwebrtc/third_party/gbm/gbm_gn",
"/third_party/libwebrtc/third_party/libepoxy/libepoxy_gn",
"/third_party/libwebrtc/third_party/pipewire/pipewire_gn"
@classilla
classilla / kvmppc_osx_base_patches.diff
Created August 25, 2018 02:35
Base patches for KVMPPC under kernel 4.17.x and earlier to enable OS X on POWER9.
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 97d4a112..2267e9b4 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -74,18 +74,21 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
{ "pthru_bad_aff", VCPU_STAT(pthru_bad_aff) },
{ NULL }
};
void kvmppc_unfixup_split_real(struct kvm_vcpu *vcpu)
@classilla
classilla / no-reg-6502-bf.pl
Last active January 4, 2023 02:07
Minimal Brainf*ck compiler that turns BF into 6502 assembly but is Turing complete without A, X or Y. http://oldvcr.blogspot.com/2023/01/the-mos-6502-is-mostly-turing-complete.html
#!/usr/bin/perl -s
#
# Takes BF, emits 6502 that only clobbers PC, S, and the N and V flags
# Requires an assembler (I recommend xa65)
#
# Cameron Kaiser
# Public domain
# http://oldvcr.blogspot.com/2023/01/the-mos-6502-is-mostly-turing-complete.html
#
@classilla
classilla / qemu-pnv-kvm.diff
Created June 22, 2020 04:09
A desperate attempt to get PowerNV KVM acceleration working. See if you can triumph where I have failed.
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index c9cb6fa3..c1f43310 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -23,16 +23,17 @@
#include "qapi/error.h"
#include "sysemu/sysemu.h"
#include "sysemu/numa.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
diff -r 3a74cc97e160 dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp Fri Apr 01 19:35:34 2022 +0000
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp Thu Apr 07 20:21:34 2022 -0700
@@ -809,17 +809,17 @@
if (!PrepareFrame()) {
NS_WARNING("FFmpeg decoder failed to allocate frame.");
return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__);
}
# ifdef MOZ_WAYLAND_USE_VAAPI
@classilla
classilla / wordle.s
Last active March 1, 2022 21:20
Sorta-Wordle for the MOS/Commodore KIM-1, in 100% 6502 assembly language. Just 1K! https://oldvcr.blogspot.com/2022/02/kimdle-sorta-wordle-for-kim-1.html
.word $4200
* = $0200
; kimdle version 3
; guess letters a-f and 0 = o 1 = i 5 = s
; assembles into a KIMplement-compatible binary with xa65
; (C)2022 cameron kaiser
; all rights reserved
@classilla
classilla / gm1356.c
Created December 20, 2021 05:49
Linux code for reading a GM1356 USB-based decibel sound monitor. See https://oldvcr.blogspot.com/2021/12/monitoring-vintage-server-room-and.html
/*
(C)2020-1 Cameron Kaiser, ckaiser@floodgap.com
All rights reserved.
Distributed under the Floodgap Free Software License.
Credit to https://github.com/dobra-noc/gm1356/blob/master/PROTOCOL.md for the
original protocol description.
Linux:
@classilla
classilla / thum.c
Created December 20, 2021 05:49
OS X (10.4+) and Linux code for reading a THUM USB-based temperature/humidity monitor. See https://oldvcr.blogspot.com/2021/12/monitoring-vintage-server-room-and.html
/*
(C)2020-1 Cameron Kaiser, ckaiser@floodgap.com
All rights reserved.
Distributed under the Floodgap Free Software License.
Linux:
gcc -o thum thum.c -lhid -lusb
Mac OS X:
gcc -o thum thum.c -framework CoreFoundation -framework IOKit