Lines Matching refs:seg
74 static void segmap_free(struct seg *seg);
75 faultcode_t segmap_fault(struct hat *hat, struct seg *seg, caddr_t addr,
77 static faultcode_t segmap_faulta(struct seg *seg, caddr_t addr);
78 static int segmap_checkprot(struct seg *seg, caddr_t addr, size_t len,
80 static int segmap_kluster(struct seg *seg, caddr_t addr, ssize_t);
81 static int segmap_getprot(struct seg *seg, caddr_t addr, size_t len,
83 static u_offset_t segmap_getoffset(struct seg *seg, caddr_t addr);
84 static int segmap_gettype(struct seg *seg, caddr_t addr);
85 static int segmap_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp);
86 static void segmap_dump(struct seg *seg);
87 static int segmap_pagelock(struct seg *seg, caddr_t addr, size_t len,
91 static int segmap_getmemid(struct seg *seg, caddr_t addr, memid_t *memidp);
92 static lgrp_mem_policy_info_t *segmap_getpolicy(struct seg *seg,
94 static int segmap_capable(struct seg *seg, segcapability_t capability);
97 static caddr_t segmap_pagecreate_kpm(struct seg *, vnode_t *, u_offset_t,
133 static void segmap_unlock(struct hat *hat, struct seg *seg, caddr_t addr,
175 #define MAP_PAGES(seg) ((seg)->s_size >> MAXBSHIFT) argument
180 #define MAP_PAGE(seg, addr) (((addr) - (seg)->s_base) >> MAXBSHIFT) argument
185 #define GET_SMAP(seg, addr) \ argument
186 &(((struct segmap_data *)((seg)->s_data))->smd_sm[MAP_PAGE(seg, addr)])
300 segmap_create(struct seg *seg, void *argsp) in segmap_create() argument
314 ASSERT(seg->s_as && RW_WRITE_HELD(&seg->s_as->a_lock)); in segmap_create()
316 if (((uintptr_t)seg->s_base | seg->s_size) & MAXBOFFSET) { in segmap_create()
323 seg->s_data = (void *)smd; in segmap_create()
324 seg->s_ops = &segmap_ops; in segmap_create()
378 npages = MAP_PAGES(seg); in segmap_create()
406 for (smp = &smd->smd_sm[MAP_PAGES(seg) - 1]; in segmap_create()
480 segmap_free(seg) in segmap_free() argument
481 struct seg *seg; in segmap_free()
483 ASSERT(seg->s_as && RW_WRITE_HELD(&seg->s_as->a_lock));
493 struct seg *seg, in segmap_unlock() argument
508 seg = seg; in segmap_unlock()
584 struct seg *seg, in segmap_fault() argument
590 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_fault()
678 smp = GET_SMAP(seg, addr); in segmap_fault()
699 segmap_unlock(hat, seg, addr, len, rw, smp); in segmap_fault()
704 "segmap_getpage:seg %p addr %p vp %p", seg, addr, vp); in segmap_fault()
706 seg, addr, rw, CRED(), NULL); in segmap_fault()
775 segmap_faulta(struct seg *seg, caddr_t addr) in segmap_faulta() argument
811 smp = GET_SMAP(seg, addr); in segmap_faulta()
824 "segmap_getpage:seg %p addr %p vp %p", seg, addr, vp); in segmap_faulta()
828 seg, addr, S_READ, CRED(), NULL); in segmap_faulta()
837 segmap_checkprot(struct seg *seg, caddr_t addr, size_t len, uint_t prot) in segmap_checkprot() argument
839 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_checkprot()
841 ASSERT(seg->s_as && RW_LOCK_HELD(&seg->s_as->a_lock)); in segmap_checkprot()
851 segmap_getprot(struct seg *seg, caddr_t addr, size_t len, uint_t *protv) in segmap_getprot() argument
853 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_getprot()
854 size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1; in segmap_getprot()
856 ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as)); in segmap_getprot()
867 segmap_getoffset(struct seg *seg, caddr_t addr) in segmap_getoffset() argument
869 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_getoffset()
871 ASSERT(seg->s_as && RW_READ_HELD(&seg->s_as->a_lock)); in segmap_getoffset()
873 return ((u_offset_t)smd->smd_sm->sm_off + (addr - seg->s_base)); in segmap_getoffset()
878 segmap_gettype(struct seg *seg, caddr_t addr) in segmap_gettype() argument
880 ASSERT(seg->s_as && RW_READ_HELD(&seg->s_as->a_lock)); in segmap_gettype()
887 segmap_getvp(struct seg *seg, caddr_t addr, struct vnode **vpp) in segmap_getvp() argument
889 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_getvp()
891 ASSERT(seg->s_as && RW_READ_HELD(&seg->s_as->a_lock)); in segmap_getvp()
907 segmap_kluster(struct seg *seg, caddr_t addr, ssize_t delta) in segmap_kluster() argument
1379 segmap_pagecreate(struct seg *seg, caddr_t addr, size_t len, int softlock) in segmap_pagecreate() argument
1381 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_pagecreate()
1392 ASSERT(seg->s_as == &kas); in segmap_pagecreate()
1421 smp = GET_SMAP(seg, addr); in segmap_pagecreate()
1441 PAGESIZE, PG_WAIT, seg, addr)) == NULL) { in segmap_pagecreate()
1486 seg, addr, pp, vp, off); in segmap_pagecreate()
1493 segmap_pageunlock(struct seg *seg, caddr_t addr, size_t len, enum seg_rw rw) in segmap_pageunlock() argument
1503 ASSERT(seg->s_as == &kas); in segmap_pageunlock()
1528 smp = GET_SMAP(seg, addr); in segmap_pageunlock()
1579 segmap_getmap(struct seg *seg, struct vnode *vp, u_offset_t off) in segmap_getmap() argument
1581 return (segmap_getmapflt(seg, vp, off, MAXBSIZE, 0, S_OTHER)); in segmap_getmap()
1600 struct seg *seg, in segmap_getmapflt() argument
1624 ASSERT(seg->s_as == &kas); in segmap_getmapflt()
1625 ASSERT(seg == segkmap); in segmap_getmapflt()
1830 baseaddr = segmap_pagecreate_kpm(seg, vp, baseoff, smp, rw); in segmap_getmapflt()
1899 seg, base, rw, CRED(), NULL); in segmap_getmapflt()
1956 baseaddr = seg->s_base + ((smp - smd_smap) * MAXBSIZE); in segmap_getmapflt()
1959 seg, baseaddr, vp, baseoff); in segmap_getmapflt()
1970 (void) segmap_fault(kas.a_hat, seg, pgaddr, in segmap_getmapflt()
1979 segmap_release(struct seg *seg, caddr_t addr, uint_t flags) in segmap_release() argument
2006 seg, addr, smp); in segmap_release()
2024 if (addr < seg->s_base || addr >= seg->s_base + seg->s_size || in segmap_release()
2029 smp = GET_SMAP(seg, addr); in segmap_release()
2033 seg, addr, smp); in segmap_release()
2131 segmap_dump(struct seg *seg) in segmap_dump() argument
2140 smd = (struct segmap_data *)seg->s_data; in segmap_dump()
2141 addr = seg->s_base; in segmap_dump()
2164 dump_addpage(seg->s_as, in segmap_dump()
2178 segmap_pagelock(struct seg *seg, caddr_t addr, size_t len, in segmap_pagelock() argument
2185 segmap_getmemid(struct seg *seg, caddr_t addr, memid_t *memidp) in segmap_getmemid() argument
2187 struct segmap_data *smd = (struct segmap_data *)seg->s_data; in segmap_getmemid()
2190 memidp->val[1] = smd->smd_sm->sm_off + (uintptr_t)(addr - seg->s_base); in segmap_getmemid()
2196 segmap_getpolicy(struct seg *seg, caddr_t addr) in segmap_getpolicy() argument
2203 segmap_capable(struct seg *seg, segcapability_t capability) in segmap_capable() argument
2216 segmap_pagecreate_kpm(struct seg *seg, vnode_t *vp, u_offset_t off, in segmap_pagecreate_kpm() argument
2232 seg, base)) == NULL) { in segmap_pagecreate_kpm()
2342 segmap_pagecreate_kpm(struct seg *seg, vnode_t *vp, u_offset_t off, in segmap_pagecreate_kpm() argument