Subject: Re: LKM on evbarm
To: '' <>
From: Hsu, Cheng-Hsin (Cheng-Hsin) <>
List: port-arm
Date: 11/18/2003 13:09:16
Hello All,

	I'm trying to modload on evbarm port to load Benedikt's example module. 
	Did I miss something in the following lkmtramp.awk? Should I modify lkmhide.awk and lkmwrap.awk?


        print "#include <machine/asm.h>"

$2 == "R_ARM_PC24" {
        if (x[$3] != "")
        print "ENTRY(__wrap_"$3")"
        print "\tldr\tpc, [pc, #-4]"
        print "\t.word\t__real_"$3

bart: {1010} nm fibo.o
00000000 t .gcc2_compiled.
         U .text
00000298 t __wrap_.text
000002a0 t __wrap_lkmdispatch
000002a8 t __wrap_lkmexists
000002b0 t __wrap_memset
000002b8 t __wrap_printf
000002c0 t __wrap_uiomove
0000002c d _module
         U enodev
000001a4 t fibo_close
00000000 d fibo_dev
00000094 t fibo_handle
00000000 T fibo_lkmentry
00000120 t fibo_open
000001f8 t fibo_read
00000058 d fibo_refcnt
00000000 b fibo_scs
         U lkmdispatch
         U lkmexists
         U memset
         U printf
         U uiomove
00000004 C want_resched

Subject: Re: LKM on evbarm
To: Matt Thomas <>
From: Richard Earnshaw <>
List: port-arm
Date: 07/01/2003 17:47:59 
> What's the proper sequence to do a trampoline?  I think this might be
> it but my arm's a bit rusty.
> __wrap_foo:
>          ldr pc, [pc, #-4]
>          .word __real_foo

Yep, that would work.

	ldr	pc, . + 4
	.word	__real_foo

Might be a bit cleaner (since it hides the pipeline compensation), but 
there's no difference in the code generated.