lkml.org 
[lkml]   [2012]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESUBMIT] [PATCH] Use BIOS Keyboard variable to set Numlock
On 03/01/2012 11:42 AM, Joshua C. wrote:
> diff --git a/arch/x86/include/asm/kbdleds.h b/arch/x86/include/asm/kbdleds.h
> new file mode 100644
> index 0000000..1446a65
> --- /dev/null
> +++ b/arch/x86/include/asm/kbdleds.h
> @@ -0,0 +1,41 @@
> +#ifndef _ASM_X86_KBDLEDS_H
> +#define _ASM_X86_KBDLEDS_H
> +
> +/*
> + * Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
> + * This seems a good reason to start with NumLock off. On HIL keyboards
> + * of PARISC machines however there is no NumLock key and everyone expects
> + * the keypad to be used for numbers. That's why on X86 we ask the bios for
> + * the correct state.
> + */
> +
> +#ifdef CONFIG_X86
> +
> +#include<asm/setup.h>
> +
> +static inline int kbd_defleds(void)
> +{
> + return boot_params.kbd_status& 0x20 ? (1<< VC_NUMLOCK) : 0;
> +}
> +
> +#elif defined(CONFIG_PARISC)
^^^^^^^^^^^^^

Sorry, you can't put non-x86 code in arch/x86. There are two way to
distribute this kind of stuff into arch directories:

1. You can define an ARCH_ symbol which indicates that <asm/kbdleds.h>
is available; otherwise use the fallback routine;

2. You can define it in a .c file as an actual function in the affected
architectures (x86 and parisc here) and then define it as a weak symbol
(grep for __weak) in the common code.

If you don't want to bite off this distribution I can understand it
(although it's not up to me, technically, since I'm not the maintainer
of the vt subsystem) but if so leave this as an inline in a common place.

-hpa


\
 
 \ /
  Last update: 2012-03-01 21:57    [W:0.083 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site