Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158650
b: refs/heads/master
c: c742531
h: refs/heads/master
v: v3
  • Loading branch information
Akinobu Mita authored and Ingo Molnar committed Aug 10, 2009
1 parent 03852c9 commit 1d0c0a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4c711576b90cc36c13b94816a953a8de6a53d03c
refs/heads/master: c7425314c755d5f94da7c978205c85a7c6201212
19 changes: 9 additions & 10 deletions trunk/arch/x86/kernel/apm_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,15 @@ static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
static struct apm_user *user_list;
static DEFINE_SPINLOCK(user_list_lock);
static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092, 0, 0);

/*
* Set up a segment that references the real mode segment 0x40
* that extends up to the end of page zero (that we have reserved).
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092,
(unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);

static const char driver_version[] = "1.16ac"; /* no spaces */

Expand Down Expand Up @@ -2331,15 +2339,6 @@ static int __init apm_init(void)
}
pm_flags |= PM_APM;

/*
* Set up a segment that references the real mode segment 0x40
* that extends up to the end of page zero (that we have reserved).
* This is for buggy BIOS's that refer to (real mode) segment 0x40
* even though they are called in protected mode.
*/
set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));

/*
* Set up the long jump entry point to the APM BIOS, which is called
* from inline assembly.
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/pnp/pnpbios/bioscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ do { \
set_desc_limit(&gdt[(selname) >> 3], (size) - 1); \
} while(0)

static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092, 0, 0);
static struct desc_struct bad_bios_desc = GDT_ENTRY_INIT(0x4092,
(unsigned long)__va(0x400UL), PAGE_SIZE - 0x400 - 1);

/*
* At some point we want to use this stack frame pointer to unwind
Expand Down Expand Up @@ -476,8 +477,6 @@ void pnpbios_calls_init(union pnp_bios_install_struct *header)
pnp_bios_callpoint.offset = header->fields.pm16offset;
pnp_bios_callpoint.segment = PNP_CS16;

set_desc_base(&bad_bios_desc, (unsigned long)__va(0x40UL << 4));
set_desc_limit(&bad_bios_desc, 4095 - (0x40 << 4));
for_each_possible_cpu(i) {
struct desc_struct *gdt = get_cpu_gdt_table(i);
if (!gdt)
Expand Down

0 comments on commit 1d0c0a1

Please sign in to comment.