[haiku-commits] haiku: hrev53362 - src/add-ons/kernel/drivers/graphics/radeon src/add-ons/kernel/drivers/graphics/3dfx src/add-ons/kernel/drivers/graphics/radeon_hd src/add-ons/kernel/drivers/graphics/neomagic headers/private/system

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 10 Aug 2019 15:54:56 -0400 (EDT)

hrev53362 adds 1 changeset to branch 'master'
old head: e4d335404f829e0b9786ef72339cc24f39d50c5f
new head: 8a0c9d52c62918442ede4cc8361bdbfb9560e713
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=8a0c9d52c629+%5Ee4d335404f82

----------------------------------------------------------------------------

8a0c9d52c629: OS: Rename B_USER_CLONEABLE_AREA to B_CLONEABLE_AREA.
  
  It now lives in OS.h. The idea is that this will now be
  accessible to userland applications, so userland memory
  is protected from access by other processes, just as
  kernel memory is.
  
  No functional change (the constants are still the same,
  though I've changed some to use shifts to make clear
  which bits are allocated are which are unused.)

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53362
Commit:      8a0c9d52c62918442ede4cc8361bdbfb9560e713
URL:         https://git.haiku-os.org/haiku/commit/?id=8a0c9d52c629
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Sat Aug 10 19:51:41 2019 UTC

----------------------------------------------------------------------------

22 files changed, 60 insertions(+), 70 deletions(-)
headers/os/drivers/KernelExport.h                |  5 ++---
headers/os/kernel/OS.h                           |  9 +++++----
headers/private/system/vm_defs.h                 | 10 +++++-----
.../kernel/drivers/graphics/3dfx/driver.cpp      | 20 ++++++++++----------
.../kernel/drivers/graphics/ati/driver.cpp       |  4 ++--
.../kernel/drivers/graphics/et6x00/driver.c      |  2 +-
.../kernel/drivers/graphics/intel_810/driver.cpp |  4 ++--
.../graphics/intel_extreme/intel_extreme.cpp     |  4 ++--
.../kernel/drivers/graphics/matrox/driver.c      |  9 ++-------
.../kernel/drivers/graphics/neomagic/driver.c    |  6 +++---
.../kernel/drivers/graphics/nvidia/driver.c      | 11 +++--------
.../kernel/drivers/graphics/radeon/PCI_GART.c    |  6 +++---
.../kernel/drivers/graphics/radeon/init.c        | 10 +++++-----
.../drivers/graphics/radeon_hd/radeon_hd.cpp     |  8 ++++----
.../kernel/drivers/graphics/s3/driver.cpp        |  4 ++--
.../kernel/drivers/graphics/skeleton/driver.c    |  4 ++--
.../kernel/drivers/graphics/vesa/vesa.cpp        |  2 +-
src/add-ons/kernel/drivers/graphics/via/driver.c |  4 ++--
.../userlandfs/private/RequestAllocator.cpp      |  2 +-
src/system/kernel/debug/frame_buffer_console.cpp |  2 +-
src/system/kernel/messaging/MessagingService.cpp |  2 +-
src/system/kernel/vm/vm.cpp                      |  2 +-

----------------------------------------------------------------------------

