Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: fallen/NetBSD
base: a71976319a13
...
head fork: fallen/NetBSD
compare: 637ee13c7aba
  • 3 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
14 sys/arch/lm32/include/intr.h
@@ -5,6 +5,20 @@
#include <lm32/psl.h>
+/* Define the various Interrupt Priority Levels */
+
+/* Hardware Interrupt Priority Levels are not mutually exclusive. */
+
+#define IPL_NONE 0
+#define IPL_SOFTCLOCK 1
+#define IPL_SOFTBIO 1
+#define IPL_SOFTNET 1
+#define IPL_SOFTSERIAL 1
+#define IPL_VM 1
+#define IPL_SCHED 1
+#define IPL_HIGH 1
+#define NIPL 2
+
static __inline int _get_irq_mask(void)
{
int mask;
View
15 sys/arch/lm32/include/pmap.h
@@ -2,6 +2,8 @@
#ifndef _LM32_PMAP_H_
#define _LM32_PMAP_H_
+#include <sys/resource.h>
+#include <uvm/uvm_page.h>
#if !defined(_LOCORE) && (defined(MODULAR) || defined(_MODULE))
@@ -9,6 +11,18 @@ __CTASSERT(sizeof(struct vm_page_md) == sizeof(uintptr_t)*5);
#endif /* !LOCORE && (MODULAR || _MODULE) */
+
+/*
+ * Pmap stuff
+ */
+struct pmap {
+ pt_entry_t *pm_ptab; /* KVA of page table */
+ u_int pm_count; /* pmap reference count */
+ struct pmap_statistics pm_stats; /* pmap statistics */
+ int pm_refcnt;
+ int pm_ptpages; /* more stats: PT pages */
+};
+
#define L2_SLOT_PTE (KERNBASE/NBPD_L2-1) /* 767: for recursive PDP map */
#define L2_SLOT_KERN (KERNBASE/NBPD_L2) /* 768: start of kernel space */
@@ -19,5 +33,6 @@ __CTASSERT(sizeof(struct vm_page_md) == sizeof(uintptr_t)*5);
void tlbflush(void);
void pmap_load(void);
+void pmap_reference(pmap_t pmap);
#endif /* !_LM32_PMAP_H_ */
View
36 sys/arch/lm32/lm32/pmap.c
@@ -2,6 +2,12 @@
* COPYRIGHT (C) 2013 Yann Sionneau <yann.sionneau@gmail.com>
*/
+#include <lm32/pmap.h>
+#include <sys/types.h>
+#include <lm32/cpu.h>
+#include <sys/systm.h>
+#include <uvm/uvm_map.h>
+#include <uvm/uvm_extern.h>
void tlbflush(void)
{
/* flush DTLB */
@@ -15,6 +21,13 @@ void tlbflush(void)
"wcsr tlbvaddr, r11" ::: "r11");
}
+void
+pmap_reference(pmap_t pmap)
+{
+
+ pmap->pm_refcnt++;
+}
+
/*
* pmap_load: perform the actual pmap switch
*
@@ -32,7 +45,6 @@ pmap_load(void)
struct pmap *pmap, *oldpmap;
struct lwp *l;
struct pcb *pcb;
- cpuid_t cid;
uint64_t ncsw;
kpreempt_disable();
@@ -55,18 +67,6 @@ pmap_load(void)
pcb = lwp_getpcb(l);
if (pmap == oldpmap) {
- if (!pmap_reactivate(pmap)) {
- u_int gen = uvm_emap_gen_return();
-
- /*
- * pmap has been changed during deactivated.
- * our tlb may be stale.
- */
-
- tlbflush();
- uvm_emap_update(gen);
- }
-
ci->ci_want_pmapload = 0;
kpreempt_enable();
return;
@@ -78,21 +78,11 @@ pmap_load(void)
pmap_reference(pmap);
- cid = cpu_index(ci);
- kcpuset_atomic_clear(oldpmap->pm_cpus, cid);
- kcpuset_atomic_clear(oldpmap->pm_kernel_cpus, cid);
-
- KASSERT(!kcpuset_isset(pmap->pm_cpus, cid));
- KASSERT(!kcpuset_isset(pmap->pm_kernel_cpus, cid));
-
/*
* Mark the pmap in use by this CPU. Again, we must synchronize
* with TLB shootdown interrupts, so set the state VALID first,
* then register us for shootdown events on this pmap.
*/
- ci->ci_tlbstate = TLBSTATE_VALID;
- kcpuset_atomic_set(pmap->pm_cpus, cid);
- kcpuset_atomic_set(pmap->pm_kernel_cpus, cid);
ci->ci_pmap = pmap;
View
4 sys/arch/milkymist/include/cpu.h
@@ -1,6 +1,10 @@
/* $NetBSD: cpu.h,v 1.3 2002/03/04 14:36:13 uch Exp $ */
+#ifndef _MACHINE_CPU_H_
+#define _MACHINE_CPU_H_
#define curcpu() (&cpu_info_store)
extern struct cpu_info cpu_info_store;
#include <lm32/cpu.h>
+
+#endif
View
13 sys/arch/milkymist/include/intr.h
@@ -40,19 +40,6 @@
#include <machine/cpu.h>
#include <lib/libkern/libkern.h>
-/* Define the various Interrupt Priority Levels */
-
-/* Hardware Interrupt Priority Levels are not mutually exclusive. */
-
-#define IPL_NONE 0
-#define IPL_SOFTCLOCK 1
-#define IPL_SOFTBIO 1
-#define IPL_SOFTNET 1
-#define IPL_SOFTSERIAL 1
-#define IPL_VM 1
-#define IPL_SCHED 1
-#define IPL_HIGH 1
-#define NIPL 2
#define USB_IRQ (0x00008000)
#define IR_IRQ (0x00004000)
View
4 sys/arch/milkymist/include/mutex.h
@@ -1,3 +1,7 @@
/* $NetBSD: mutex.h,v 1.2 2007/02/09 21:55:05 ad Exp $ */
+#ifndef _MACHINE_MUTEX_H_
+#define _MACHINE_MUTEX_H_
#include <lm32/mutex.h>
+
+#endif
View
5 sys/arch/milkymist/include/pmap.h
@@ -1,3 +1,8 @@
/* $NetBSD: pmap.h,v 1.45 2007/10/17 19:53:26 garbled Exp $ */
+#ifndef _MACHINE_PMAP_H_
+#define _MACHINE_PMAP_H_
+
#include <lm32/pmap.h>
+
+#endif

No commit comments for this range

Something went wrong with that request. Please try again.