mirror of
https://github.com/tailix/drivers.git
synced 2024-11-20 11:06:32 -05:00
Fix error
This commit is contained in:
parent
d0fc1ca09f
commit
e2f20188f9
2 changed files with 5 additions and 3 deletions
|
@ -13,7 +13,7 @@ void drivers_intel_8253_pit_initialize(const unsigned int freq)
|
||||||
const uint8_t l = divisor & 0xff;
|
const uint8_t l = divisor & 0xff;
|
||||||
const uint8_t h = (divisor >> 8) & 0xff;
|
const uint8_t h = (divisor >> 8) & 0xff;
|
||||||
|
|
||||||
__asm__ __volatile__("outb %1, %0" : : "dN" (0x43), "a" (0x36));
|
__asm__ __volatile__("outb %1, %0" : : "dN" (0x43), "a" ((uint8_t)0x36));
|
||||||
__asm__ __volatile__("outb %1, %0" : : "dN" (0x40), "a" (l));
|
__asm__ __volatile__("outb %1, %0" : : "dN" (0x40), "a" (l));
|
||||||
__asm__ __volatile__("outb %1, %0" : : "dN" (0x40), "a" (h));
|
__asm__ __volatile__("outb %1, %0" : : "dN" (0x40), "a" (h));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include <drivers/shutdown.h>
|
#include <drivers/shutdown.h>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
void drivers_shutdown_halt()
|
void drivers_shutdown_halt()
|
||||||
{
|
{
|
||||||
#ifdef ASM_X86
|
#ifdef ASM_X86
|
||||||
|
@ -19,9 +21,9 @@ void drivers_shutdown_poweroff()
|
||||||
{
|
{
|
||||||
#ifdef ASM_X86
|
#ifdef ASM_X86
|
||||||
// QEMU >= 2.0
|
// QEMU >= 2.0
|
||||||
__asm__ __volatile__("outw %1, %0" : : "dN" (0x604), "a" (0x2000));
|
__asm__ __volatile__("outw %1, %0" : : "dN" (0x604), "a" ((uint16_t)0x2000));
|
||||||
// QEMU < 2.0
|
// QEMU < 2.0
|
||||||
__asm__ __volatile__("outw %1, %0" : : "dN" (0xB004), "a" (0x2000));
|
__asm__ __volatile__("outw %1, %0" : : "dN" (0xB004), "a" ((uint16_t)0x2000));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// If we can't poweroff then we halt
|
// If we can't poweroff then we halt
|
||||||
|
|
Loading…
Reference in a new issue