Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/gc/boehm.cr b/src/gc/boehm.cr
index bc05474..d692a28 100644
--- a/src/gc/boehm.cr
+++ b/src/gc/boehm.cr
@@ -16,6 +16,8 @@ lib LibGC
type Finalizer = Void*, Void* ->
fun register_finalizer = GC_register_finalizer(obj : Void*, fn : Finalizer, cd : Void*, ofn : Finalizer*, ocd : Void**)
fun invoke_finalizers = GC_invoke_finalizers : Int32
+ fun set_finalize_on_demand = GC_set_finalize_on_demand(value : Int32)
+ fun get_finalize_on_demand = GC_get_finalize_on_demand : Int32
@ssvb
ssvb / convert-16bpp-to-32bpp.c
Created March 3, 2015 23:31
Conversion from 16bpp to 32bpp
/*
* Copyright (C) 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
*
* 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:
*
@ssvb
ssvb / gist:4bc7ab81130fdc88ee22
Created February 27, 2015 16:15
fel boot serial console log
U-Boot 2015.04-rc1-00877-ga7ce8e8 (Feb 27 2015 - 17:56:08) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 2 GiB
MMC: SUNXI SD/MMC: 0
Card did not respond to voltage select!
MMC init failed
Using default environment
@ssvb
ssvb / gist:4d4e91f30cb646ca3c4a
Created January 25, 2015 21:53
astar_mid756 u-boot lcd settings
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:15,ri:211,up:10,lo:22,hs:30,vs:13,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
@ssvb
ssvb / gist:09c55a6f07cbed8abd38
Last active August 29, 2015 14:12
fex -> board_name
'cubieboard' -> 'Cubietech_Cubieboard'
'iteaduino_plus_a10' -> 'Itead_Iteaduino_Plus'
'pcduino' -> 'LinkSprite_pcDuino'
'marsboard_a10' -> 'MarsBoard_A10'
'hackberry' -> 'Miniand_Hackberry'
'a10-olinuxino-lime' -> 'Olimex_A10-OLinuXino-Lime'
'coby_mid7042' -> 'Coby_MID7042'
'zatab' -> 'Gemei_G9'
'hyundai_a7' -> 'Hyundai_A7'
'hyundai_a7hd' -> 'Hyundai_A7HD'
@ssvb
ssvb / test.S
Created December 23, 2014 13:07
Test of the radare2 graphviz graphs
/* gcc -c test.S */
#ifdef __arm__
.syntax unified
#define sub subs
#define jz beq
#define jmp b
#define ret bx lr
@ssvb
ssvb / gist:1234b339474de8bb3d8a
Created December 4, 2014 15:06
1680x1050 EDID info
[ 63.004] (II) NOUVEAU(1): EDID for output VGA-1
[ 63.004] (II) NOUVEAU(1): Manufacturer: GSM Model: 4e47 Serial#: 379039
[ 63.004] (II) NOUVEAU(1): Year: 2007 Week: 2
[ 63.004] (II) NOUVEAU(1): EDID Version: 1.3
[ 63.004] (II) NOUVEAU(1): Analog Display Input, Input Voltage Level: 0.700/0.700 V
[ 63.004] (II) NOUVEAU(1): Sync: Separate SyncOnGreen
[ 63.004] (II) NOUVEAU(1): Max Image Size [cm]: horiz.: 43 vert.: 27
[ 63.004] (II) NOUVEAU(1): Gamma: 2.20
[ 63.004] (II) NOUVEAU(1): DPMS capabilities: StandBy Suspend Off; RGB/Color Display
[ 63.004] (II) NOUVEAU(1): First detailed timing is preferred mode
cryptsetup -v --cipher serpent-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random luksFormat /dev/sdb
From: http://www.semanticlab.net/index.php/Encryption_hacks
crossdev --l 1.19.0 -oO /var/overlays/crossdev --without-headers --g 4.7.2 --genv 'USE="-fortran -mudflap -nls -openmp multilib" EXTRA_ECONF="--with-mode=thumb --with-cpu=cortex-m4 --with-float=hard --with-fpu=fpv4-sp-d16"' --b 2.22-r1 -s4 -t arm-none-eabi"
--genv 'USE="-fortran -mudflap -nls -openmp multilib" EXTRA_ECONF="--with-cpu=cortex-a8 --with-float=hard --with-fpu=neon"' -s4 -t armv7a-hardfloat-linux-gnueabi
crossdev --binutils 2.23.2 --kernel 3.13 --libc 2.19-r1 --gcc 4.8.2 --genv 'USE="-fortran -mudflap -nls -openmp multilib" EXTRA_ECONF="--with-cpu=cortex-a8 --with-float=hard"' -t arm-none-linux-gnueabi
@ssvb
ssvb / 0001-HACK-Enable-MUSB-CDC_COMPOSITE-in-sun7i-defconfig.patch
Created October 7, 2014 20:40
0001-HACK-Enable-MUSB-CDC_COMPOSITE-in-sun7i-defconfig.patch
From f45b37f97e552654bdd01df7cccff1f1cf2a039d Mon Sep 17 00:00:00 2001
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Date: Tue, 7 Oct 2014 00:09:56 +0300
Subject: [PATCH] HACK: Enable MUSB & CDC_COMPOSITE in sun7i defconfig
Also change tristate->bool in order to be able to statically
compile CDC_COMPOSITE.
---
arch/arm/configs/sun7i_defconfig | 28 +++++-----------------------
drivers/usb/musb/Kconfig | 16 ++++++++--------