lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 01 Mar 2012 12:54:18 -0800
From:	"H. Peter Anvin" <hpa@...or.com>
To:	"Joshua C." <joshuacov@...glemail.com>
CC:	Bodo Eggert <7eggert@....de>, linux-kernel@...r.kernel.org
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