Skip to content

Instantly share code, notes, and snippets.

View mvduin's full-sized avatar

Matthijs van Duin mvduin

View GitHub Profile
struct __attribute__((packed,aligned(4))) Ratios11 {
u32 d0r0 : 11;
u32 d0r1 : 11;
u32 d1r0 : 11;
u32 d1r1 : 11;
u32 d2r0 : 11;
u32 d2r1 : 11;
u32 d3r0 : 11;
u32 d3r1 : 11;
};
@mvduin
mvduin / sgx-init.service
Created September 25, 2017 04:47
sgx init
# /etc/systemd/system/sgx-init.service
[Unit]
Description=Initialize SGX
BindsTo=dev-dri-sgx.device
After=dev-dri-sgx.device
RefuseManualStop=true
DefaultDependencies=no
[Service]
@mvduin
mvduin / die.h
Last active September 9, 2019 09:33
sysfs gpio event example
#pragma once
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
[[ noreturn ]]
inline void die( char const *fmt, ... )
{
va_list ap;
va_start( ap, fmt );
(STILL BEING REVISED, and beware that not all uarts behave the same)
Table showing whether a particular byte triggers a break condition when
receiver uart is configured at a higher baudrate than the transmitter uart and
both are 8N1.
always = byte always triggers break regardless of preceding data
init = byte triggers break at least if preceded by line idle state
*** = not sure, dependent on subtle details of uart behaviour