Export assembly symbols

Garcia Jérémie GARCIAJ at 3il.fr
Wed Aug 31 22:35:02 EST 2005


Hi everybody, I need your help again.
I'm desesperatly tryin to insert some new assembly code in the
linux montavista sources PE 3.1 for a ppc 405EP. 
What I'd like to do is to have, in my kernel source file "myfile.S", two
assembly functions and export those symbols to the ksyms table.
The final point for me is to make those symbols availabale for
modules loading.
The functions definition in "myfile.S" is the one below:

/*
 myfile.S : DESCRIPTION
This module contains chip-dependent routines written in assembly language.
*/
#include <linux/config.h>
#include <linux/sys.h>
#include <linux/threads.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/mmu.h>
#include <asm/cputable.h>
#include <asm/ppc_asm.h>
#include <asm/errno.h>
#include <asm/ppc_asm.h>
#include "myfile.h"
                 
#define _ASMLANGUAGE
    
       .globl  stas_Read_TBl_F
       .globl  stas_Set_TBl_F
           .text

       /******************************************************************************
       * stas_Read_TBl_F : This function returns the content of TBL.
       * uLong stas_Read_TBl_F(void)
       ******************************************************************************/
_GLOBAL(stas_Read_TBl_F)
              mftb r3
              nop
              nop
              nop
              blr

       /******************************************************************************
       * stas_Set_TBl_F : This function is used to set the TBL. 
       * void stas_Set_TBl_F(uLong)
       ******************************************************************************/
_GLOBAL(stas_Set_TBl_F)
             mttbl r3
             nop
             nop
             nop
             blr


Due to a modified Linux Makefile, it is compiled by the kernel with this command line:

ppc_405-gcc -D__ASSEMBLY__ -D__KERNEL__ -I/myWorks/en-cours/linux-2.4.20_mvl31/include   [...]
-I/myWorks/en-cours/linux-2.4.20_mvl31/arch/ppc -Wa,-m405  -c -o myfile.o myfile.S

What do I have to do to get both functions in the symbols table when reading/proc/ksyms.
Is there a specific way to do for ppc? 

Please help me cause I can't finf any info on that browsing the web.
Tks a lot for your precious help

Jérémie



More information about the Linuxppc-dev mailing list