asm: more links

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 549bd4a7fd
commit 3388d72bb2
25 changed files with 154 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/arm-assembly-cheat#calling-convention */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-calling-convention */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,8 +1,4 @@
/* An example of using the '&' earlyclobber modifier.
* https://stackoverflow.com/questions/15819794/when-to-use-earlyclobber-constraint-in-extended-gcc-inline-assembly/54853663#54853663
* The assertion may fail without it. It actually does fail in GCC 8.2.0 at
* 34017bcd0bc96a3cf77f6acba4d58350e67c2694 + 1.
*/
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-early-clobbers */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,3 +1,8 @@
/* Increment a variable in inline assembly.
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly
*/
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,7 +1,4 @@
/* https://stackoverflow.com/questions/53960240/armv8-floating-point-output-inline-assembly
*
* We use the undocumented %s and %d modifiers!
*/
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-floating-point-arm */
#include <assert.h>

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/arm-assembly-cheat#register-variables */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-register-variables */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/arm-assembly-cheat#register-variables */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-register-variables */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library */
#ifndef COMMON_ARCH_H
#define COMMON_ARCH_H

View File

@@ -1,4 +1,7 @@
/* 1 + 2 == 3 */
/* 1 + 2 == 3
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly
*/
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,4 +1,7 @@
/* Increment a variable in inline assembly. */
/* Increment a variable in inline assembly.
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly
*/
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,4 +1,4 @@
/* https://stackoverflow.com/questions/53960240/armv8-floating-point-output-inline-assembly */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-floating-point-arm */
#include <assert.h>

View File

@@ -13,6 +13,8 @@
* ....
* ldr r0, [sp]
* ....
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly
*/
#include <assert.h>

View File

@@ -5,6 +5,8 @@
* movt r3, #<higher address part>
* ldr r0, [r3]
* ....
*
* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly
*/
#include <assert.h>

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/arm-assembly-cheat#register-variables */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-register-variables */
#include <assert.h>
#include <inttypes.h>

View File

@@ -17,7 +17,7 @@ ENTRY
/* r0 is first argument. */
ldr r0, =puts_s
bl puts
/* Check exit statut >= 0 for success. */
/* Check exit status >= 0 for success. */
cmp r0, 0
ASSERT(bge)

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library */
#ifndef COMMON_ARCH_H
#define COMMON_ARCH_H

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library */
#ifndef COMMON_H
#define COMMON_H

View File

@@ -1,4 +1,6 @@
/* https://github.com/cirosantilli/arm-assembly-cheat#about */
/* Please don't do anything, including crashing.
* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly
*/
#include "common.h"

View File

@@ -1,4 +1,6 @@
/* See what happens on test failure. */
/* See what happens on test failure.
* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly
*/
#include "common.h"

View File

@@ -1,4 +1,6 @@
/* This is the main entrypoint for all .S examples. */
/* This is the main entry point for all .S examples.
* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library
*/
#include "stdio.h"
#include "stdint.h"

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,4 +1,4 @@
/* https://stackoverflow.com/questions/6682733/gcc-prohibit-use-of-some-registers/54963829#54963829 */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-scratch-registers */
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,4 +1,6 @@
/* This is a worse version of scratch.c with hardcoded scratch. */
/* This is a worse version of scratch.c with hardcoded scratch.
* https://github.com/cirosantilli/linux-kernel-module-cheat#inline-assembly-scratch-registers
*/
#include <assert.h>
#include <inttypes.h>

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly-c-standard-library */
#ifndef COMMON_ARCH_H
#define COMMON_ARCH_H