Lines Matching defs:protection

279 	int protection, int protectionMax, int mapping, uint32 flags,
282 static void fix_protection(uint32* protection);
491 uint32 areaProtection = area->protection
500 set_area_page_protection(VMArea* area, addr_t pageAddress, uint32 protection)
502 protection &= B_READ_AREA | B_WRITE_AREA | B_EXECUTE_AREA;
506 entry = (entry & 0xf0) | protection;
508 entry = (entry & 0x0f) | (protection << 4);
516 return area->protection;
519 uint32 protection = area->page_protections[pageIndex / 2];
521 protection &= 0x0f;
523 protection >>= 4;
526 if ((protection & B_READ_AREA) != 0)
528 if ((protection & B_WRITE_AREA) != 0)
535 return protection | kernelProtection;
553 map_page(VMArea* area, vm_page* page, addr_t address, uint32 protection,
576 map->Map(address, page->physical_page_number * B_PAGE_SIZE, protection,
591 map->Map(address, page->physical_page_number * B_PAGE_SIZE, protection,
832 area->protection & B_OVERCOMMITTING_AREA, 0, 0,
862 area->protection, area->protection_max, REGION_NO_PRIVATE_MAP, 0,
897 area->name, secondSize, area->wiring, area->protection,
911 // Copy the protection bits of the first area.
917 // Shift the protection bits of the second area to the start of
924 // Copy the protection bits of the second area.
971 if ((area->protection & B_KERNEL_AREA) != 0) {
1052 const char* areaName, addr_t size, int wiring, int protection,
1059 ", protection %d, protectionMax %d, area %p, areaName '%s'\n",
1061 addressRestrictions->address_specification, wiring, protection,
1086 VMArea* area = addressSpace->CreateArea(areaName, wiring, protection,
1103 (protection & B_STACK_AREA) != 0
1104 || (protection & B_OVERCOMMITTING_AREA) != 0, 0,
1317 Sets protection for the given address range to the protection specified.
1318 If \a protection is 0 then the involved pages will be marked non-present
1329 uint32 protection)
1342 // Translate the kernel protection to user protection as we only store that.
1343 if ((protection & B_KERNEL_READ_AREA) != 0)
1344 protection |= B_READ_AREA;
1345 if ((protection & B_KERNEL_WRITE_AREA) != 0)
1346 protection |= B_WRITE_AREA;
1366 map->DebugMarkRangePresent(address, address + size, protection != 0);
1373 set_area_page_protection(area, pageAddress, protection);
1460 uint32 wiring, uint32 protection, uint32 flags, addr_t guardSize,
1468 bool isStack = (protection & B_STACK_AREA) != 0;
1483 if (!arch_vm_supports_protection(protection))
1491 if (isStack || (protection & B_OVERCOMMITTING_AREA) != 0)
1495 if ((protection & B_KERNEL_STACK_AREA) != 0)
1679 protection, 0, REGION_NO_PRIVATE_MAP, flags,
1716 map_page(area, page, address, protection, &reservation);
1786 status = map->Map(virtualAddress, physicalAddress, protection,
1841 uint32 addressSpec, addr_t size, uint32 protection,
1849 ", spec = %" B_PRIu32 ", size = %" B_PRIxADDR ", protection = %"
1851 addressSpec, size, protection, physicalAddress));
1853 if (!arch_vm_supports_protection(protection))
1881 B_FULL_LOCK, protection, 0, REGION_NO_PRIVATE_MAP, 0, &addressRestrictions,
1911 map->ProtectArea(area, area->protection);
1928 protection, area->MemoryType(), &reservation);
1952 uint32 addressSpec, addr_t* _size, uint32 protection,
1956 "= %p, spec = %" B_PRIu32 ", _size = %p, protection = %" B_PRIu32 ", "
1958 addressSpec, _size, protection, vecs, vecCount));
1960 if (!arch_vm_supports_protection(protection)
1997 size, B_FULL_LOCK, protection, 0, REGION_NO_PRIVATE_MAP, 0,
2030 protection, area->MemoryType(), &reservation);
2144 uint32 addressSpec, size_t size, uint32 protection, uint32 mapping,
2158 protection |= B_SHARED_AREA;
2171 return vm_create_anonymous_area(team, name, size, B_NO_LOCK, protection,
2187 && (protection & (B_WRITE_AREA | B_KERNEL_WRITE_AREA)) != 0
2195 protectionMax = protection | B_USER_PROTECTION;
2197 protectionMax = protection | (B_USER_PROTECTION & ~B_WRITE_AREA);
2201 if ((protection & B_WRITE_AREA) == 0)
2216 if ((protection & B_READ_AREA) != 0) {
2271 0, protection, protectionMax, mapping, mappingFlags,
2279 if (status == B_OK && (protection & B_READ_AREA) != 0)
2301 addr_t size, uint32 protection, uint32 mapping, bool unmapAddressRange,
2304 if (!arch_vm_supports_protection(protection))
2307 return _vm_map_file(aid, name, address, addressSpec, size, protection,
2349 uint32 addressSpec, uint32 protection, uint32 mapping, area_id sourceID,
2363 if (!kernel && (sourceArea->protection & B_KERNEL_AREA) != 0)
2366 sourceArea->protection |= B_SHARED_AREA;
2367 protection |= B_SHARED_AREA;
2391 if (!kernel && (sourceArea->protection & B_KERNEL_AREA) != 0)
2397 && (sourceArea->protection & B_CLONEABLE_AREA) == 0) {
2412 sourceArea->wiring, protection, sourceArea->protection_max,
2450 protection, newArea->MemoryType(), &reservation);
2472 protection, &reservation);
2571 if (!kernel && (area->protection & B_KERNEL_AREA) != 0)
2580 the old cache to the new one, and changes the protection of all affected
2628 // pages, we keep their protection, move them to the upper cache and create
2651 // Change the protection of this page in all areas.
2660 uint32 protection = 0;
2663 protection |= B_KERNEL_READ_AREA;
2665 protection |= B_READ_AREA;
2670 map->ProtectPage(tempArea, address, protection);
2678 // just change the protection of all areas
2682 // Change the protection of all pages in this area.
2693 uint32 protection = 0;
2696 protection |= B_KERNEL_READ_AREA;
2698 protection |= B_READ_AREA;
2700 map->ProtectPage(tempArea, address, protection);
2707 uint32 protection = 0;
2708 if ((tempArea->protection & B_KERNEL_READ_AREA) != 0)
2709 protection |= B_KERNEL_READ_AREA;
2710 if ((tempArea->protection & B_READ_AREA) != 0)
2711 protection |= B_READ_AREA;
2715 map->ProtectArea(tempArea, protection);
2758 sharedArea = (source->protection & B_SHARED_AREA) != 0;
2803 = (source->protection & (B_KERNEL_WRITE_AREA | B_WRITE_AREA)) != 0;
2841 name, source->Size(), source->wiring, source->protection,
2884 ", protection = %#" B_PRIx32 ")\n", team, areaID, newProtection));
2912 || (area->protection & B_KERNEL_AREA) != 0)) {
2914 "set protection %#" B_PRIx32 " on kernel area %" B_PRId32
2922 "set protection %#" B_PRIx32 " (max %#" B_PRIx32 ") on kernel "
2931 // the protection of your own areas
2935 if (area->protection == newProtection)
2939 = (area->protection & (B_WRITE_AREA | B_KERNEL_WRITE_AREA)) != 0;
2985 == (area->protection & ~(B_WRITE_AREA | B_KERNEL_WRITE_AREA))
3008 // protection or we might allow writing into pages belonging to
3041 area->protection = newProtection;
3639 kprintf("protection:\t0x%" B_PRIx32 "\n", area->protection);
3759 area->protection, area->wiring, area->name);
3960 if (!kernel && (area->protection & (B_READ_AREA | B_WRITE_AREA)) == 0
3961 && (area->protection & B_KERNEL_AREA) != 0)
4405 vm_block_address_range("overflow protection", lastPage, B_PAGE_SIZE);
4901 uint32 protection = get_area_page_protection(area, address);
4902 if (isUser && (protection & B_USER_PROTECTION) == 0
4903 && (area->protection & B_KERNEL_AREA) != 0) {
4911 if (isWrite && (protection
4919 } else if (isExecute && (protection
4927 } else if (!isWrite && !isExecute && (protection
4975 uint32 newProtection = protection;
4993 // its protection. Otherwise we have to unmap it.
5261 map->ProtectArea(area, area->protection);
5270 map->ProtectArea(area, area->protection);
5280 /*! This function enforces some protection properties:
5286 fix_protection(uint32* protection)
5288 if ((*protection & B_KERNEL_EXECUTE_AREA) != 0
5289 && ((*protection & B_KERNEL_WRITE_AREA) != 0
5290 || (*protection & B_WRITE_AREA) != 0)
5294 if ((*protection & B_KERNEL_PROTECTION) == 0) {
5295 if ((*protection & B_WRITE_AREA) != 0)
5296 *protection |= B_KERNEL_WRITE_AREA;
5297 if ((*protection & B_READ_AREA) != 0)
5298 *protection |= B_KERNEL_READ_AREA;
5310 info->protection = area->protection;
5358 || (area->protection & B_KERNEL_AREA) != 0)) {
5448 uint32 areaProtection = area->protection
5704 // compute the page protection that is required
5854 // compute the page protection that is required
6013 // compute the page protection that is required
6362 status = set_area_protection(id, info.protection | B_CLONEABLE_AREA);
6367 addressSpec, info.protection, REGION_NO_PRIVATE_MAP, id, kernel);
6377 // Now we can reset the protection to whatever it was before.
6378 set_area_protection(clonedArea, info.protection);
6388 size_t numBytes, uint32 addressSpec, uint32 protection,
6391 if (!arch_vm_supports_protection(protection))
6394 fix_protection(&protection);
6397 _virtualAddress, addressSpec, numBytes, protection, physicalAddress,
6404 uint32 protection, area_id source)
6406 if ((protection & B_KERNEL_PROTECTION) == 0)
6407 protection |= B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA;
6410 addressSpec, protection, REGION_NO_PRIVATE_MAP, source, true);
6416 uint32 protection, uint32 flags, uint32 guardSize,
6421 fix_protection(&protection);
6423 return vm_create_anonymous_area(team, name, size, lock, protection, flags,
6431 size_t size, uint32 lock, uint32 protection)
6433 fix_protection(&protection);
6440 lock, protection, 0, 0, &virtualRestrictions, &physicalRestrictions,
6528 //info.protection &= B_USER_PROTECTION;
6553 //info.protection &= B_USER_PROTECTION;
6612 uint32 protection, area_id sourceArea)
6623 if ((protection & ~B_USER_AREA_FLAGS) != 0)
6632 fix_protection(&protection);
6635 &address, addressSpec, protection, REGION_NO_PRIVATE_MAP, sourceArea,
6651 size_t size, uint32 lock, uint32 protection)
6662 if ((protection & ~B_USER_AREA_FLAGS) != 0)
6680 fix_protection(&protection);
6687 size, lock, protection, 0, 0, &virtualRestrictions,
6715 size_t size, uint32 protection, uint32 mapping, bool unmapAddressRange,
6722 if ((protection & ~B_USER_AREA_FLAGS) != 0)
6725 fix_protection(&protection);
6744 addressSpec, size, protection, mapping, unmapAddressRange, fd, offset,
6787 _user_set_memory_protection(void* _address, size_t size, uint32 protection)
6800 // extend and check protection
6801 if ((protection & ~B_USER_PROTECTION) != 0)
6804 fix_protection(&protection);
6808 // actually allowed to change the protection.
6828 if ((area->protection & B_KERNEL_AREA) != 0)
6831 && (protection & area->protection_max) != (protection & B_USER_PROTECTION)) {
6854 // page protection array and re-map mapped pages.
6870 if (area->protection == protection)
6875 area->id, protection, false);
6894 const bool becomesWritable = (protection & B_WRITE_AREA) != 0;
6925 set_area_page_protection(area, pageAddress, protection);
6946 // the new protection.
6948 && (protection & B_WRITE_AREA) != 0;
6951 map->ProtectPage(area, pageAddress, protection);
7106 uint32 protection = get_area_page_protection(area, (addr_t)address);
7111 error = user_memcpy(_protected, &protection, sizeof(protection));
7268 size_t numBytes, uint32 addressSpec, uint32 protection,
7272 addressSpec, protection, _virtualAddress);
7281 size_t size, uint32 lock, uint32 protection)
7296 protection);