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.)
This commit is contained in:
@@ -111,9 +111,8 @@ typedef struct {
|
|||||||
#define B_ANY_KERNEL_BLOCK_ADDRESS (B_ANY_KERNEL_ADDRESS + 1)
|
#define B_ANY_KERNEL_BLOCK_ADDRESS (B_ANY_KERNEL_ADDRESS + 1)
|
||||||
|
|
||||||
/* area protection flags for the kernel */
|
/* area protection flags for the kernel */
|
||||||
#define B_KERNEL_READ_AREA 16
|
#define B_KERNEL_READ_AREA (1 << 4)
|
||||||
#define B_KERNEL_WRITE_AREA 32
|
#define B_KERNEL_WRITE_AREA (1 << 5)
|
||||||
#define B_USER_CLONEABLE_AREA 256
|
|
||||||
|
|
||||||
/* MTR attributes for mapping physical memory (Intel Architecture only) */
|
/* MTR attributes for mapping physical memory (Intel Architecture only) */
|
||||||
// TODO: rename those to something more meaningful
|
// TODO: rename those to something more meaningful
|
||||||
|
|||||||
@@ -83,13 +83,14 @@ typedef struct area_info {
|
|||||||
#define B_RANDOMIZED_BASE_ADDRESS 7
|
#define B_RANDOMIZED_BASE_ADDRESS 7
|
||||||
|
|
||||||
/* area protection */
|
/* area protection */
|
||||||
#define B_READ_AREA 1
|
#define B_READ_AREA (1 << 0)
|
||||||
#define B_WRITE_AREA 2
|
#define B_WRITE_AREA (1 << 1)
|
||||||
#define B_EXECUTE_AREA 4
|
#define B_EXECUTE_AREA (1 << 2)
|
||||||
#define B_STACK_AREA 8
|
#define B_STACK_AREA (1 << 3)
|
||||||
/* "stack" protection is not available on most platforms - it's used
|
/* "stack" protection is not available on most platforms - it's used
|
||||||
to only commit memory as needed, and have guard pages at the
|
to only commit memory as needed, and have guard pages at the
|
||||||
bottom of the stack. */
|
bottom of the stack. */
|
||||||
|
#define B_CLONEABLE_AREA (1 << 8)
|
||||||
|
|
||||||
extern area_id create_area(const char *name, void **startAddress,
|
extern area_id create_area(const char *name, void **startAddress,
|
||||||
uint32 addressSpec, size_t size, uint32 lock,
|
uint32 addressSpec, size_t size, uint32 lock,
|
||||||
|
|||||||
@@ -29,13 +29,13 @@
|
|||||||
// field is the only flag field, we currently use it for this.
|
// field is the only flag field, we currently use it for this.
|
||||||
// A cleaner approach would be appreciated - maybe just an official generic
|
// A cleaner approach would be appreciated - maybe just an official generic
|
||||||
// flags region in the protection field.
|
// flags region in the protection field.
|
||||||
#define B_OVERCOMMITTING_AREA 0x1000
|
#define B_OVERCOMMITTING_AREA (1 << 12)
|
||||||
#define B_SHARED_AREA 0x2000
|
#define B_SHARED_AREA (1 << 13)
|
||||||
/* 0x4000 was B_KERNEL_AREA until hrev52545 */
|
|
||||||
|
|
||||||
#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 \
|
#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
|
// mapping argument for several internal VM functions
|
||||||
enum {
|
enum {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int32 api_version = B_CUR_DRIVER_API_VERSION; // revision of driver API used
|
|||||||
struct ChipInfo {
|
struct ChipInfo {
|
||||||
uint16 chipID; // PCI device id of the chip
|
uint16 chipID; // PCI device id of the chip
|
||||||
ChipType chipType; // assigned chip type identifier
|
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)
|
// (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_close(void* dev);
|
||||||
static status_t device_free(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_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);
|
size_t* len);
|
||||||
static status_t device_ioctl(void* dev, uint32 msg, 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
|
static inline uint32
|
||||||
GetPCI(pci_info& info, uint8 offset, uint8 size)
|
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);
|
size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ GetPCI(pci_info& info, uint8 offset, uint8 size)
|
|||||||
static inline void
|
static inline void
|
||||||
SetPCI(pci_info& info, uint8 offset, uint8 size, uint32 value)
|
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);
|
value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ MapDevice(DeviceInfo& di)
|
|||||||
B_READ_AREA + B_WRITE_AREA,
|
B_READ_AREA + B_WRITE_AREA,
|
||||||
(void**)&si.videoMemAddr);
|
(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);
|
si.videoMemArea, (uint32)(si.videoMemAddr), videoRamSize);
|
||||||
|
|
||||||
if (si.videoMemArea < 0) {
|
if (si.videoMemArea < 0) {
|
||||||
@@ -173,7 +173,7 @@ MapDevice(DeviceInfo& di)
|
|||||||
regsBase,
|
regsBase,
|
||||||
regAreaSize,
|
regAreaSize,
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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);
|
(void**)&di.regs);
|
||||||
|
|
||||||
// If there was an error, delete other areas.
|
// If there was an error, delete other areas.
|
||||||
@@ -221,7 +221,7 @@ InitDevice(DeviceInfo& di)
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
ROUND_TO_PAGE_SIZE(sharedSize),
|
ROUND_TO_PAGE_SIZE(sharedSize),
|
||||||
B_FULL_LOCK,
|
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)
|
if (di.sharedArea < 0)
|
||||||
return di.sharedArea; // return error code
|
return di.sharedArea; // return error code
|
||||||
|
|
||||||
@@ -304,7 +304,7 @@ init_hardware(void)
|
|||||||
pci_info pciInfo;
|
pci_info pciInfo;
|
||||||
const ChipInfo* pDevice = GetNextSupportedDevice(pciIndex, pciInfo);
|
const ChipInfo* pDevice = GetNextSupportedDevice(pciIndex, pciInfo);
|
||||||
|
|
||||||
TRACE("init_hardware() - %s\n",
|
TRACE("init_hardware() - %s\n",
|
||||||
pDevice == NULL ? "no supported devices" : "device supported");
|
pDevice == NULL ? "no supported devices" : "device supported");
|
||||||
|
|
||||||
put_module(B_PCI_MODULE_NAME); // put away the module manager
|
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)
|
init_driver(void)
|
||||||
{
|
{
|
||||||
// Get handle for the pci bus.
|
// 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
|
*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);
|
di.openCount);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -651,7 +651,7 @@ MapDevice(DeviceInfo& di)
|
|||||||
regsBase,
|
regsBase,
|
||||||
regAreaSize,
|
regAreaSize,
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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);
|
(void**)&di.regs);
|
||||||
|
|
||||||
// If there was an error, delete other areas.
|
// If there was an error, delete other areas.
|
||||||
@@ -782,7 +782,7 @@ InitDevice(DeviceInfo& di)
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
ROUND_TO_PAGE_SIZE(sharedSize + vesaModeTableSize),
|
ROUND_TO_PAGE_SIZE(sharedSize + vesaModeTableSize),
|
||||||
B_FULL_LOCK,
|
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)
|
if (di.sharedArea < 0)
|
||||||
return di.sharedArea; // return error code
|
return di.sharedArea; // return error code
|
||||||
|
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ char shared_name[B_OS_NAME_LENGTH];
|
|||||||
di->pcii.bus, di->pcii.device, di->pcii.function);
|
di->pcii.bus, di->pcii.device, di->pcii.function);
|
||||||
/* create this area with NO user-space read or write permissions, to prevent accidental dammage */
|
/* 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,
|
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) {
|
if (di->sharedArea < 0) {
|
||||||
/* return the error */
|
/* return the error */
|
||||||
result = di->sharedArea;
|
result = di->sharedArea;
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ InitDevice(DeviceInfo& di)
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
ROUND_TO_PAGE_SIZE(sharedSize),
|
ROUND_TO_PAGE_SIZE(sharedSize),
|
||||||
B_FULL_LOCK,
|
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)
|
if (di.sharedArea < 0)
|
||||||
return di.sharedArea; // return error code
|
return di.sharedArea; // return error code
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ InitDevice(DeviceInfo& di)
|
|||||||
regsBase,
|
regsBase,
|
||||||
regAreaSize,
|
regAreaSize,
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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);
|
(void**)&di.regs);
|
||||||
|
|
||||||
if (si.regsArea < 0) {
|
if (si.regsArea < 0) {
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ intel_extreme_init(intel_info &info)
|
|||||||
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
||||||
ROUND_TO_PAGE_SIZE(sizeof(intel_shared_info)) + 3 * B_PAGE_SIZE,
|
ROUND_TO_PAGE_SIZE(sizeof(intel_shared_info)) + 3 * B_PAGE_SIZE,
|
||||||
B_FULL_LOCK,
|
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) {
|
if (info.shared_area < B_OK) {
|
||||||
ERROR("error: could not create shared area!\n");
|
ERROR("error: could not create shared area!\n");
|
||||||
gGART->unmap_aperture(info.aperture);
|
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_registers[mmioIndex],
|
||||||
info.pci->u.h0.base_register_sizes[mmioIndex],
|
info.pci->u.h0.base_register_sizes[mmioIndex],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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);
|
(void**)&info.registers);
|
||||||
if (mmioMapper.InitCheck() < B_OK) {
|
if (mmioMapper.InitCheck() < B_OK) {
|
||||||
ERROR("error: could not map memory I/O!\n");
|
ERROR("error: could not map memory I/O!\n");
|
||||||
|
|||||||
@@ -35,11 +35,6 @@
|
|||||||
|
|
||||||
#define MAX_DEVICES 8
|
#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 */
|
/* 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
|
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_registers[registers],
|
||||||
di->pcii.u.h0.base_register_sizes[registers],
|
di->pcii.u.h0.base_register_sizes[registers],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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));
|
(void **)&(di->regs));
|
||||||
si->clone_bugfix_regs = (uint32 *) 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 */
|
/* 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,
|
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,
|
((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) {
|
if (di->shared_area < 0) {
|
||||||
/* return the error */
|
/* return the error */
|
||||||
result = di->shared_area;
|
result = di->shared_area;
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ static status_t map_device(device_info *di)
|
|||||||
di->pcii.u.h0.base_registers[registers],
|
di->pcii.u.h0.base_registers[registers],
|
||||||
di->pcii.u.h0.base_register_sizes[registers],
|
di->pcii.u.h0.base_register_sizes[registers],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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));
|
(void **)&(di->regs));
|
||||||
si->clone_bugfix_regs = (uint32 *) 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_registers[registers2],
|
||||||
di->pcii.u.h0.base_register_sizes[registers2],
|
di->pcii.u.h0.base_register_sizes[registers2],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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));
|
(void **)&(di->regs2));
|
||||||
si->clone_bugfix_regs2 = (uint32 *) 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);
|
di->pcii.bus, di->pcii.device, di->pcii.function);
|
||||||
/* create this area with NO user-space read or write permissions, to prevent accidental dammage */
|
/* 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,
|
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) {
|
if (di->shared_area < 0) {
|
||||||
/* return the error */
|
/* return the error */
|
||||||
result = di->shared_area;
|
result = di->shared_area;
|
||||||
|
|||||||
@@ -29,11 +29,6 @@
|
|||||||
|
|
||||||
#define MAX_DEVICES 8
|
#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 */
|
/* Tell the kernel what revision of the driver API we support */
|
||||||
int32 api_version = B_CUR_DRIVER_API_VERSION;
|
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_registers_pci[registers],
|
||||||
di->pcii.u.h0.base_register_sizes[registers],
|
di->pcii.u.h0.base_register_sizes[registers],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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));
|
(void **)&(di->regs));
|
||||||
si->clone_bugfix_regs = (uint32 *) 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 */
|
/* 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,
|
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,
|
((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) {
|
if (di->shared_area < 0) {
|
||||||
/* return the error */
|
/* return the error */
|
||||||
result = di->shared_area;
|
result = di->shared_area;
|
||||||
@@ -911,7 +906,7 @@ open_hook(const char* name, uint32 flags, void** cookie)
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
2 * net_buf_size, /* take twice the net size so we can have MTRR-WC even on old systems */
|
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_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
|
// TODO: Physical aligning can be done without waste using the
|
||||||
// private create_area_etc().
|
// private create_area_etc().
|
||||||
/* on error, abort */
|
/* on error, abort */
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ createGARTBuffer(GART_info *gart, size_t size)
|
|||||||
&gart->buffer.ptr, B_ANY_KERNEL_ADDRESS,
|
&gart->buffer.ptr, B_ANY_KERNEL_ADDRESS,
|
||||||
size, B_FULL_LOCK,
|
size, B_FULL_LOCK,
|
||||||
// TODO: really user read/write?
|
// 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) {
|
if (gart->buffer.area < 0) {
|
||||||
SHOW_ERROR(1, "cannot create PCI GART buffer (%s)",
|
SHOW_ERROR(1, "cannot create PCI GART buffer (%s)",
|
||||||
strerror(gart->buffer.area));
|
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?
|
// question: is this necessary for a PCI GART because of bus snooping?
|
||||||
gart->buffer.unaligned_area = create_area( "Radeon PCI GART buffer",
|
gart->buffer.unaligned_area = create_area( "Radeon PCI GART buffer",
|
||||||
&unaligned_addr, B_ANY_KERNEL_ADDRESS,
|
&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
|
// TODO: Physical aligning can be done without waste using the
|
||||||
// private create_area_etc().
|
// private create_area_etc().
|
||||||
if (gart->buffer.unaligned_area < 0) {
|
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,
|
// TODO: Physical address is cast to 32 bit below! Use B_CONTIGUOUS,
|
||||||
// when that is (/can be) fixed!
|
// when that is (/can be) fixed!
|
||||||
// TODO: really user read/write?
|
// 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) {
|
if (gart->GATT.area < 0) {
|
||||||
SHOW_ERROR(1, "cannot create GATT table (%s)",
|
SHOW_ERROR(1, "cannot create GATT table (%s)",
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ status_t Radeon_MapDevice( device_info *di, bool mmio_only )
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
/*// for "poke" debugging
|
/*// for "poke" debugging
|
||||||
B_READ_AREA + B_WRITE_AREA*/
|
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));
|
(void **)&(di->regs));
|
||||||
if( si->regs_area < 0 )
|
if( si->regs_area < 0 )
|
||||||
return si->regs_area;
|
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_registers[fb],
|
||||||
di->pcii.u.h0.base_register_sizes[fb],
|
di->pcii.u.h0.base_register_sizes[fb],
|
||||||
B_ANY_KERNEL_BLOCK_ADDRESS | B_MTR_WC,
|
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));
|
(void **)&(si->local_mem));
|
||||||
|
|
||||||
if( si->memory[mt_local].area < 0 ) {
|
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_registers[fb],
|
||||||
di->pcii.u.h0.base_register_sizes[fb],
|
di->pcii.u.h0.base_register_sizes[fb],
|
||||||
B_ANY_KERNEL_BLOCK_ADDRESS,
|
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));
|
(void **)&(si->local_mem));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ status_t Radeon_FirstOpen( device_info *di )
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
(sizeof(shared_info) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1),
|
(sizeof(shared_info) + (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_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
|
||||||
if (di->shared_area < 0) {
|
if (di->shared_area < 0) {
|
||||||
result = di->shared_area;
|
result = di->shared_area;
|
||||||
goto err8;
|
goto err8;
|
||||||
@@ -280,7 +280,7 @@ status_t Radeon_FirstOpen( device_info *di )
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
(sizeof(virtual_card) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1),
|
(sizeof(virtual_card) + (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_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
|
||||||
if (di->virtual_card_area < 0) {
|
if (di->virtual_card_area < 0) {
|
||||||
result = di->virtual_card_area;
|
result = di->virtual_card_area;
|
||||||
goto err7;
|
goto err7;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ mapAtomBIOS(radeon_info &info, uint32 romBase, uint32 romSize)
|
|||||||
info.rom_area = create_area("radeon hd AtomBIOS",
|
info.rom_area = create_area("radeon hd AtomBIOS",
|
||||||
(void**)&info.atom_buffer, B_ANY_KERNEL_ADDRESS,
|
(void**)&info.atom_buffer, B_ANY_KERNEL_ADDRESS,
|
||||||
romSize, B_NO_LOCK,
|
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) {
|
if (info.rom_area < 0) {
|
||||||
ERROR("%s: unable to map kernel AtomBIOS space!\n",
|
ERROR("%s: unable to map kernel AtomBIOS space!\n",
|
||||||
@@ -107,7 +107,7 @@ mapAtomBIOS(radeon_info &info, uint32 romBase, uint32 romSize)
|
|||||||
|
|
||||||
if (romValid == true) {
|
if (romValid == true) {
|
||||||
set_area_protection(info.rom_area,
|
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__);
|
ERROR("%s: AtomBIOS verified and locked\n", __func__);
|
||||||
} else
|
} else
|
||||||
ERROR("%s: AtomBIOS memcpy failed!\n", __func__);
|
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",
|
info.shared_area = sharedCreator.Create("radeon hd shared info",
|
||||||
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
||||||
ROUND_TO_PAGE_SIZE(sizeof(radeon_shared_info)), B_FULL_LOCK,
|
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) {
|
if (info.shared_area < B_OK) {
|
||||||
ERROR("%s: card (%" B_PRId32 "): couldn't map shared area!\n",
|
ERROR("%s: card (%" B_PRId32 "): couldn't map shared area!\n",
|
||||||
__func__, info.id);
|
__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_registers[pciBarMmio],
|
||||||
info.pci->u.h0.base_register_sizes[pciBarMmio],
|
info.pci->u.h0.base_register_sizes[pciBarMmio],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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);
|
(void**)&info.registers);
|
||||||
if (mmioMapper.InitCheck() < B_OK) {
|
if (mmioMapper.InitCheck() < B_OK) {
|
||||||
ERROR("%s: card (%" B_PRId32 "): couldn't map memory I/O!\n",
|
ERROR("%s: card (%" B_PRId32 "): couldn't map memory I/O!\n",
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ MapDevice(DeviceInfo& di)
|
|||||||
|
|
||||||
si.regsArea = map_physical_memory(areaName, regsBase, regAreaSize,
|
si.regsArea = map_physical_memory(areaName, regsBase, regAreaSize,
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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)));
|
(void**)(&(di.regs)));
|
||||||
|
|
||||||
if (si.regsArea < 0)
|
if (si.regsArea < 0)
|
||||||
@@ -412,7 +412,7 @@ InitDevice(DeviceInfo& di)
|
|||||||
B_ANY_KERNEL_ADDRESS,
|
B_ANY_KERNEL_ADDRESS,
|
||||||
((sizeof(SharedInfo) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1)),
|
((sizeof(SharedInfo) + (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_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
|
||||||
if (di.sharedArea < 0)
|
if (di.sharedArea < 0)
|
||||||
return di.sharedArea; // return error code
|
return di.sharedArea; // return error code
|
||||||
|
|
||||||
|
|||||||
@@ -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_registers_pci[registers],
|
||||||
di->pcii.u.h0.base_register_sizes[registers],
|
di->pcii.u.h0.base_register_sizes[registers],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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));
|
(void **)&(di->regs));
|
||||||
si->clone_bugfix_regs = (uint32 *) 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);
|
di->pcii.bus, di->pcii.device, di->pcii.function);
|
||||||
/* create this area with NO user-space read or write permissions, to prevent accidental dammage */
|
/* 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,
|
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) {
|
if (di->shared_area < 0) {
|
||||||
/* return the error */
|
/* return the error */
|
||||||
result = di->shared_area;
|
result = di->shared_area;
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ vesa_init(vesa_info& info)
|
|||||||
info.shared_area = create_area("vesa shared info",
|
info.shared_area = create_area("vesa shared info",
|
||||||
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
|
||||||
ROUND_TO_PAGE_SIZE(sharedSize + modesSize), B_FULL_LOCK,
|
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)
|
if (info.shared_area < 0)
|
||||||
return info.shared_area;
|
return info.shared_area;
|
||||||
|
|
||||||
|
|||||||
@@ -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_registers_pci[registers],
|
||||||
di->pcii.u.h0.base_register_sizes[registers],
|
di->pcii.u.h0.base_register_sizes[registers],
|
||||||
B_ANY_KERNEL_ADDRESS,
|
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));
|
(void **)&(di->regs));
|
||||||
si->clone_bugfix_regs = (uint32 *) 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);
|
di->pcii.bus, di->pcii.device, di->pcii.function);
|
||||||
/* create this area with NO user-space read or write permissions, to prevent accidental dammage */
|
/* 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,
|
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) {
|
if (di->shared_area < 0) {
|
||||||
/* return the error */
|
/* return the error */
|
||||||
result = di->shared_area;
|
result = di->shared_area;
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ RequestAllocator::AllocateAddress(Address& address, int32 size, int32 align,
|
|||||||
areaSize, B_NO_LOCK,
|
areaSize, B_NO_LOCK,
|
||||||
B_READ_AREA | B_WRITE_AREA
|
B_READ_AREA | B_WRITE_AREA
|
||||||
#ifdef _KERNEL_MODE
|
#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
|
#endif
|
||||||
);
|
);
|
||||||
if (area < 0)
|
if (area < 0)
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ frame_buffer_console_init(kernel_args* args)
|
|||||||
sConsole.area = map_physical_memory("vesa frame buffer",
|
sConsole.area = map_physical_memory("vesa frame buffer",
|
||||||
args->frame_buffer.physical_buffer.start,
|
args->frame_buffer.physical_buffer.start,
|
||||||
args->frame_buffer.physical_buffer.size, B_ANY_KERNEL_ADDRESS,
|
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);
|
&frameBuffer);
|
||||||
if (sConsole.area < 0)
|
if (sConsole.area < 0)
|
||||||
return sConsole.area;
|
return sConsole.area;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ MessagingArea::Create(sem_id lockSem, sem_id counterSem)
|
|||||||
// create the area
|
// create the area
|
||||||
area->fID = create_area("messaging", (void**)&area->fHeader,
|
area->fID = create_area("messaging", (void**)&area->fHeader,
|
||||||
B_ANY_KERNEL_ADDRESS, kMessagingAreaSize, B_FULL_LOCK,
|
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) {
|
if (area->fID < 0) {
|
||||||
delete area;
|
delete area;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -2110,7 +2110,7 @@ vm_clone_area(team_id team, const char* name, void** address,
|
|||||||
|
|
||||||
if (!kernel && sourceAddressSpace == VMAddressSpace::Kernel()
|
if (!kernel && sourceAddressSpace == VMAddressSpace::Kernel()
|
||||||
&& targetAddressSpace != 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
|
// kernel areas must not be cloned in userland, unless explicitly
|
||||||
// declared user-cloneable upon construction
|
// declared user-cloneable upon construction
|
||||||
#if KDEBUG
|
#if KDEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user