diff --git a/headers/os/drivers/KernelExport.h 
b/headers/os/drivers/KernelExport.h
index ffdbb245ea..27dd312edc 100644
--- a/headers/os/drivers/KernelExport.h
+++ b/headers/os/drivers/KernelExport.h
@@ -111,9 +111,8 @@ typedef struct {
 #define        B_ANY_KERNEL_BLOCK_ADDRESS      (B_ANY_KERNEL_ADDRESS + 1)
 
 /* area protection flags for the kernel */
-#define B_KERNEL_READ_AREA                     16
-#define B_KERNEL_WRITE_AREA                    32
-#define B_USER_CLONEABLE_AREA          256
+#define B_KERNEL_READ_AREA                     (1 << 4)
+#define B_KERNEL_WRITE_AREA                    (1 << 5)
 
 /* MTR attributes for mapping physical memory (Intel Architecture only) */
 // TODO: rename those to something more meaningful
diff --git a/headers/os/kernel/OS.h b/headers/os/kernel/OS.h
index 59e9522401..10cff85fd9 100644
--- a/headers/os/kernel/OS.h
+++ b/headers/os/kernel/OS.h
@@ -83,13 +83,14 @@ typedef struct area_info {
 #define B_RANDOMIZED_BASE_ADDRESS      7
 
 /* area protection */
-#define B_READ_AREA                            1
-#define B_WRITE_AREA                   2
-#define B_EXECUTE_AREA                 4
-#define B_STACK_AREA                   8
+#define B_READ_AREA                            (1 << 0)
+#define B_WRITE_AREA                   (1 << 1)
+#define B_EXECUTE_AREA                 (1 << 2)
+#define B_STACK_AREA                   (1 << 3)
        /* "stack" protection is not available on most platforms - it's used
           to only commit memory as needed, and have guard pages at the
           bottom of the stack. */
+#define B_CLONEABLE_AREA               (1 << 8)
 
 extern area_id         create_area(const char *name, void **startAddress,
                                                uint32 addressSpec, size_t 
size, uint32 lock,
diff --git a/headers/private/system/vm_defs.h b/headers/private/system/vm_defs.h
index 81230d5f4f..9ca30615af 100644
--- a/headers/private/system/vm_defs.h
+++ b/headers/private/system/vm_defs.h
@@ -29,13 +29,13 @@
 //     field is the only flag field, we currently use it for this.
 //     A cleaner approach would be appreciated - maybe just an official generic
 //     flags region in the protection field.
-#define B_OVERCOMMITTING_AREA  0x1000
-#define B_SHARED_AREA                  0x2000
-/* 0x4000 was B_KERNEL_AREA until hrev52545 */
+#define B_OVERCOMMITTING_AREA  (1 << 12)
+#define B_SHARED_AREA                  (1 << 13)
 
-#define B_USER_AREA_FLAGS              (B_USER_PROTECTION | 
B_OVERCOMMITTING_AREA)
+#define B_USER_AREA_FLAGS              \
+       (B_USER_PROTECTION | B_OVERCOMMITTING_AREA | B_CLONEABLE_AREA)
 #define B_KERNEL_AREA_FLAGS \
-       (B_KERNEL_PROTECTION | B_USER_CLONEABLE_AREA | B_SHARED_AREA)
+       (B_KERNEL_PROTECTION | B_SHARED_AREA)
 
 // mapping argument for several internal VM functions
 enum {
diff --git a/src/add-ons/kernel/drivers/graphics/3dfx/driver.cpp 
b/src/add-ons/kernel/drivers/graphics/3dfx/driver.cpp
index 7b573e22fc..372ea11d43 100644
--- a/src/add-ons/kernel/drivers/graphics/3dfx/driver.cpp
+++ b/src/add-ons/kernel/drivers/graphics/3dfx/driver.cpp
@@ -44,7 +44,7 @@ int32 api_version = B_CUR_DRIVER_API_VERSION; // revision of 
driver API used
 struct ChipInfo {
        uint16          chipID;                 // PCI device id of the chip
        ChipType        chipType;               // assigned chip type identifier
-       const char*     chipName;               // user recognizable name for 
chip 
+       const char*     chipName;               // user recognizable name for 
chip
                                                                //   (must be < 
32 chars)
 };
 
@@ -83,7 +83,7 @@ static status_t device_open(const char* name, uint32 flags, 
void** cookie);
 static status_t device_close(void* dev);
 static status_t device_free(void* dev);
 static status_t device_read(void* dev, off_t pos, void* buf, size_t* len);
-static status_t device_write(void* dev, off_t pos, const void* buf, 
+static status_t device_write(void* dev, off_t pos, const void* buf,
                                        size_t* len);
 static status_t device_ioctl(void* dev, uint32 msg, void* buf, size_t len);
 
@@ -106,7 +106,7 @@ static device_hooks gDeviceHooks =
 static inline uint32
 GetPCI(pci_info& info, uint8 offset, uint8 size)
 {
-       return gPCI->read_pci_config(info.bus, info.device, info.function, 
offset, 
+       return gPCI->read_pci_config(info.bus, info.device, info.function, 
offset,
                size);
 }
 
@@ -114,7 +114,7 @@ GetPCI(pci_info& info, uint8 offset, uint8 size)
 static inline void
 SetPCI(pci_info& info, uint8 offset, uint8 size, uint32 value)
 {
-       gPCI->write_pci_config(info.bus, info.device, info.function, offset, 
size, 
+       gPCI->write_pci_config(info.bus, info.device, info.function, offset, 
size,
                value);
 }
 
@@ -147,7 +147,7 @@ MapDevice(DeviceInfo& di)
                B_READ_AREA + B_WRITE_AREA,
                (void**)&si.videoMemAddr);
 
-       TRACE("Video memory, area: %ld,  addr: 0x%lX, size: %ld\n", 
+       TRACE("Video memory, area: %ld,  addr: 0x%lX, size: %ld\n",
                si.videoMemArea, (uint32)(si.videoMemAddr), videoRamSize);
 
        if (si.videoMemArea < 0) {
@@ -173,7 +173,7 @@ MapDevice(DeviceInfo& di)
                regsBase,
                regAreaSize,
                B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void**)&di.regs);
 
        // If there was an error, delete other areas.
@@ -221,7 +221,7 @@ InitDevice(DeviceInfo& di)
                B_ANY_KERNEL_ADDRESS,
                ROUND_TO_PAGE_SIZE(sharedSize),
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di.sharedArea < 0)
                return di.sharedArea;   // return error code
 
@@ -304,7 +304,7 @@ init_hardware(void)
        pci_info pciInfo;
        const ChipInfo* pDevice = GetNextSupportedDevice(pciIndex, pciInfo);
 
-       TRACE("init_hardware() - %s\n", 
+       TRACE("init_hardware() - %s\n",
                pDevice == NULL ? "no supported devices" : "device supported");
 
        put_module(B_PCI_MODULE_NAME);          // put away the module manager
@@ -313,7 +313,7 @@ init_hardware(void)
 }
 
 
-status_t  
+status_t
 init_driver(void)
 {
        // Get handle for the pci bus.
@@ -425,7 +425,7 @@ device_open(const char* name, uint32 /*flags*/, void** 
cookie)
                *cookie = &di;          // send cookie to opener
        }
 
-       TRACE("device_open() returning 0x%lx,  open count: %ld\n", status, 
+       TRACE("device_open() returning 0x%lx,  open count: %ld\n", status,
                di.openCount);
        return status;
 }
diff --git a/src/add-ons/kernel/drivers/graphics/ati/driver.cpp 
b/src/add-ons/kernel/drivers/graphics/ati/driver.cpp
index 711641f0c1..27f02f4cb9 100644
--- a/src/add-ons/kernel/drivers/graphics/ati/driver.cpp
+++ b/src/add-ons/kernel/drivers/graphics/ati/driver.cpp
@@ -651,7 +651,7 @@ MapDevice(DeviceInfo& di)
                regsBase,
                regAreaSize,
                B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void**)&di.regs);
 
        // If there was an error, delete other areas.
@@ -782,7 +782,7 @@ InitDevice(DeviceInfo& di)
                B_ANY_KERNEL_ADDRESS,
                ROUND_TO_PAGE_SIZE(sharedSize + vesaModeTableSize),
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di.sharedArea < 0)
                return di.sharedArea;   // return error code
 
