diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-06-08 20:13:24 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-06-08 20:13:24 +0000 |
commit | c597a670473f8451528648ba378944c4cbcf2d36 (patch) | |
tree | fbb4edbd38d5ed39037ced42493c12ffff304dc1 /sys/arch | |
parent | b3f24646e2fb015bc166f8f92151871622fb9c02 (diff) |
Use cpuid_t whenever possible, rather than an angry combination of long
there and u_long elsewhere.
ok marc@ deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/cpu.c | 6 | ||||
-rw-r--r-- | sys/arch/alpha/alpha/pmap.c | 65 | ||||
-rw-r--r-- | sys/arch/alpha/include/cpu.h | 4 |
3 files changed, 38 insertions, 37 deletions
diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c index 9c04de2d4c8..a8045be3246 100644 --- a/sys/arch/alpha/alpha/cpu.c +++ b/sys/arch/alpha/alpha/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.17 2004/01/13 06:21:09 deraadt Exp $ */ +/* $OpenBSD: cpu.c,v 1.18 2004/06/08 20:13:21 miod Exp $ */ /* $NetBSD: cpu.c,v 1.44 2000/05/23 05:12:53 thorpej Exp $ */ /*- @@ -541,7 +541,7 @@ cpu_hatch(ci) int cpu_iccb_send(cpu_id, msg) - long cpu_id; + cpuid_t cpu_id; const char *msg; { struct pcs *pcsp = LOCATE_PCS(hwrpb, cpu_id); @@ -588,7 +588,7 @@ cpu_iccb_receive() char *cp1, *cp2, buf[80]; struct pcs *pcsp; u_int cnt; - long cpu_id; + cpuid_t cpu_id; txrdy = hwrpb->rpb_txrdy; diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index 7d51dca2101..d8860e84b38 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.40 2003/12/22 19:59:37 jmc Exp $ */ +/* $OpenBSD: pmap.c,v 1.41 2004/06/08 20:13:21 miod Exp $ */ /* $NetBSD: pmap.c,v 1.154 2000/12/07 22:18:55 thorpej Exp $ */ /*- @@ -492,21 +492,21 @@ struct prm_thief { void alpha_protection_init(void); void pmap_do_remove(pmap_t, vaddr_t, vaddr_t, boolean_t); boolean_t pmap_remove_mapping(pmap_t, vaddr_t, pt_entry_t *, - boolean_t, long, struct prm_thief *); -void pmap_changebit(paddr_t, pt_entry_t, pt_entry_t, long); + boolean_t, cpuid_t, struct prm_thief *); +void pmap_changebit(paddr_t, pt_entry_t, pt_entry_t, cpuid_t); /* * PT page management functions. */ -int pmap_lev1map_create(pmap_t, long); -void pmap_lev1map_destroy(pmap_t, long); +int pmap_lev1map_create(pmap_t, cpuid_t); +void pmap_lev1map_destroy(pmap_t, cpuid_t); int pmap_ptpage_alloc(pmap_t, pt_entry_t *, int); boolean_t pmap_ptpage_steal(pmap_t, int, paddr_t *); void pmap_ptpage_free(pmap_t, pt_entry_t *, pt_entry_t **); -void pmap_l3pt_delref(pmap_t, vaddr_t, pt_entry_t *, long, +void pmap_l3pt_delref(pmap_t, vaddr_t, pt_entry_t *, cpuid_t, pt_entry_t **); -void pmap_l2pt_delref(pmap_t, pt_entry_t *, pt_entry_t *, long); -void pmap_l1pt_delref(pmap_t, pt_entry_t *, long); +void pmap_l2pt_delref(pmap_t, pt_entry_t *, pt_entry_t *, cpuid_t); +void pmap_l1pt_delref(pmap_t, pt_entry_t *, cpuid_t); void *pmap_l1pt_alloc(struct pool *, int); void pmap_l1pt_free(struct pool *, void *); @@ -537,7 +537,7 @@ void pmap_pv_dump(paddr_t); /* * ASN management functions. */ -void pmap_asn_alloc(pmap_t, long); +void pmap_asn_alloc(pmap_t, cpuid_t); /* * Misc. functions. @@ -1367,7 +1367,7 @@ pmap_do_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva, boolean_t dowired) pt_entry_t *saved_l1pte, *saved_l2pte, *saved_l3pte; vaddr_t l1eva, l2eva, vptva; boolean_t needisync = FALSE; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); #ifdef DEBUG if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT)) @@ -1528,7 +1528,7 @@ pmap_page_protect(struct vm_page *pg, vm_prot_t prot) struct pv_head *pvh; pv_entry_t pv, nextpv; boolean_t needkisync = FALSE; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); paddr_t pa = VM_PAGE_TO_PHYS(pg); #ifdef DEBUG @@ -1611,7 +1611,7 @@ pmap_protect(pmap_t pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot) boolean_t isactive; boolean_t hadasm; vaddr_t l1eva, l2eva; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); #ifdef DEBUG if (pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) @@ -1702,7 +1702,7 @@ pmap_enter(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, int flags) boolean_t setisync = FALSE; boolean_t isactive; boolean_t wired; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); int error = 0; #ifdef DEBUG @@ -2013,7 +2013,7 @@ void pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot) { pt_entry_t *pte, npte; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); boolean_t needisync = FALSE; pmap_t pmap = pmap_kernel(); @@ -2077,7 +2077,7 @@ pmap_kremove(vaddr_t va, vsize_t size) { pt_entry_t *pte; boolean_t needisync = FALSE; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); pmap_t pmap = pmap_kernel(); #ifdef DEBUG @@ -2283,7 +2283,7 @@ void pmap_activate(struct proc *p) { struct pmap *pmap = p->p_vmspace->vm_map.pmap; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) @@ -2433,7 +2433,7 @@ pmap_clear_modify(struct vm_page *pg) struct pv_head *pvh; paddr_t pa = VM_PAGE_TO_PHYS(pg); boolean_t rv = FALSE; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) @@ -2468,7 +2468,7 @@ pmap_clear_reference(struct vm_page *pg) struct pv_head *pvh; paddr_t pa = VM_PAGE_TO_PHYS(pg); boolean_t rv = FALSE; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) @@ -2630,7 +2630,7 @@ alpha_protection_init(void) */ boolean_t pmap_remove_mapping(pmap_t pmap, vaddr_t va, pt_entry_t *pte, - boolean_t dolock, long cpu_id, struct prm_thief *prmt) + boolean_t dolock, cpuid_t cpu_id, struct prm_thief *prmt) { paddr_t pa; boolean_t onpv; @@ -2754,7 +2754,7 @@ pmap_remove_mapping(pmap_t pmap, vaddr_t va, pt_entry_t *pte, * XXX optimization done. */ void -pmap_changebit(paddr_t pa, u_long set, u_long mask, long cpu_id) +pmap_changebit(paddr_t pa, u_long set, u_long mask, cpuid_t cpu_id) { struct pv_head *pvh; pv_entry_t pv; @@ -2844,7 +2844,7 @@ pmap_emulate_reference(struct proc *p, vaddr_t v, int user, int type) paddr_t pa; struct pv_head *pvh; boolean_t didlock = FALSE; - long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); #ifdef DEBUG if (pmapdebug & PDB_FOLLOW) @@ -3141,7 +3141,7 @@ pmap_pv_alloc(void) int bank, npg, pg; pt_entry_t *pte; pmap_t pvpmap; - u_long cpu_id; + cpuid_t cpu_id; struct prm_thief prmt; pv = pool_get(&pmap_pv_pool, PR_NOWAIT); @@ -3504,7 +3504,7 @@ pmap_growkernel(vaddr_t maxkvaddr) * Note: the pmap must already be locked. */ int -pmap_lev1map_create(pmap_t pmap, long cpu_id) +pmap_lev1map_create(pmap_t pmap, cpuid_t cpu_id) { pt_entry_t *l1pt; @@ -3547,7 +3547,7 @@ pmap_lev1map_create(pmap_t pmap, long cpu_id) * Note: the pmap must already be locked. */ void -pmap_lev1map_destroy(pmap_t pmap, long cpu_id) +pmap_lev1map_destroy(pmap_t pmap, cpuid_t cpu_id) { pt_entry_t *l1pt = pmap->pm_lev1map; @@ -3746,7 +3746,7 @@ pmap_ptpage_steal(pmap_t pmap, int usage, paddr_t *pap) vaddr_t va; paddr_t pa; struct prm_thief prmt; - u_long cpu_id = cpu_number(); + cpuid_t cpu_id = cpu_number(); boolean_t needisync = FALSE; prmt.prmt_flags = PRMT_PTP; @@ -3880,7 +3880,7 @@ pmap_ptpage_steal(pmap_t pmap, int usage, paddr_t *pap) * Note: the pmap must already be locked. */ void -pmap_l3pt_delref(pmap_t pmap, vaddr_t va, pt_entry_t *l3pte, long cpu_id, +pmap_l3pt_delref(pmap_t pmap, vaddr_t va, pt_entry_t *l3pte, cpuid_t cpu_id, pt_entry_t **ptp) { pt_entry_t *l1pte, *l2pte; @@ -3937,7 +3937,7 @@ pmap_l3pt_delref(pmap_t pmap, vaddr_t va, pt_entry_t *l3pte, long cpu_id, */ void pmap_l2pt_delref(pmap_t pmap, pt_entry_t *l1pte, pt_entry_t *l2pte, - long cpu_id) + cpuid_t cpu_id) { #ifdef DIAGNOSTIC @@ -3975,7 +3975,7 @@ pmap_l2pt_delref(pmap_t pmap, pt_entry_t *l1pte, pt_entry_t *l2pte, * Note: the pmap must already be locked. */ void -pmap_l1pt_delref(pmap_t pmap, pt_entry_t *l1pte, long cpu_id) +pmap_l1pt_delref(pmap_t pmap, pt_entry_t *l1pte, cpuid_t cpu_id) { #ifdef DIAGNOSTIC @@ -4002,7 +4002,7 @@ pmap_l1pt_delref(pmap_t pmap, pt_entry_t *l1pte, long cpu_id) * Note: the pmap must already be locked. */ void -pmap_asn_alloc(pmap_t pmap, long cpu_id) +pmap_asn_alloc(pmap_t pmap, cpuid_t cpu_id) { #ifdef DEBUG @@ -4139,7 +4139,8 @@ pmap_asn_alloc(pmap_t pmap, long cpu_id) void pmap_tlb_shootdown(pmap_t pmap, vaddr_t va, pt_entry_t pte) { - u_long i, ipinum, cpu_id = cpu_number(); + u_long ipinum; + cpuid_t i, cpu_id = cpu_number(); struct pmap_tlb_shootdown_q *pq; struct pmap_tlb_shootdown_job *pj; int s; @@ -4186,7 +4187,7 @@ pmap_tlb_shootdown(pmap_t pmap, vaddr_t va, pt_entry_t pte) void pmap_do_tlb_shootdown(struct cpu_info *ci, struct trapframe *framep) { - u_long cpu_id = ci->ci_cpuid; + cpuid_t cpu_id = ci->ci_cpuid; u_long cpu_mask = (1UL << cpu_id); struct pmap_tlb_shootdown_q *pq = &pmap_tlb_shootdown_q[cpu_id]; struct pmap_tlb_shootdown_job *pj; @@ -4214,7 +4215,7 @@ pmap_do_tlb_shootdown(struct cpu_info *ci, struct trapframe *framep) * function. */ void -pmap_tlb_shootdown_q_drain(u_long cpu_id, boolean_t all) +pmap_tlb_shootdown_q_drain(cpuid_t cpu_id, boolean_t all) { struct pmap_tlb_shootdown_q *pq = &pmap_tlb_shootdown_q[cpu_id]; struct pmap_tlb_shootdown_job *pj, *npj; diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h index b26e5fa6c8a..7bfc81c4624 100644 --- a/sys/arch/alpha/include/cpu.h +++ b/sys/arch/alpha/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.23 2004/06/08 18:11:28 marc Exp $ */ +/* $OpenBSD: cpu.h,v 1.24 2004/06/08 20:13:23 miod Exp $ */ /* $NetBSD: cpu.h,v 1.45 2000/08/21 02:03:12 thorpej Exp $ */ /*- @@ -160,7 +160,7 @@ void synchronize_fpstate(struct proc *, int); /* Multiprocessor glue; cpu.c */ struct cpu_info; -int cpu_iccb_send(long, const char *); +int cpu_iccb_send(cpuid_t, const char *); void cpu_iccb_receive(void); void cpu_hatch(struct cpu_info *); void cpu_halt_secondary(unsigned long); |