userland: attempt to fix all assembly example links to README

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-12 00:00:08 +00:00
parent 180e26590a
commit b5f5f6a5bc
73 changed files with 119 additions and 112 deletions

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#data-processing-instructions */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#userland-assembly */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#assembly-simd
/* https://github.com/cirosantilli/linux-kernel-module-cheat#simd-assembly
*
* Add a bunch of integers in one go.
*/

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#adr */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-adr-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#adr */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-adr-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#cbz */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-beq-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#bfi */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-bfi-instruction */
#include "common.h"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#cbz */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-cbz-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#cset */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-cset-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#assembly-simd
/* https://github.com/cirosantilli/linux-kernel-module-cheat#simd-assembly
*
* Add a bunch of floating point numbers in one go.
*/

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gas-data-sizes */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gnu-gas-assembler data sizes */
#include "common.h"

View File

@@ -1,7 +0,0 @@
/* MInimal sanity check of the C driver. */
.text
.global asm_main
asm_main:
asm_main_after_prologue:
mov w0, 0
ret

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#movk */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-aarch64-movk-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#movn */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-aarch64-movn-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#bl */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-aarch64-ret-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#simd-interleaving */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-simd-interleaving */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-str */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-aarch64-str-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#ubfm */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-ubfm-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#ubfx */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-ubfx-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x31 */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#armv8-aarch64-x31-register */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#data-processing-instructions */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-data-processing-instructions */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#addressing-modes */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-addressing-modes */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#adr */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-adr-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* Bitwise AND. */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-bitwise-instructions */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#b */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-b-instruction */
#include "common.h"
ENTRY

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#beq */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-beq-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#bfi */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-bfi-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#bic */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-bic-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#bl */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-bl-instruction */
#include "common.h"

View File

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

View File

@@ -1,5 +1,6 @@
/* arm freestanding C inline assemby Linux hello world
* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
/* https://github.com/cirosantilli/linux-kernel-module-cheat#linux-system-calls
*
* arm freestanding C inline assemby Linux hello world.
*/
#include <inttypes.h>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#data-processing-instructions */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#data-bitwise-instructions */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#conditional-execution */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-conditional-execution */
#include "common.h"

View File

@@ -1,3 +1,5 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gnu-gas-assembler data sizes */
#include "common.h"
.data

View File

@@ -1,23 +0,0 @@
/* Minimal example using driver.
*
* Controls the exit status of the program.
*/
.syntax unified
.text
.global asm_main
asm_main:
asm_main_after_prologue:
/* Set the return value according to the ARM calling convention. */
mov r0, 0
/* Try some whacky value to see tests break. */
/*mov r0, 77*/
/* Branch to the address at register lr.
* That is the return value which was put there by the C driver (likely with a bl).
*
* X means eXchange encoding from thumb back to ARM, which is what the driver uses.
*/
bx lr

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gnu-gas-assembler-immediates */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-gnu-instruction-gas-assembler-immediates */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#loop-over-array */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-loop-instruction-over-array */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#loop-over-array */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-loop-instruction-over-array */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#ldr-pseudo-instruction */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-ldr-instruction-pseudo-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#ldrh-and-ldrb */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-ldrh-instruction-and-ldrb */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#ldrh-and-ldrb */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-ldrh-instruction-and-ldrb */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#mov */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-mov-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#movw-and-movt */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-movw-and-movt-instructions */
#include "common.h"

View File

@@ -1,4 +1,7 @@
/* Multiplication. */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-data-processing-instructions
*
* Multiplication.
*/
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#nop */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-nop-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#ldmia */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-ldmia-instruction */
#include "common.h"

View File

@@ -1,4 +1,7 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#rbit */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-data-processing-instructions
*
* Reverse bit order.
*/
#include "common.h"

View File

@@ -1,4 +1,7 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#data-processing-instructions */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#data-processing-instructions
*
* Reverse byte order.
*/
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#s-suffix */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-s-suffix */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#shift-suffixes */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-shift-suffixes */
#include "common.h"

View File

@@ -1,4 +1,7 @@
/* Subtraction. */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-data-processing-instructions
*
* Subtraction.
*/
#include "common.h"

View File

@@ -1,4 +1,8 @@
/* Illustrates features that are only available in thumb. */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-instruction-encodings
*
* Illustrates features that are only available in thumb.
* TODO ensure that we are actually inside of thumb.
*/
.syntax unified
.text

View File

@@ -1,4 +1,7 @@
/* Test. Same as ands, but don't store the result, just update flags. */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-data-processing-instructions
*
* Test. Same as ands, but don't store the result, just update flags.
*/
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#assembly-simd */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-simd-instruction-assembly */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#vcvt */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-vcvt-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#vcvta */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-vcvta-instruction */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#vcvtrr */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#arm-vcvtrr-instruction */
#include "common.h"

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gas-data-sizes */
/* https://github.com/cirosantilli/linux-kernel-module-cheat#gnu-gas-assembler data sizes */
#include "common.h"

View File

@@ -1,4 +1,4 @@
/* https://github.com/cirosantilli/linux-kernel-module-cheat#assembly-simd
/* https://github.com/cirosantilli/linux-kernel-module-cheat#simd-assembly
*
* Add a bunch of integers in one go.
*