diff --git a/src/add-ons/kernel/drivers/graphics/et6x00/driver.c 
b/src/add-ons/kernel/drivers/graphics/et6x00/driver.c
index d38fa95714..969973019a 100644
--- a/src/add-ons/kernel/drivers/graphics/et6x00/driver.c
+++ b/src/add-ons/kernel/drivers/graphics/et6x00/driver.c
@@ -466,7 +466,7 @@ char shared_name[B_OS_NAME_LENGTH];
         di->pcii.bus, di->pcii.device, di->pcii.function);
     /* create this area with NO user-space read or write permissions, to 
prevent accidental dammage */
     di->sharedArea = create_area(shared_name, (void **)&(di->si), 
B_ANY_KERNEL_ADDRESS, ((sizeof(ET6000SharedInfo) + (B_PAGE_SIZE - 1)) & 
~(B_PAGE_SIZE - 1)), B_FULL_LOCK,
-               B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_CLONEABLE_AREA);
     if (di->sharedArea < 0) {
         /* return the error */
         result = di->sharedArea;
diff --git a/src/add-ons/kernel/drivers/graphics/intel_810/driver.cpp 
b/src/add-ons/kernel/drivers/graphics/intel_810/driver.cpp
index 2ec80041ba..db52a6fb10 100644
--- a/src/add-ons/kernel/drivers/graphics/intel_810/driver.cpp
+++ b/src/add-ons/kernel/drivers/graphics/intel_810/driver.cpp
@@ -256,7 +256,7 @@ InitDevice(DeviceInfo& di)
                B_ANY_KERNEL_ADDRESS,
                ROUND_TO_PAGE_SIZE(sharedSize),
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di.sharedArea < 0)
                return di.sharedArea;   // return error code
 
