Re: suspend-to-ram: don't crash when kernel gets big

Pavel Machek (pavel@ucw.cz)
Mon, 25 Nov 2002 00:39:54 +0100


Hi!

> | > > + pushl $0 # Kill any dangerous flags
> | > > + popfl
> | > > + cli
> | > > + cld
> | >
> | > Seems like you're trying to be 200% sure ;-)
> |
> | I was not sure if cli really *clears* it as name implies :-).
>
> Yes, as Martin suggested. 8;)

Actually, as following proves, I wanted to be *300%* sure ;-).

cli
cld

# We are now probably running at something like 0x0000 : 0x1000
call here
here:
pop %bx
subw $(here-wakeup_start), %bx
shrw $4, %bx

# setup data segment
movw %cs, %ax
addw %bx, %ax
movw %ax, %ds # Make
ds:0 point to wakeup_start
movw %ax, %ss
mov $(wakeup_stack-wakeup_code), %sp #
Private stack is needed for ASUS board
movw $0x0e00 + 'S', %fs:(0x12)

pushl $0 # Kill
any dangerous flags
popfl
cli
cld

Fixed now. [Not that it matters.]
Pavel

-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
-
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/