mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
baremetal: make entry point _start instead of lkmc_start
I forgot why I did that. Let's try and see it blow up.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <lkmc.h>
|
#include <lkmc.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
mov x0, 0
|
mov x0, 0
|
||||||
bl _exit
|
bl _exit
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <lkmc/m5ops.h>
|
#include <lkmc/m5ops.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
LKMC_M5OPS_EXIT_ASM
|
LKMC_M5OPS_EXIT_ASM
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include <lkmc.h>
|
#include <lkmc.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
/* Reset spinlock. */
|
/* Reset spinlock. */
|
||||||
mov x0, 0
|
mov x0, 0
|
||||||
ldr x1, =.Lspinlock
|
ldr x1, =.Lspinlock
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/* https://cirosantilli.com/linux-kernel-module-cheat#semihosting
|
/* https://cirosantilli.com/linux-kernel-module-cheat#semihosting
|
||||||
*
|
*
|
||||||
* Since our stack pointer is not setup, we justa allocate a memory
|
* Since our stack pointer is not setup, we just a allocate a memory
|
||||||
* region to contain the semihosting arguments, which must be in memory.
|
* region to contain the semihosting arguments, which must be in memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
mov x1, 0x26
|
mov x1, 0x26
|
||||||
movk x1, 2, lsl 16
|
movk x1, 2, lsl 16
|
||||||
ldr x2, =.Lsemihost_args
|
ldr x2, =.Lsemihost_args
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <lkmc/m5ops.h>
|
#include <lkmc/m5ops.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
wfe
|
wfe
|
||||||
b lkmc_start
|
b _start
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
mov r0, #0; mov r1, #0; .inst 0xEE000110 | (0x21 << 16);
|
mov r0, #0; mov r1, #0; .inst 0xEE000110 | (0x21 << 16);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#include <lkmc.h>
|
#include <lkmc.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
mov r0, 0
|
mov r0, 0
|
||||||
ldr r1, =.Lspinlock
|
ldr r1, =.Lspinlock
|
||||||
str r0, [r1]
|
str r0, [r1]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
mov r0, #0x18
|
mov r0, #0x18
|
||||||
ldr r1, =#0x20026
|
ldr r1, =#0x20026
|
||||||
svc 0x00123456
|
svc 0x00123456
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <lkmc.h>
|
#include <lkmc.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
/* Make all CPUs except CPU0 sleep by default. */
|
/* Make all CPUs except CPU0 sleep by default. */
|
||||||
mrs x0, mpidr_el1
|
mrs x0, mpidr_el1
|
||||||
ands x0, x0, 3
|
ands x0, x0, 3
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <lkmc.h>
|
#include <lkmc.h>
|
||||||
|
|
||||||
.global lkmc_start
|
.global _start
|
||||||
lkmc_start:
|
_start:
|
||||||
/* Make all CPUs except CPU0 sleep by default. */
|
/* Make all CPUs except CPU0 sleep by default. */
|
||||||
mrc p15, 0, r0, c0, c0, 5
|
mrc p15, 0, r0, c0, c0, 5
|
||||||
ands r0, r0, 3
|
ands r0, r0, 3
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
ENTRY(lkmc_start)
|
ENTRY(_start)
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
.text : {
|
.text : {
|
||||||
|
|||||||
Reference in New Issue
Block a user