@@ -286,7 +286,7 @@ InitDevice(DeviceInfo& di)
                regsBase,
                regAreaSize,
                B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void**)&di.regs);
 
        if (si.regsArea < 0) {
diff --git 
a/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp 
b/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp
index beec005c34..0a7d3977dc 100644
--- a/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp
+++ b/src/add-ons/kernel/drivers/graphics/intel_extreme/intel_extreme.cpp
@@ -323,7 +323,7 @@ intel_extreme_init(intel_info &info)
                (void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
                ROUND_TO_PAGE_SIZE(sizeof(intel_shared_info)) + 3 * B_PAGE_SIZE,
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (info.shared_area < B_OK) {
                ERROR("error: could not create shared area!\n");
                gGART->unmap_aperture(info.aperture);
@@ -354,7 +354,7 @@ intel_extreme_init(intel_info &info)
                info.pci->u.h0.base_registers[mmioIndex],
                info.pci->u.h0.base_register_sizes[mmioIndex],
                B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void**)&info.registers);
        if (mmioMapper.InitCheck() < B_OK) {
                ERROR("error: could not map memory I/O!\n");
diff --git a/src/add-ons/kernel/drivers/graphics/matrox/driver.c 
b/src/add-ons/kernel/drivers/graphics/matrox/driver.c
index 272413cdd1..4dcbfe93f9 100644
--- a/src/add-ons/kernel/drivers/graphics/matrox/driver.c
+++ b/src/add-ons/kernel/drivers/graphics/matrox/driver.c
@@ -35,11 +35,6 @@
 
 #define MAX_DEVICES      8
 
-#ifndef __HAIKU__
-#      undef B_USER_CLONEABLE_AREA
-#      define B_USER_CLONEABLE_AREA 0
-#endif
-
 /* Tell the kernel what revision of the driver API we support */
 int32  api_version = B_CUR_DRIVER_API_VERSION; // apsed, was 2, is 2 in R5
 
@@ -364,7 +359,7 @@ static status_t map_device(device_info *di)
                di->pcii.u.h0.base_registers[registers],
                di->pcii.u.h0.base_register_sizes[registers],
                B_ANY_KERNEL_ADDRESS,
-               B_USER_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
+               B_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
                (void **)&(di->regs));
        si->clone_bugfix_regs = (uint32 *) di->regs;
 
@@ -774,7 +769,7 @@ static status_t open_hook (const char* name, uint32 flags, 
void** cookie) {
        /* create this area with NO user-space read or write permissions, to 
prevent accidental dammage */
        di->shared_area = create_area(shared_name, (void **)&(di->si), 
B_ANY_KERNEL_ADDRESS,
                ((sizeof(shared_info) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 
1)), B_FULL_LOCK,
-               B_USER_CLONEABLE_AREA);
+               B_CLONEABLE_AREA);
        if (di->shared_area < 0) {
                /* return the error */
                result = di->shared_area;
diff --git a/src/add-ons/kernel/drivers/graphics/neomagic/driver.c 
b/src/add-ons/kernel/drivers/graphics/neomagic/driver.c
index c2343a3cfa..8cc0eb47ea 100644
--- a/src/add-ons/kernel/drivers/graphics/neomagic/driver.c
+++ b/src/add-ons/kernel/drivers/graphics/neomagic/driver.c
@@ -379,7 +379,7 @@ static status_t map_device(device_info *di)
                        di->pcii.u.h0.base_registers[registers],
                        di->pcii.u.h0.base_register_sizes[registers],
                        B_ANY_KERNEL_ADDRESS,
-                       B_USER_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
+                       B_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
                        (void **)&(di->regs));
                si->clone_bugfix_regs = (uint32 *) di->regs;
 
@@ -396,7 +396,7 @@ static status_t map_device(device_info *di)
                        di->pcii.u.h0.base_registers[registers2],
                        di->pcii.u.h0.base_register_sizes[registers2],
                        B_ANY_KERNEL_ADDRESS,
-                       B_USER_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
+                       B_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
                        (void **)&(di->regs2));
                si->clone_bugfix_regs2 = (uint32 *) di->regs2;
 
