This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************************************/ /*! | |
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved | |
@License Dual MIT/GPLv2 | |
The contents of this file are subject to the MIT license as set out below. | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "die.h" | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
struct Gpio { | |
int fd = -1; | |
char *path = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; boilerplate and compiler spam removed for readability | |
.global ||_Z6istruei|| | |
||_Z6istruei||: | |
LDI r0.b0, 0x00 | |
QBEQ ||$C$L4||, r14, 0x00 | |
LDI r0.b0, 0x01 | |
||$C$L4||: | |
MOV r14.b0, r0.b0 | |
JMP r3.w2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
shopt -s lastpipe extglob | |
if [[ $# != 1 ]]; then | |
echo "Usage: ${BASH_SOURCE} <device or image file>" >&2 | |
false | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "die.h" | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
class Gpio { | |
int fd = -1; | |
char *path = NULL; |
NewerOlder