summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-28 20:54:55 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-28 20:54:55 +0100
commit9729f813358c93df27d804312846cd45dc59368e (patch)
tree32d91a183a8468beacbf46a89deeb6384a95de64
parent3b8c9008c9e5e8e9c76afc47fdf24143fea1d0a3 (diff)
parent534fe660fc8910ff77920ba12d5fcb66825b83e7 (diff)
Merge branch 'master' into master-x86_64
-rw-r--r--configure.ac2
-rw-r--r--i386/i386/fpu.c2
-rw-r--r--i386/i386/idt.c2
-rw-r--r--i386/i386/pic.h4
-rw-r--r--i386/i386/pit.h4
-rw-r--r--i386/intel/pmap.c2
-rw-r--r--x86_64/configfrag.ac19
-rw-r--r--x86_64/idt_inittab.S4
-rw-r--r--x86_64/kdasm.S6
9 files changed, 33 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 42dfcd40..49e16399 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,7 +58,7 @@ case $host_platform:$host_cpu in
default:x86_64)]
AC_MSG_WARN([Platform set to Xen by default, this can not boot on non-Xen systems, you currently need a 32bit build for that.])
[host_platform=xen;;
- at:i?86 | xen:i?86 | xen:x86_64)
+ at:i?86 | xen:i?86 | at:x86_64 | xen:x86_64)
:;;
*)]
AC_MSG_ERROR([unsupported combination of cpu type `$host_cpu' and platform
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index 0887a32c..3118e4ca 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -874,7 +874,7 @@ fp_state_alloc(void)
}
}
-#if AT386 && !defined(MACH_XEN)
+#if (defined(AT386) || defined(ATX86_64)) && !defined(MACH_XEN)
/*
* Handle a coprocessor error interrupt on the AT386.
* This comes in on line 5 of the slave PIC at SPL1.
diff --git a/i386/i386/idt.c b/i386/i386/idt.c
index d304ec3e..c6a778f1 100644
--- a/i386/i386/idt.c
+++ b/i386/i386/idt.c
@@ -30,7 +30,7 @@ struct real_gate idt[IDTSZ];
struct idt_init_entry
{
- unsigned entrypoint;
+ unsigned long entrypoint;
unsigned short vector;
unsigned short type;
};
diff --git a/i386/i386/pic.h b/i386/i386/pic.h
index 553c4bcc..f492de5e 100644
--- a/i386/i386/pic.h
+++ b/i386/i386/pic.h
@@ -59,7 +59,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
** The following are definitions used to locate the PICs in the system
*/
-#if defined(AT386)
+#if defined(AT386) || defined(ATX86_64)
#define ADDR_PIC_BASE 0x20
#define OFF_ICW 0x00
#define OFF_OCW 0x01
@@ -95,7 +95,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
** ICW2
*/
-#if defined(AT386)
+#if defined(AT386) || defined(ATX86_64)
#define PICM_VECTBASE 0x40
#define PICS_VECTBASE PICM_VECTBASE + 0x08
#endif /* defined(AT386) */
diff --git a/i386/i386/pit.h b/i386/i386/pit.h
index e65aae97..6b682280 100644
--- a/i386/i386/pit.h
+++ b/i386/i386/pit.h
@@ -45,7 +45,7 @@ NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#if defined(AT386)
+#if defined(AT386) || defined(ATX86_64)
/* Definitions for 8254 Programmable Interrupt Timer ports on AT 386 */
#define PITCTR0_PORT 0x40 /* counter 0 port */
#define PITCTR1_PORT 0x41 /* counter 1 port */
@@ -74,7 +74,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* Clock speed for the timer in hz divided by the constant HZ
* (defined in param.h)
*/
-#if AT386
+#if defined(AT386) || defined(ATX86_64)
#define CLKNUM 1193167
#endif /* AT386 */
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index 4b223ec5..e7d5fac8 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -659,7 +659,9 @@ void pmap_bootstrap(void)
kernel_pmap->l4base = (pt_entry_t*)phystokv(pmap_grab_page());
memset(kernel_pmap->l4base, 0, INTEL_PGBYTES);
WRITE_PTE(&kernel_pmap->l4base[0], pa_to_pte(_kvtophys(kernel_pmap->pdpbase)) | INTEL_PTE_VALID | INTEL_PTE_WRITE);
+#ifdef MACH_PV_PAGETABLES
pmap_set_page_readonly_init(kernel_pmap->l4base);
+#endif
#endif /* x86_64 */
#else /* PAE */
kernel_pmap->dirbase = kernel_page_dir = (pt_entry_t*)phystokv(pmap_grab_page());
diff --git a/x86_64/configfrag.ac b/x86_64/configfrag.ac
index 99db468f..480028c8 100644
--- a/x86_64/configfrag.ac
+++ b/x86_64/configfrag.ac
@@ -39,6 +39,25 @@ case $host_platform in
*)]
AM_CONDITIONAL([PLATFORM_at], [false])[;;
esac]
+
+ncom=0
+nlpr=0
+[case $host_platform:$host_cpu in
+ at:x86_64)]
+ ncom=4
+ nlpr=1
+ AC_DEFINE([ATX86_64], [1], [ATX86_64])[;;
+ xen:x86_64)]
+ AC_DEFINE([ATX86_64], [1], [ATX86_64])[;;
+ *)
+ :;;
+esac]
+
+# i386/bogus/com.h
+AC_DEFINE_UNQUOTED([NCOM], [$ncom], [NCOM])
+
+# i386/bogus/lpr.h
+AC_DEFINE_UNQUOTED([NLPR], [$nlpr], [NLPR])
AC_DEFINE([PAE], [1], [PAE support])
AM_CONDITIONAL([enable_pae], [true])
diff --git a/x86_64/idt_inittab.S b/x86_64/idt_inittab.S
index 1b74f2ff..f021b56d 100644
--- a/x86_64/idt_inittab.S
+++ b/x86_64/idt_inittab.S
@@ -50,12 +50,12 @@ ENTRY(idt_inittab)
.quad entry ;\
.text
#else /* MACH_PV_DESCRIPTORS */
-#error TODO
#define IDT_ENTRY(n,entry,type) \
.data 2 ;\
- .long entry ;\
+ .quad entry ;\
.word n ;\
.word type ;\
+ .long 0 /*pad*/ ;\
.text
#endif /* MACH_PV_DESCRIPTORS */
diff --git a/x86_64/kdasm.S b/x86_64/kdasm.S
index 4ab4b9be..e1acf399 100644
--- a/x86_64/kdasm.S
+++ b/x86_64/kdasm.S
@@ -96,13 +96,13 @@ ENTRY(kd_slmwd)
#define from B_ARG0
#define to B_ARG1
-#define count %dx // B_ARG2
+#define count %edx // B_ARG2
ENTRY(kd_slmscu)
pushq %rbp
movq %rsp, %rbp
xchgq %rsi, %rdi
- movq count, %rcx
+ movl count, %ecx
cmpq %rdi, %rsi
cld
rep
@@ -119,7 +119,7 @@ ENTRY(kd_slmscd)
movq %rsp, %rbp
xchgq %rsi, %rdi
- movq count, %rcx
+ movl count, %ecx
cmpq %rdi, %rsi
std
rep