/freebsd/sys/compat/linuxkpi/common/include/linux/ |
H A D | page.h | 67 pgprot2cachemode(pgprot_t prot) in pgprot2cachemode() argument 69 if (prot & LINUXKPI_PROT_VALID) in pgprot2cachemode() 70 return (prot >> LINUXKPI_CACHE_MODE_SHIFT); in pgprot2cachemode() 83 #define pgprot_noncached(prot) \ argument 84 (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_UNCACHEABLE)) 86 #define pgprot_writecombine(prot) \ argument 87 (((prot) & VM_PROT_ALL) | cachemode2protval(VM_MEMATTR_WRITE_COMBINING)) 89 #define pgprot_writecombine(prot) pgprot_noncached(prot) argument
|
H A D | highmem.h | 77 kmap_atomic_prot(struct page *page, pgprot_t prot) in kmap_atomic_prot() 79 vm_memattr_t attr = pgprot2cachemode(prot); in kmap_atomic_prot() 104 kmap_local_page_prot(struct page *page, pgprot_t prot) in kunmap() 107 return (kmap_atomic_prot(page, prot)); in kunmap() 76 kmap_atomic_prot(struct page * page,pgprot_t prot) kmap_atomic_prot() argument 97 kmap_local_page_prot(struct page * page,pgprot_t prot) kmap_local_page_prot() argument
|
H A D | mm.h | 202 vm_memattr_t prot) in io_remap_pfn_range() argument 204 vma->vm_page_prot = prot; in io_remap_pfn_range() 213 unsigned long pfn, pgprot_t prot); 217 unsigned long pfn, pgprot_t prot) in vmf_insert_pfn_prot() argument 222 ret = lkpi_vmf_insert_pfn_prot_locked(vma, addr, pfn, prot); in vmf_insert_pfn_prot() 243 pgprot_t prot); 247 unsigned long pfn, unsigned long size, pgprot_t prot) in remap_pfn_range() argument 249 return (lkpi_remap_pfn_range(vma, addr, pfn, size, prot)); in remap_pfn_range()
|
/freebsd/sys/compat/linux/ |
H A D | linux_mmap.c | 59 static void linux_fixup_prot(struct thread *td, int *prot); 63 linux_mmap_check_fp(struct file *fp, int flags, int prot, int maxprot) in linux_mmap_check_fp() 74 linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot, in linux_mmap_common() 83 addr, len, prot, flags, fd, pos); in linux_mmap_common() 128 linux_fixup_prot(td, &prot); in linux_mmap_common() 203 .mr_prot = prot, in linux_mmap_common() 226 linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) in linux_mprotect_common() 231 prot &= ~LINUX_PROT_GROWSUP; in linux_mprotect_common() 232 if ((prot & ~(LINUX_PROT_GROWSDOWN | PROT_READ | PROT_WRITE | in linux_mprotect_common() 235 if ((prot in linux_mprotect_common() 62 linux_mmap_check_fp(struct file * fp,int flags,int prot,int maxprot) linux_mmap_check_fp() argument 73 linux_mmap_common(struct thread * td,uintptr_t addr,size_t len,int prot,int flags,int fd,off_t pos) linux_mmap_common() argument 225 linux_mprotect_common(struct thread * td,uintptr_t addr,size_t len,int prot) linux_mprotect_common() argument 413 linux_fixup_prot(struct thread * td,int * prot) linux_fixup_prot() argument [all...] |
/freebsd/sys/vm/ |
H A D | vm_mmap.c | 136 int prot; member 151 .mr_prot = uap->prot, in sys_mmap() 159 kern_mmap_maxprot(struct proc *p, int prot) in kern_mmap_maxprot() argument 166 prot != PROT_NONE) in kern_mmap_maxprot() 167 return (prot); in kern_mmap_maxprot() 181 int align, error, fd, flags, max_prot, prot; in kern_mmap() local 187 prot = mrp->mr_prot; in kern_mmap() 193 if ((prot & ~(_PROT_ALL | PROT_MAX(_PROT_ALL))) != 0) in kern_mmap() 195 max_prot = PROT_MAX_EXTRACT(prot); in kern_mmap() 196 prot = PROT_EXTRACT(prot); in kern_mmap() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/safestack/ |
H A D | safestack_platform.h | 140 inline void *Mmap(void *addr, size_t length, int prot, int flags, int fd, in Mmap() argument 143 return __mmap(addr, length, prot, flags, fd, 0, offset); in Mmap() 145 return (void *)__syscall(SYS_mmap, addr, length, prot, flags, fd, offset); in Mmap() 147 return (void *)syscall(SYS_mmap, addr, length, prot, flags, fd, offset); in Mmap() 149 return _REAL64(mmap)(addr, length, prot, flags, fd, offset); in Mmap() 151 return (void *)syscall(SYS_mmap, addr, length, prot, flags, fd, offset); in Mmap() 155 return (void *)syscall(SYS_mmap2, addr, length, prot, flags, fd, in Mmap() 171 inline int Mprotect(void *addr, size_t length, int prot) { in Mprotect() argument 174 return _REAL(mprotect, addr, length, prot); in Mprotect() 176 return _REAL(mprotect)(addr, length, prot); in Mprotect() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/profile/ |
H A D | WindowsMMap.c | 28 void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) in mmap() argument 30 if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) in mmap() 39 if (prot & PROT_WRITE) { in mmap() 40 if (prot & PROT_EXEC) in mmap() 44 } else if (prot & PROT_EXEC) { in mmap() 45 if (prot & PROT_READ) in mmap() 47 else if (prot & PROT_EXEC) in mmap() 63 if (prot & PROT_WRITE) in mmap() 67 if (prot & PROT_EXEC) in mmap()
|
/freebsd/sys/netipsec/ |
H A D | ipsec_input.c | 351 int error, prot, af, sproto, isr_prot; in ipsec4_common_input_cb() 383 prot = ip->ip_p; in ipsec4_common_input_cb() 390 (prot == IPPROTO_UDP || prot == IPPROTO_TCP)) in ipsec4_common_input_cb() 391 udp_ipsec_adjust_cksum(m, sav, prot, skip); in ipsec4_common_input_cb() 404 if (prot == IPPROTO_IPIP && in ipsec4_common_input_cb() 416 else if (prot == IPPROTO_IPV6 && in ipsec4_common_input_cb() 427 else if (prot != IPPROTO_IPV6 && saidx->mode == IPSEC_MODE_ANY) { in ipsec4_common_input_cb() 431 * In other cases we assume transport mode. Set prot to in ipsec4_common_input_cb() 434 prot in ipsec4_common_input_cb() 345 int error, prot, af, sproto, isr_prot; ipsec4_common_input_cb() local 591 int prot, af, sproto; ipsec6_common_input_cb() local [all...] |
/freebsd/tools/test/stress2/misc/ |
H A D | mmap32.sh | 94 fuzz(int arg, void *addr, size_t len, int prot, int flags, int fd, 113 prot = makearg(); 125 prot = makearg(); 131 vp = mmap(addr, len, prot, flags, fd, offset); 151 int e, flags, fd, i, prot, status; 160 prot = PROT_READ | PROT_WRITE; 164 vp = mmap(addr, len, prot, flags, fd, offset); 175 fuzz(i + 1, addr, len, prot, flags, fd, 188 fuzz(34, addr, len, prot, flags, fd, offset);
|
/freebsd/contrib/tcpdump/ |
H A D | print-gre.c | 109 uint16_t flags, prot; in gre_print_0() local 123 prot = GET_BE_U_2(bp); in gre_print_0() 192 tok2str(ethertype_values,"unknown",prot), prot); in gre_print_0() 201 switch (prot) { in gre_print_0() 224 ND_PRINT("gre-proto-0x%x", prot); in gre_print_0() 236 uint16_t flags, prot; in gre_print_1() local 250 prot = GET_BE_U_2(bp); in gre_print_1() 290 tok2str(ethertype_values,"unknown",prot), prot); in gre_print_1() 302 switch (prot) { in gre_print_1() 307 ND_PRINT("gre-proto-0x%x", prot); in gre_print_1()
|
H A D | print-geneve.c | 149 uint16_t prot; in geneve_print() local 179 prot = GET_BE_U_2(bp); in geneve_print() 200 tok2str(ethertype_values, "unknown", prot), prot); in geneve_print() 231 if (ethertype_print(ndo, prot, bp, len, ND_BYTES_AVAILABLE_AFTER(bp), NULL, NULL) == 0) { in geneve_print() 232 if (prot == ETHERTYPE_TEB) in geneve_print() 235 ND_PRINT("geneve-proto-0x%x", prot); in geneve_print()
|
/freebsd/crypto/openssl/crypto/cmp/ |
H A D | cmp_protect.c | 33 ASN1_BIT_STRING *prot = NULL; in ossl_cmp_calc_protection() local 92 if ((prot = ASN1_BIT_STRING_new()) == NULL) in ossl_cmp_calc_protection() 95 prot->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT | 0x07); in ossl_cmp_calc_protection() 96 prot->flags |= ASN1_STRING_FLAG_BITS_LEFT; in ossl_cmp_calc_protection() 97 if (!ASN1_BIT_STRING_set(prot, protection, sig_len)) { in ossl_cmp_calc_protection() 98 ASN1_BIT_STRING_free(prot); in ossl_cmp_calc_protection() 99 prot = NULL; in ossl_cmp_calc_protection() 105 return prot; in ossl_cmp_calc_protection() 121 if ((prot = ASN1_BIT_STRING_new()) == NULL) in ossl_cmp_calc_protection() 124 NULL, prot, &prot_part, NULL, ctx->pkey, md, in ossl_cmp_calc_protection() [all …]
|
/freebsd/usr.bin/login/ |
H A D | login_fbtab.c | 86 int prot; in login_fbtab() local 101 || sscanf(cp, "%o", &prot) == 0 in login_fbtab() 102 || prot == 0 in login_fbtab() 103 || (prot & 0777) != prot in login_fbtab() 110 login_protect(table, cp, prot, uid, gid); in login_fbtab()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/dfsan/ |
H A D | dfsan_interceptors.cpp | 132 INTERCEPTOR(void *, mmap, void *addr, SIZE_T length, int prot, int flags, in INTERCEPTOR() argument 135 ReportMmapWriteExec(prot, flags); in INTERCEPTOR() 137 return (void *)internal_mmap(addr, length, prot, flags, fd, offset); in INTERCEPTOR() 138 COMMON_INTERCEPTOR_ENTER(mmap, addr, length, prot, flags, fd, offset); in INTERCEPTOR() 139 void *res = REAL(mmap)(addr, length, prot, flags, fd, offset); in INTERCEPTOR() 146 INTERCEPTOR(void *, mmap64, void *addr, SIZE_T length, int prot, int flags, in INTERCEPTOR() argument 149 ReportMmapWriteExec(prot, flags); in INTERCEPTOR() 151 return (void *)internal_mmap(addr, length, prot, flags, fd, offset); in INTERCEPTOR() 152 COMMON_INTERCEPTOR_ENTER(mmap64, addr, length, prot, flags, fd, offset); in INTERCEPTOR() 153 void *res = REAL(mmap64)(addr, length, prot, flags, fd, offset); in INTERCEPTOR()
|
/freebsd/sys/compat/linuxkpi/common/src/ |
H A D | linux_page.c | 214 vm_prot_t prot; in linux_get_user_pages_internal() local 218 prot = write ? (VM_PROT_READ | VM_PROT_WRITE) : VM_PROT_READ; in linux_get_user_pages_internal() 220 count = vm_fault_quick_hold_pages(map, start, len, prot, pages, nr_pages); in linux_get_user_pages_internal() 232 vm_prot_t prot; in __get_user_pages_fast() local 243 prot = write ? (VM_PROT_READ | VM_PROT_WRITE) : VM_PROT_READ; in __get_user_pages_fast() 246 *mp = pmap_extract_and_hold(map->pmap, va, prot); in __get_user_pages_fast() 250 if ((prot & VM_PROT_WRITE) != 0 && in __get_user_pages_fast() 298 unsigned long pfn, pgprot_t prot) in lkpi_vmf_insert_pfn_prot_locked() argument 349 pmap_page_set_memattr(page, pgprot2cachemode(prot)); in lkpi_vmf_insert_pfn_prot_locked() 357 unsigned long start_pfn, unsigned long size, pgprot_t prot) in lkpi_remap_pfn_range() argument [all …]
|
/freebsd/lib/libkvm/ |
H A D | kvm_minidump_i386.c | 252 vm_prot_t prot = VM_PROT_READ; in _i386_entry_to_prot() local 256 prot |= VM_PROT_WRITE; in _i386_entry_to_prot() 258 prot |= VM_PROT_EXECUTE; in _i386_entry_to_prot() 260 return prot; in _i386_entry_to_prot() 286 vm_prot_t *prot) in _i386_iterator_next() argument 297 *prot = 0; in _i386_iterator_next() 303 *prot = _i386_entry_to_prot(pte64); in _i386_iterator_next() 309 *prot = _i386_entry_to_prot(pte32); in _i386_iterator_next() 323 vm_prot_t prot; in _i386_minidump_walk_pages() local 326 while (_i386_iterator_next(&it, &pa, &va, &dva, &prot)) { in _i386_minidump_walk_pages() [all …]
|
/freebsd/sys/dev/mlx4/mlx4_core/ |
H A D | mlx4_mcg.c | 158 u32 prot; in new_steering_entry() local 206 prot = be32_to_cpu(mgm->members_count) >> 30; in new_steering_entry() 221 mgm->members_count = cpu_to_be32(members_count | (prot << 30)); in new_steering_entry() 428 u32 prot; in add_promisc_qp() local 474 prot = be32_to_cpu(mgm->members_count) >> 30; in add_promisc_qp() 505 (prot << 30)); in add_promisc_qp() 695 u8 *gid, enum mlx4_protocol prot, in find_entry() argument 704 u8 op_mod = (prot == MLX4_PROT_ETH) ? in find_entry() 741 be32_to_cpu(mgm->members_count) >> 30 == prot) in find_entry() 1105 int block_mcast_loopback, enum mlx4_protocol prot, in mlx4_qp_attach_common() argument [all …]
|
/freebsd/sys/crypto/ccp/ |
H A D | ccp_hardware.h | 274 uint32_t prot:1; member 288 uint32_t prot:1; member 302 uint32_t prot:1; member 315 uint32_t prot:1; member 327 uint32_t prot:1; member 341 uint32_t prot:1; member 353 uint32_t prot:1; member 366 uint32_t prot:1; member 377 uint32_t prot:1; member
|
/freebsd/sys/arm64/arm64/ |
H A D | mem.c | 52 vm_prot_t prot; in memrw() local 84 prot = VM_PROT_READ; in memrw() 87 prot = VM_PROT_WRITE; in memrw() 91 if (!kernacc((void *)v, cnt, prot)) { in memrw() 130 int prot __unused, vm_memattr_t *memattr __unused) in memmmap()
|
/freebsd/sys/riscv/riscv/ |
H A D | mem.c | 53 vm_prot_t prot; in memrw() local 85 prot = VM_PROT_READ; in memrw() 88 prot = VM_PROT_WRITE; in memrw() 92 if (!kernacc((void *)v, cnt, prot)) { in memrw() 137 int prot __unused, vm_memattr_t *memattr __unused) in memmmap()
|
/freebsd/sys/dev/xdma/ |
H A D | xdma_iommu.c | 78 vm_paddr_t pa, vm_size_t size, vm_prot_t prot) in xdma_iommu_enter() argument 90 pmap_enter(p, va, m, prot, prot | PMAP_ENTER_WIRED, 0); in xdma_iommu_enter() 101 vm_paddr_t pa, vm_size_t size, vm_prot_t prot) in xdma_iommu_add_entry() argument 119 xdma_iommu_enter(xio, addr, pa, size, prot); in xdma_iommu_add_entry()
|
/freebsd/contrib/netbsd-tests/lib/libc/sys/ |
H A D | t_mprotect.c | 114 int prot[2] = { PROT_NONE, PROT_READ }; in ATF_TC_BODY() local 126 for (i = 0; i < __arraycount(prot); i++) { in ATF_TC_BODY() 128 map = mmap(NULL, page, prot[i], MAP_SHARED, fd, 0); in ATF_TC_BODY() 262 const int prot[4] = { PROT_NONE, PROT_READ, PROT_WRITE }; in ATF_TC_BODY() local 291 for (i = 0; i < __arraycount(prot); i++) { in ATF_TC_BODY() 293 map = mmap(NULL, page, prot[i], MAP_ANON, -1, 0); in ATF_TC_BODY() 298 rv = mprotect(map, 1, prot[i] | PROT_EXEC); in ATF_TC_BODY()
|
/freebsd/sys/sys/ |
H A D | mman.h | 57 #define PROT_EXTRACT(prot) ((prot) & _PROT_ALL) argument 60 #define PROT_MAX(prot) ((prot) << _PROT_MAX_SHIFT) argument 61 #define PROT_MAX_EXTRACT(prot) (((prot) >> _PROT_MAX_SHIFT) & _PROT_ALL) argument
|
/freebsd/sys/amd64/amd64/ |
H A D | mem.c | 82 vm_prot_t prot; in memrw() local 116 prot = VM_PROT_READ; in memrw() 119 prot = VM_PROT_WRITE; in memrw() 123 if (!kernacc((void *)v, c, prot)) { in memrw() 177 int prot __unused, vm_memattr_t *memattr __unused) in memmmap()
|
/freebsd/contrib/ntp/sntp/libopts/ |
H A D | text_mmap.c | 168 validate_mmap(char const * fname, int prot, int flags, tmap_info_t * mapinfo) in validate_mmap() argument 175 mapinfo->txt_prot = prot; in validate_mmap() 192 FILE_WRITABLE(prot, flags) ? O_RDWR : O_RDONLY; in validate_mmap() 198 if (((flags & MAP_SHARED) == 0) && (prot & PROT_WRITE)) in validate_mmap() 310 text_mmap(char const * pzFile, int prot, int flags, tmap_info_t * mi) in text_mmap() argument 312 validate_mmap(pzFile, prot, flags, mi); in text_mmap()
|