Add sdtossd() by HOSOKAWA Tatsumi, and a C version of ssdtosd() by me.

This commit is contained in:
mycroft 1994-11-05 02:47:02 +00:00
parent 600aa2c5f8
commit 867ac5e15f
2 changed files with 33 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.90 1994/10/27 04:15:24 cgd Exp $ */
/* $NetBSD: locore.s,v 1.91 1994/11/05 02:47:02 mycroft Exp $ */
#undef DIAGNOSTIC
#define DIAGNOSTIC
@ -1417,27 +1417,6 @@ ENTRY(rtcin)
inb $0x71,%al
ret
# ssdtosd(*ssdp,*sdp)
ENTRY(ssdtosd)
pushl %ebx
movl 8(%esp),%ecx
movl 8(%ecx),%ebx
shll $16,%ebx
movl (%ecx),%edx
roll $16,%edx
movb %dh,%bl
movb %dl,%bh
rorl $8,%ebx
movl 4(%ecx),%eax
movw %ax,%dx
andl $0xf0000,%eax
orl %eax,%ebx
movl 12(%esp),%ecx
movl %edx,(%ecx)
movl %ebx,4(%ecx)
popl %ebx
ret
ENTRY(setjmp)
movl 4(%esp),%eax
movl %ebx,(%eax) # save ebx

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.128 1994/11/04 00:44:32 mycroft Exp $ */
/* $NetBSD: machdep.c,v 1.129 1994/11/05 02:47:06 mycroft Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles Hannum.
@ -1055,11 +1055,41 @@ extern IDTVEC(div), IDTVEC(dbg), IDTVEC(nmi), IDTVEC(bpt),
IDTVEC(fpu), IDTVEC(align),
IDTVEC(syscall), IDTVEC(osyscall);
void
sdtossd(sd, ssd)
struct segment_descriptor *sd;
struct soft_segment_descriptor *ssd;
{
ssd->ssd_base = (sd->sd_hibase << 24) | sd->sd_lobase;
ssd->ssd_limit = (sd->sd_hilimit << 16) | sd->sd_lolimit;
ssd->ssd_type = sd->sd_type;
ssd->ssd_dpl = sd->sd_dpl;
ssd->ssd_p = sd->sd_p;
ssd->ssd_def32 = sd->sd_def32;
ssd->ssd_gran = sd->sd_gran;
}
void
ssdtosd(ssd, sd)
struct soft_segment_descriptor *ssd;
struct segment_descriptor *sd;
{
sd->sd_lobase = ssd->ssd_base;
sd->sd_hibase = ssd->ssd_base >> 24;
sd->sd_lolimit = ssd->ssd_limit;
sd->sd_hilimit = ssd->ssd_limit >> 16;
sd->sd_type = ssd->ssd_type;
sd->sd_dpl = ssd->ssd_dpl;
sd->sd_p = ssd->ssd_p;
sd->sd_def32 = ssd->ssd_def32;
sd->sd_gran = ssd->ssd_gran;
}
void
init386(first_avail)
vm_offset_t first_avail;
{
extern ssdtosd(), lgdt(), etext;
extern lgdt(), etext;
int x, *pi;
unsigned biosbasemem, biosextmem;
struct gate_descriptor *gdp;