@@ -697,7 +697,7 @@ static status_t open_hook (const char* name, uint32 flags, 
void** cookie) {
                di->pcii.bus, di->pcii.device, di->pcii.function);
        /* create this area with NO user-space read or write permissions, to 
prevent accidental dammage */
        di->shared_area = create_area(shared_name, (void **)&(di->si), 
B_ANY_KERNEL_ADDRESS, ((sizeof(shared_info) + (B_PAGE_SIZE - 1)) & 
~(B_PAGE_SIZE - 1)), B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di->shared_area < 0) {
                /* return the error */
                result = di->shared_area;
diff --git a/src/add-ons/kernel/drivers/graphics/nvidia/driver.c 
b/src/add-ons/kernel/drivers/graphics/nvidia/driver.c
index 34e586f20f..639d93de5b 100644
--- a/src/add-ons/kernel/drivers/graphics/nvidia/driver.c
+++ b/src/add-ons/kernel/drivers/graphics/nvidia/driver.c
@@ -29,11 +29,6 @@
 
 #define MAX_DEVICES      8
 
-#ifndef __HAIKU__
-#      undef B_USER_CLONEABLE_AREA
-#      define B_USER_CLONEABLE_AREA 0
-#endif
-
 /* Tell the kernel what revision of the driver API we support */
 int32 api_version = B_CUR_DRIVER_API_VERSION;
 
@@ -567,7 +562,7 @@ map_device(device_info *di)
                di->pcii.u.h0.base_registers_pci[registers],
                di->pcii.u.h0.base_register_sizes[registers],
                B_ANY_KERNEL_ADDRESS,
-               B_USER_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
+               B_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
                (void **)&(di->regs));
        si->clone_bugfix_regs = (uint32 *) di->regs;
 
@@ -890,7 +885,7 @@ open_hook(const char* name, uint32 flags, void** cookie)
        /* create this area with NO user-space read or write permissions, to 
prevent accidental damage */
        di->shared_area = create_area(shared_name, (void **)&(di->si), 
B_ANY_KERNEL_ADDRESS,
                ((sizeof(shared_info) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 
1)), B_FULL_LOCK,
-               B_USER_CLONEABLE_AREA);
+               B_CLONEABLE_AREA);
        if (di->shared_area < 0) {
                /* return the error */
                result = di->shared_area;
@@ -911,7 +906,7 @@ open_hook(const char* name, uint32 flags, void** cookie)
                        B_ANY_KERNEL_ADDRESS,
                        2 * net_buf_size, /* take twice the net size so we can 
have MTRR-WC even on old systems */
                        B_32_BIT_CONTIGUOUS, /* GPU always needs access */
-                       B_USER_CLONEABLE_AREA | B_READ_AREA | B_WRITE_AREA);
+                       B_CLONEABLE_AREA | B_READ_AREA | B_WRITE_AREA);
                        // TODO: Physical aligning can be done without waste 
using the
                        // private create_area_etc().
        /* on error, abort */
diff --git a/src/add-ons/kernel/drivers/graphics/radeon/PCI_GART.c 
b/src/add-ons/kernel/drivers/graphics/radeon/PCI_GART.c
index 89079b073a..ff0015e330 100644
--- a/src/add-ons/kernel/drivers/graphics/radeon/PCI_GART.c
+++ b/src/add-ons/kernel/drivers/graphics/radeon/PCI_GART.c
@@ -52,7 +52,7 @@ createGARTBuffer(GART_info *gart, size_t size)
                &gart->buffer.ptr, B_ANY_KERNEL_ADDRESS,
                size, B_FULL_LOCK,
                // TODO: really user read/write?
