Skip to contentSkip to conversation

apm_event{,info}_t are userspace types.

PATCH In review Adam Jackson 4 participants 5 messages Nov 30, 2007 – Dec 19, 2007 Apm driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apm_event{,info}_t are userspace types.

These types define the size of data read from /dev/apm_bios. They should not be hidden behind #ifdef __KERNEL__.

---
 include/linux/apm_bios.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
include/linux/apm_bios.h +3 -3
index 9754baa..01a6244 100644
@@ -18,6 +18,9 @@
 
 #include <linux/types.h>
 
+typedef unsigned short	apm_event_t;
+typedef unsigned short	apm_eventinfo_t;
+
 struct apm_bios_info {
 	__u16	version;
 	__u16	cseg;
@@ -32,9 +35,6 @@ struct apm_bios_info {
 
 #ifdef __KERNEL__
 
-typedef unsigned short	apm_event_t;
-typedef unsigned short	apm_eventinfo_t;
-
 #define APM_CS		(GDT_ENTRY_APMBIOS_BASE * 8)
 #define APM_CS_16	(APM_CS + 8)
 #define APM_DS		(APM_CS_16 + 8)
Signature · 1 line
1.5.2.4
#1 lore raw
Quoted 2 lines · On Fri, 30 Nov 2007 15:02:43 -0500 Adam Jackson <[email protected]> wrote:

These types define the size of data read from /dev/apm_bios. They should not be hidden behind #ifdef __KERNEL__.

Missing info: what are the consequences of this fix? What id broken when it it not applied?

Quoted 3 lines
---
 include/linux/apm_bios.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Please include Signed-off-by:, as per Documentation/SubmittingPatches, thanks.

Quoted 24 lines
include/linux/apm_bios.h +3 -3
index 9754baa..01a6244 100644
@@ -18,6 +18,9 @@
 
 #include <linux/types.h>
 
+typedef unsigned short	apm_event_t;
+typedef unsigned short	apm_eventinfo_t;
+
 struct apm_bios_info {
 	__u16	version;
 	__u16	cseg;
@@ -32,9 +35,6 @@ struct apm_bios_info {
 
 #ifdef __KERNEL__
 
-typedef unsigned short	apm_event_t;
-typedef unsigned short	apm_eventinfo_t;
-
 #define APM_CS		(GDT_ENTRY_APMBIOS_BASE * 8)
 #define APM_CS_16	(APM_CS + 8)
 #define APM_DS		(APM_CS_16 + 8)
#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 2 lines · On Fri, 30 Nov 2007 15:02:43 -0500 Adam Jackson <[email protected]> wrote:

These types define the size of data read from /dev/apm_bios. They should not be hidden behind #ifdef __KERNEL__.

Missing info: what are the consequences of this fix? What id broken when it it not applied?

This is killing my xserver compile, apm_event_t is used in the xserver source. The commit that introduced the problem is:

commit ee8e7cfe9d330d6f1ce0b9b1620d6df5d9cf6b70

Author: Rusty Russell <[email protected]>
Date:   Mon Oct 22 10:56:19 2007 +1000

Make asm-x86/bootparam.h includable from userspace.

To actually write a bootloader (or, say, the lguest launcher) currently requires duplication of these structures. Making them includable from userspace is much nicer.

We merge the common userspace-required definitions of e820_32/64.h into e820.h for export.

Quoted 40 lines
Quoted 5 lines

---
 include/linux/apm_bios.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Please include Signed-off-by:, as per Documentation/SubmittingPatches, thanks.

Quoted 15 lines
include/linux/apm_bios.h +3 -0
index 9754baa..01a6244 100644
@@ -18,6 +18,9 @@
 
 #include <linux/types.h>
 
+typedef unsigned short	apm_event_t;
+typedef unsigned short	apm_eventinfo_t;
+
 struct apm_bios_info {
 	__u16	version;
 	__u16	cseg;

include/linux/apm_bios.h struct apm_bios_info { · line 40

Quoted 9 lines
include/linux/apm_bios.h +0 -3
@@ -32,9 +35,6 @@ struct apm_bios_info {
 
 #ifdef __KERNEL__
 
-typedef unsigned short	apm_event_t;
-typedef unsigned short	apm_eventinfo_t;
-
 #define APM_CS		(GDT_ENTRY_APMBIOS_BASE * 8)
 #define APM_CS_16	(APM_CS + 8)
 #define APM_DS		(APM_CS_16 + 8)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 2 lines
Eamon Walsh <[email protected]>
National Security Agency
#3 lore raw
In reply to Andrew Morton
Quoted 6 lines · Andrew Morton
Quoted 2 lines · On Fri, 30 Nov 2007 15:02:43 -0500 Adam Jackson <[email protected]> wrote:

These types define the size of data read from /dev/apm_bios. They should not be hidden behind #ifdef __KERNEL__.

Missing info: what are the consequences of this fix? What id broken when it it not applied?

The X server won't build. Neither will apmd, but it's harder for me to get worked up about that.

Quoted 6 lines
Quoted 3 lines
---
 include/linux/apm_bios.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Please include Signed-off-by:, as per Documentation/SubmittingPatches, thanks.

Blah. Right, will remember git-format-patch -s next time. In any event:

- ajax