1
0
Fork 0
mirror of https://github.com/tailix/drivers.git synced 2024-11-20 11:06:32 -05:00

Fix error

This commit is contained in:
Alex Kotov 2022-12-03 20:12:34 +04:00
parent d0fc1ca09f
commit e2f20188f9
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 5 additions and 3 deletions

View file

@ -13,7 +13,7 @@ void drivers_intel_8253_pit_initialize(const unsigned int freq)
const uint8_t l = divisor & 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" (h));
}

View file

@ -4,6 +4,8 @@
#include <drivers/shutdown.h>
#include <stdint.h>
void drivers_shutdown_halt()
{
#ifdef ASM_X86
@ -19,9 +21,9 @@ void drivers_shutdown_poweroff()
{
#ifdef ASM_X86
// 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
__asm__ __volatile__("outw %1, %0" : : "dN" (0xB004), "a" (0x2000));
__asm__ __volatile__("outw %1, %0" : : "dN" (0xB004), "a" ((uint16_t)0x2000));
#endif
// If we can't poweroff then we halt