-               B_READ_AREA | B_WRITE_AREA | B_USER_CLONEABLE_AREA);
+               B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA);
        if (gart->buffer.area < 0) {
                SHOW_ERROR(1, "cannot create PCI GART buffer (%s)",
                        strerror(gart->buffer.area));
@@ -84,7 +84,7 @@ static status_t createGARTBuffer( GART_info *gart, size_t 
size )
        // question: is this necessary for a PCI GART because of bus snooping?
        gart->buffer.unaligned_area = create_area( "Radeon PCI GART buffer",
                &unaligned_addr, B_ANY_KERNEL_ADDRESS,
-               2 * size, B_CONTIGUOUS/*B_FULL_LOCK*/, B_READ_AREA | 
B_WRITE_AREA | B_USER_CLONEABLE_AREA );
+               2 * size, B_CONTIGUOUS/*B_FULL_LOCK*/, B_READ_AREA | 
B_WRITE_AREA | B_CLONEABLE_AREA );
                // TODO: Physical aligning can be done without waste using the
                // private create_area_etc().
        if (gart->buffer.unaligned_area < 0) {
@@ -151,7 +151,7 @@ static status_t initGATT( GART_info *gart )
                        // TODO: Physical address is cast to 32 bit below! Use 
B_CONTIGUOUS,
                        // when that is (/can be) fixed!
                // TODO: really user read/write?
-               B_READ_AREA | B_WRITE_AREA | B_USER_CLONEABLE_AREA);
+               B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA);
 
        if (gart->GATT.area < 0) {
                SHOW_ERROR(1, "cannot create GATT table (%s)",
diff --git a/src/add-ons/kernel/drivers/graphics/radeon/init.c 
b/src/add-ons/kernel/drivers/graphics/radeon/init.c
index 2be02b620d..76500f02d9 100644
--- a/src/add-ons/kernel/drivers/graphics/radeon/init.c
+++ b/src/add-ons/kernel/drivers/graphics/radeon/init.c
@@ -75,7 +75,7 @@ status_t Radeon_MapDevice( device_info *di, bool mmio_only )
                B_ANY_KERNEL_ADDRESS,
                /*// for "poke" debugging
                B_READ_AREA + B_WRITE_AREA*/
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void **)&(di->regs));
        if( si->regs_area < 0 )
                return si->regs_area;
@@ -130,7 +130,7 @@ status_t Radeon_MapDevice( device_info *di, bool mmio_only )
                di->pcii.u.h0.base_registers[fb],
                di->pcii.u.h0.base_register_sizes[fb],
                B_ANY_KERNEL_BLOCK_ADDRESS | B_MTR_WC,
-               B_READ_AREA | B_WRITE_AREA | B_USER_CLONEABLE_AREA,
+               B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA,
                (void **)&(si->local_mem));
 
        if( si->memory[mt_local].area < 0 ) {
@@ -140,7 +140,7 @@ status_t Radeon_MapDevice( device_info *di, bool mmio_only )
                        di->pcii.u.h0.base_registers[fb],
                        di->pcii.u.h0.base_register_sizes[fb],
                        B_ANY_KERNEL_BLOCK_ADDRESS,
-                       B_READ_AREA | B_WRITE_AREA | B_USER_CLONEABLE_AREA,
+                       B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA,
                        (void **)&(si->local_mem));
        }
 
