On Mon, 29 May 2006 00:05:12 PDT, 4Front Technologies said: > But regparm requires that ALL parts linked into the module need to have regparm > defined. So it's another headache to write makefiles for the kernel independant > part to figure out if the distro support regparm or not. Not true at all.. Or at least not for the most infamous module out there: % grep NV_API_CALL *.h | head nv.h:#if !defined(NV_API_CALL) nv.h:#define NV_API_CALL __attribute__((regparm(0))) nv.h:#define NV_API_CALL nv.h:void* NV_API_CALL nv_dma_to_mmap_token (nv_state_t *, NvU64); nv.h:void* NV_API_CALL nv_alloc_kernel_mapping (nv_state_t *, NvU64, U032, void **); nv.h:S032 NV_API_CALL nv_free_kernel_mapping (nv_state_t *, void *, void *); nv.h:NvU64 NV_API_CALL nv_get_kern_phys_address (NvU64); nv.h:NvU64 NV_API_CALL nv_get_user_phys_address (NvU64); nv.h:void* NV_API_CALL nv_get_adapter_state (U016, U016); nv.h:void NV_API_CALL nv_lock_rm (nv_state_t *); So there's routines facing the rest of the kernel - those *do* need to have a regparm that matches the kernel. But internal to the module, you can have some other regparm value - the requirement is only that the prototype needs to have the same regparm as the function body is actually compiled with. I seem to remember that parts of the *mainline* kernel use 'asmlinkage' for similar reasons.... ;)
Attachment:
pgp3NpSSUMGvA.pgp
Description: PGP signature
- References:
- Re: How to check if kernel sources are installed on a system?
- From: Arjan van de Ven <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Heiko Carstens <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Arjan van de Ven <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Lee Revell <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Arjan van de Ven <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Lee Revell <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: "Brian F. G. Bidulock" <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Arjan van de Ven <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: 4Front Technologies <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: Arjan van de Ven <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: "Brian F. G. Bidulock" <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- From: 4Front Technologies <[email protected]>
- Re: How to check if kernel sources are installed on a system?
- Prev by Date: Re: memcpy_toio on i386 using byte writes even when n%2==0
- Next by Date: Re: [PATCH] 2.6.16.18 - spelling fix
- Previous by thread: Re: How to check if kernel sources are installed on a system?
- Next by thread: Re: How to check if kernel sources are installed on a system?
- Index(es):