lkml.org 
[lkml]   [2012]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RESUBMIT] [PATCH] Use BIOS Keyboard variable to set Numlock
From
2012/3/1 H. Peter Anvin <hpa@zytor.com>:
> On 02/29/2012 03:51 PM, Joshua C. wrote:
>>
>> Will this work?
>>
>> +#if (defined(__i386__) || defined(__x86_64__))
>> +#include <asm/io.h>
>> +#include <asm/setup.h>
>> +#else
>> +extern struct boot_params boot_params;
>> +#endif
>>
>
> A much better way to do this is probably something like
>
> #ifdef CONFIG_X86
>
> #include <asm/setup.h>
>
> static inline int kbd_defleds(void)
> {
>        return boot_param.kbd_status & 0x20 ? (1 << VC_NUMLOCK) : 0;
> }
>
> #elif defined(CONFIG_PARISC)
> static inline int kbd_defleds(void)
> {
> # if defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD)
>        return 1 << VC_NUMLOCK;
> # else
>        return 0;
> # endif
> }
>
> #else
>
> static inline int kbd_defleds(void)
> {
>        return 0;
> }
>
> #endif
>
> ... then arguably this should be moved into the arch/* directories, in a
> header file or by making this a callable function.
>
>
> --
> H. Peter Anvin, Intel Open Source Technology Center
> I work for Intel.  I don't speak on their behalf.
>

Thanks for the help. You can better figure out where this code should
go into. Can you prepare the patch for merging in the mainline kernel?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-01 01:23    [from the cache]
©2003-2011 Jasper Spaans