fixed address checking in ppc atomic functions.

fixed compilation on x86.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4361 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper 2003-08-21 23:36:06 +00:00
parent 50e0ce4bee
commit 5fe840b9b5
3 changed files with 9 additions and 7 deletions

View File

@ -5,6 +5,7 @@
#ifndef _KERNEL_ARCH_x86_CPU_H
#define _KERNEL_ARCH_x86_CPU_H
#include <ktypes.h>
#include <arch/x86/thread_struct.h>
#include <arch/x86/descriptors.h>

View File

@ -4,6 +4,8 @@
*/
#include <KernelExport.h>
#include <ktypes.h>
#include <user_atomic.h>
/*
@ -105,7 +107,7 @@ user_atomic_set64(vint64 *value, int64 newValue)
int64 oldValue;
status = disable_interrupts();
acquire_spinlock(&user_lock);
if ((addr)value < KERNEL_BASE || (addr)value > (KERNEL_TOP - 8))
if ((addr)value >= KERNEL_BASE && (addr)value <= KERNEL_TOP)
goto error;
if (user_memcpy(&oldValue, value, 8) < 0)
goto error;
@ -129,7 +131,7 @@ user_atomic_test_and_set64(vint64 *value, int64 newValue, int64 testAgainst)
int64 oldValue;
status = disable_interrupts();
acquire_spinlock(&user_lock);
if ((addr)value < KERNEL_BASE || (addr)value > (KERNEL_TOP - 8))
if ((addr)value >= KERNEL_BASE && (addr)value <= KERNEL_TOP)
goto error;
if (user_memcpy(&oldValue, value, 8) < 0)
goto error;
@ -154,7 +156,7 @@ user_atomic_add64(vint64 *value, int64 addValue)
int64 oldValue;
status = disable_interrupts();
acquire_spinlock(&user_lock);
if ((addr)value < KERNEL_BASE || (addr)value > (KERNEL_TOP - 8))
if ((addr)value >= KERNEL_BASE && (addr)value <= KERNEL_TOP)
goto error;
if (user_memcpy(&oldValue, value, 8) < 0)
goto error;
@ -179,7 +181,7 @@ user_atomic_and64(vint64 *value, int64 andValue)
int64 oldValue;
status = disable_interrupts();
acquire_spinlock(&user_lock);
if ((addr)value < KERNEL_BASE || (addr)value > (KERNEL_TOP - 8))
if ((addr)value >= KERNEL_BASE && (addr)value <= KERNEL_TOP)
goto error;
if (user_memcpy(&oldValue, value, 8) < 0)
goto error;
@ -204,7 +206,7 @@ user_atomic_or64(vint64 *value, int64 orValue)
int64 oldValue;
status = disable_interrupts();
acquire_spinlock(&user_lock);
if ((addr)value < KERNEL_BASE || (addr)value > (KERNEL_TOP - 8))
if ((addr)value >= KERNEL_BASE && (addr)value <= KERNEL_TOP)
goto error;
if (user_memcpy(&oldValue, value, 8) < 0)
goto error;
@ -229,7 +231,7 @@ user_atomic_read64(vint64 *value)
int64 oldValue;
status = disable_interrupts();
acquire_spinlock(&user_lock);
if ((addr)value < KERNEL_BASE || (addr)value > (KERNEL_TOP - 8))
if ((addr)value >= KERNEL_BASE && (addr)value <= KERNEL_TOP)
goto error;
if (user_memcpy(&oldValue, value, 8) < 0)
goto error;

View File

@ -5,7 +5,6 @@
#include <SupportDefs.h>
#include <ktypes.h>
#include <arch_cpu.h>
#include <syscalls.h>