#include <machine/segments.h>
#include <dev/acpi/acpivar.h>
+#ifdef __clang__
+#define addr32
+#endif
+
#define _ACPI_TRMP_LABEL(a) a = . - _C_LABEL(acpi_real_mode_resume) + ACPI_TRAMPOLINE
#define _ACPI_TRMP_OFFSET(a) a = . - _C_LABEL(acpi_real_mode_resume)
#define _ACPI_TRMP_DATA_LABEL(a) a = . - _C_LABEL(acpi_tramp_data_start) + \
movw %ax, %ss
movw %cs, %ax
movw %ax, %es
- lidtl clean_idt
+ addr32 lidtl clean_idt
/*
* Set up stack to grow down from offset 0x0FFE.
* to sleep (although on i386, the saved GDT will most likely
* represent something similar based on machine/segment.h).
*/
- data32 addr32 lgdt tmp_gdt
+ addr32 lgdtl tmp_gdt
/*
* Enable protected mode by setting the PE bit in CR0
movw %ax, %fs
movw %ax, %gs
movl $0x0FFE, %esp
- lidtl clean_idt
+ addr32 lidtl clean_idt
/* Jump to the S3 resume vector */
ljmp $(_ACPI_RM_CODE_SEG), $acpi_s3_vector_real
-/* $OpenBSD: mptramp.s,v 1.20 2017/02/06 01:50:36 mlarkin Exp $ */
+/* $OpenBSD: mptramp.s,v 1.21 2017/06/04 23:03:19 naddy Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
#include <machine/mpbiosvar.h>
#include <machine/i82489reg.h>
+#ifdef __clang__
+#define addr32
+#endif
+
#define GDTE(a,b) .byte 0xff,0xff,0x0,0x0,0x0,a,b,0x0
#define _RELOC(x) ((x) - KERNBASE)
#define RELOC(x) _RELOC(_C_LABEL(x))
movw %cs, %ax
movw %ax, %es
movw %ax, %ss
- data32 addr32 lgdt (gdt_desc) # load flat descriptor table
+ addr32 lgdtl (gdt_desc) # load flat descriptor table
movl %cr0, %eax # get cr0
orl $0x1, %eax # enable protected mode
movl %eax, %cr0 # doit