Re: return-type for search_extable()

Rusty Russell
2003-01-28T05:47:26Z

In message <15921.33955.645830.709868@napali.hpl.hp.com> you write:
> Hi Rusty,
>
> Could you please change the return-type of search_extable() to
> something that allows a bit more flexibility? The value returned by
> this function is "something that lets architecture-specific code
> recover from a memory-managment-fault". This may or may not be the
> same as an exception_table_entry. For example, on ia64, I want to
> return an already-relocated fixup-word. Perhaps the cleanest way to
> fix this would be to have:
>
> exception_fixup_t search_extable (...);
>
> By default, you could then use
>
> typedef struct exception_table_entry *exception_fixup_t;
>
> and on ia64 I could use:
>
> typedef long exception_fixup_t.

Sure. Of course, you could just cast the return value to a long
inside ia64, but that's pretty unclear.

Hmm, I actually just tried to do this, and like all typedefs, it's
icky. search_exception_table() belongs in kernel.h, not module.h
where it is now. But that means kernel.h has to include asm/uaccess.h
to get exception_fixup_t.

Maybe the cleanest way really is to simply document that your
search_extable() returns the fixup word... 8(

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.