Simplify the mapping of the system message buffer. Use the direct map just
like ia64 does.
This commit is contained in:
parent
c1f5e7308a
commit
040a1eeab2
@ -157,6 +157,8 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL);
|
|||||||
extern vm_offset_t ksym_start, ksym_end;
|
extern vm_offset_t ksym_start, ksym_end;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
struct msgbuf *msgbufp;
|
||||||
|
|
||||||
/* Intel ICH registers */
|
/* Intel ICH registers */
|
||||||
#define ICH_PMBASE 0x400
|
#define ICH_PMBASE 0x400
|
||||||
#define ICH_SMI_EN ICH_PMBASE + 0x30
|
#define ICH_SMI_EN ICH_PMBASE + 0x30
|
||||||
@ -1275,7 +1277,7 @@ add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp)
|
|||||||
static void
|
static void
|
||||||
getmemsize(caddr_t kmdp, u_int64_t first)
|
getmemsize(caddr_t kmdp, u_int64_t first)
|
||||||
{
|
{
|
||||||
int i, off, physmap_idx, pa_indx, da_indx;
|
int i, physmap_idx, pa_indx, da_indx;
|
||||||
vm_paddr_t pa, physmap[PHYSMAP_SIZE];
|
vm_paddr_t pa, physmap[PHYSMAP_SIZE];
|
||||||
u_long physmem_tunable;
|
u_long physmem_tunable;
|
||||||
pt_entry_t *pte;
|
pt_entry_t *pte;
|
||||||
@ -1508,9 +1510,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
|
|||||||
phys_avail[pa_indx] -= round_page(MSGBUF_SIZE);
|
phys_avail[pa_indx] -= round_page(MSGBUF_SIZE);
|
||||||
|
|
||||||
/* Map the message buffer. */
|
/* Map the message buffer. */
|
||||||
for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE)
|
msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]);
|
||||||
pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] +
|
|
||||||
off);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
u_int64_t
|
u_int64_t
|
||||||
|
@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
* and to when physical maps must be made correct.
|
* and to when physical maps must be made correct.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "opt_msgbuf.h"
|
|
||||||
#include "opt_pmap.h"
|
#include "opt_pmap.h"
|
||||||
#include "opt_vm.h"
|
#include "opt_vm.h"
|
||||||
|
|
||||||
@ -116,7 +115,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/lock.h>
|
#include <sys/lock.h>
|
||||||
#include <sys/malloc.h>
|
#include <sys/malloc.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/msgbuf.h>
|
|
||||||
#include <sys/mutex.h>
|
#include <sys/mutex.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
#include <sys/sx.h>
|
#include <sys/sx.h>
|
||||||
@ -206,7 +204,6 @@ static int shpgperproc = PMAP_SHPGPERPROC;
|
|||||||
*/
|
*/
|
||||||
pt_entry_t *CMAP1 = 0;
|
pt_entry_t *CMAP1 = 0;
|
||||||
caddr_t CADDR1 = 0;
|
caddr_t CADDR1 = 0;
|
||||||
struct msgbuf *msgbufp = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Crashdump maps.
|
* Crashdump maps.
|
||||||
@ -570,11 +567,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
|
|||||||
*/
|
*/
|
||||||
SYSMAP(caddr_t, unused, crashdumpmap, MAXDUMPPGS)
|
SYSMAP(caddr_t, unused, crashdumpmap, MAXDUMPPGS)
|
||||||
|
|
||||||
/*
|
|
||||||
* msgbufp is used to map the system message buffer.
|
|
||||||
*/
|
|
||||||
SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE)))
|
|
||||||
|
|
||||||
virtual_avail = va;
|
virtual_avail = va;
|
||||||
|
|
||||||
*CMAP1 = 0;
|
*CMAP1 = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user