@@ -213,7 +213,7 @@ status_t Radeon_FirstOpen( device_info *di )
                B_ANY_KERNEL_ADDRESS,
                (sizeof(shared_info) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1),
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di->shared_area < 0) {
                result = di->shared_area;
                goto err8;
@@ -280,7 +280,7 @@ status_t Radeon_FirstOpen( device_info *di )
                B_ANY_KERNEL_ADDRESS,
                (sizeof(virtual_card) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1),
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di->virtual_card_area < 0) {
                result = di->virtual_card_area;
                goto err7;
diff --git a/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp 
b/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp
index 0462b7fcdc..44218b6cbc 100644
--- a/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp
+++ b/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp
@@ -86,7 +86,7 @@ mapAtomBIOS(radeon_info &info, uint32 romBase, uint32 romSize)
        info.rom_area = create_area("radeon hd AtomBIOS",
                (void**)&info.atom_buffer, B_ANY_KERNEL_ADDRESS,
                romSize, B_NO_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
 
        if (info.rom_area < 0) {
                ERROR("%s: unable to map kernel AtomBIOS space!\n",
@@ -107,7 +107,7 @@ mapAtomBIOS(radeon_info &info, uint32 romBase, uint32 
romSize)
 
        if (romValid == true) {
                set_area_protection(info.rom_area,
-                       B_KERNEL_READ_AREA | B_USER_CLONEABLE_AREA);
+                       B_KERNEL_READ_AREA | B_CLONEABLE_AREA);
                ERROR("%s: AtomBIOS verified and locked\n", __func__);
        } else
                ERROR("%s: AtomBIOS memcpy failed!\n", __func__);
@@ -543,7 +543,7 @@ radeon_hd_init(radeon_info &info)
        info.shared_area = sharedCreator.Create("radeon hd shared info",
                (void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
                ROUND_TO_PAGE_SIZE(sizeof(radeon_shared_info)), B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (info.shared_area < B_OK) {
                ERROR("%s: card (%" B_PRId32 "): couldn't map shared area!\n",
                        __func__, info.id);
@@ -560,7 +560,7 @@ radeon_hd_init(radeon_info &info)
                info.pci->u.h0.base_registers[pciBarMmio],
                info.pci->u.h0.base_register_sizes[pciBarMmio],
                B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void**)&info.registers);
        if (mmioMapper.InitCheck() < B_OK) {
                ERROR("%s: card (%" B_PRId32 "): couldn't map memory I/O!\n",
diff --git a/src/add-ons/kernel/drivers/graphics/s3/driver.cpp 
b/src/add-ons/kernel/drivers/graphics/s3/driver.cpp
index 25bc2b3acc..d000238a12 100644
--- a/src/add-ons/kernel/drivers/graphics/s3/driver.cpp
+++ b/src/add-ons/kernel/drivers/graphics/s3/driver.cpp
@@ -245,7 +245,7 @@ MapDevice(DeviceInfo& di)
 
        si.regsArea = map_physical_memory(areaName, regsBase, regAreaSize,
                B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                (void**)(&(di.regs)));
 
        if (si.regsArea < 0)
@@ -412,7 +412,7 @@ InitDevice(DeviceInfo& di)
                B_ANY_KERNEL_ADDRESS,
                ((sizeof(SharedInfo) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1)),
                B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di.sharedArea < 0)
                return di.sharedArea;   // return error code
 
diff --git a/src/add-ons/kernel/drivers/graphics/skeleton/driver.c 
b/src/add-ons/kernel/drivers/graphics/skeleton/driver.c
index 570858fda1..96275cac0c 100644
--- a/src/add-ons/kernel/drivers/graphics/skeleton/driver.c
+++ b/src/add-ons/kernel/drivers/graphics/skeleton/driver.c
@@ -379,7 +379,7 @@ static status_t map_device(device_info *di)
                di->pcii.u.h0.base_registers_pci[registers],
                di->pcii.u.h0.base_register_sizes[registers],
                B_ANY_KERNEL_ADDRESS,
-               B_USER_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
+               B_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
                (void **)&(di->regs));
        si->clone_bugfix_regs = (uint32 *) di->regs;
 
@@ -649,7 +649,7 @@ static status_t open_hook (const char* name, uint32 flags, 
void** cookie) {
                di->pcii.bus, di->pcii.device, di->pcii.function);
        /* create this area with NO user-space read or write permissions, to 
prevent accidental dammage */
        di->shared_area = create_area(shared_name, (void **)&(di->si), 
B_ANY_KERNEL_ADDRESS, ((sizeof(shared_info) + (B_PAGE_SIZE - 1)) & 
~(B_PAGE_SIZE - 1)), B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di->shared_area < 0) {
                /* return the error */
                result = di->shared_area;
diff --git a/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp 
b/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp
index eca4ea537b..dc155aec29 100644
--- a/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp
+++ b/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp
@@ -367,7 +367,7 @@ vesa_init(vesa_info& info)
        info.shared_area = create_area("vesa shared info",
                (void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
                ROUND_TO_PAGE_SIZE(sharedSize + modesSize), B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (info.shared_area < 0)
                return info.shared_area;
 
diff --git a/src/add-ons/kernel/drivers/graphics/via/driver.c 
b/src/add-ons/kernel/drivers/graphics/via/driver.c
index 9b06c32afe..44a709ba87 100644
--- a/src/add-ons/kernel/drivers/graphics/via/driver.c
+++ b/src/add-ons/kernel/drivers/graphics/via/driver.c
@@ -388,7 +388,7 @@ static status_t map_device(device_info *di)
                di->pcii.u.h0.base_registers_pci[registers],
                di->pcii.u.h0.base_register_sizes[registers],
                B_ANY_KERNEL_ADDRESS,
-               B_USER_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
+               B_CLONEABLE_AREA | (si->use_clone_bugfix ? 
B_READ_AREA|B_WRITE_AREA : 0),
                (void **)&(di->regs));
        si->clone_bugfix_regs = (uint32 *) di->regs;
 
@@ -658,7 +658,7 @@ static status_t open_hook (const char* name, uint32 flags, 
void** cookie) {
                di->pcii.bus, di->pcii.device, di->pcii.function);
        /* create this area with NO user-space read or write permissions, to 
prevent accidental dammage */
        di->shared_area = create_area(shared_name, (void **)&(di->si), 
B_ANY_KERNEL_ADDRESS, ((sizeof(shared_info) + (B_PAGE_SIZE - 1)) & 
~(B_PAGE_SIZE - 1)), B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (di->shared_area < 0) {
                /* return the error */
                result = di->shared_area;
diff --git 
a/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp 
b/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp
index d78f7c7e27..0e01661604 100644
--- a/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp
+++ b/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp
@@ -244,7 +244,7 @@ RequestAllocator::AllocateAddress(Address& address, int32 
size, int32 align,
                        areaSize, B_NO_LOCK,
                        B_READ_AREA | B_WRITE_AREA
 #ifdef _KERNEL_MODE
-                               | B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA
+                               | B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_CLONEABLE_AREA
 #endif
                        );
                if (area < 0)
diff --git a/src/system/kernel/debug/frame_buffer_console.cpp 
b/src/system/kernel/debug/frame_buffer_console.cpp
index 0b73ad3c8d..a638ca82e9 100644
--- a/src/system/kernel/debug/frame_buffer_console.cpp
+++ b/src/system/kernel/debug/frame_buffer_console.cpp
@@ -435,7 +435,7 @@ frame_buffer_console_init(kernel_args* args)
        sConsole.area = map_physical_memory("vesa frame buffer",
                args->frame_buffer.physical_buffer.start,
                args->frame_buffer.physical_buffer.size, B_ANY_KERNEL_ADDRESS,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA,
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA,
                &frameBuffer);
        if (sConsole.area < 0)
                return sConsole.area;
diff --git a/src/system/kernel/messaging/MessagingService.cpp 
b/src/system/kernel/messaging/MessagingService.cpp
index e20b29e7d2..6d5221381d 100644
--- a/src/system/kernel/messaging/MessagingService.cpp
+++ b/src/system/kernel/messaging/MessagingService.cpp
@@ -59,7 +59,7 @@ MessagingArea::Create(sem_id lockSem, sem_id counterSem)
        // create the area
        area->fID = create_area("messaging", (void**)&area->fHeader,
                B_ANY_KERNEL_ADDRESS, kMessagingAreaSize, B_FULL_LOCK,
-               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | 
B_USER_CLONEABLE_AREA);
+               B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
        if (area->fID < 0) {
                delete area;
                return NULL;
diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp
index 920745c4b5..28cb59bcdb 100644
--- a/src/system/kernel/vm/vm.cpp
+++ b/src/system/kernel/vm/vm.cpp
@@ -2110,7 +2110,7 @@ vm_clone_area(team_id team, const char* name, void** 
address,
 
        if (!kernel && sourceAddressSpace == VMAddressSpace::Kernel()
                && targetAddressSpace != VMAddressSpace::Kernel()
-               && !(sourceArea->protection & B_USER_CLONEABLE_AREA)) {
+               && !(sourceArea->protection & B_CLONEABLE_AREA)) {
                // kernel areas must not be cloned in userland, unless 
explicitly
                // declared user-cloneable upon construction
 #if KDEBUG


Other related posts: