mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Add highbit func,
Add sloopy atomic declaration which will need to be fixed (eventually) Fill out more of the Solaris VM hooks Adjust the create_thread function git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@26 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
+15
-1
@@ -131,7 +131,21 @@ kstat_delete(kstat_t *ksp)
|
||||
}
|
||||
|
||||
/* FIXME - NONE OF THIS IS ATOMIC, IT SHOULD BE. For the moment this is
|
||||
* OK since it is only used for the noncritical kstat counters */
|
||||
* OK since it is only used for the noncritical kstat counters, and we
|
||||
* are only doing testing on x86_86 platform where the entire counter
|
||||
* will be updated with one instruction. */
|
||||
static __inline__ void
|
||||
atomic_inc_64(volatile uint64_t *target)
|
||||
{
|
||||
(*target)++;
|
||||
}
|
||||
|
||||
static __inline__ void
|
||||
atomic_dec_64(volatile uint64_t *target)
|
||||
{
|
||||
(*target)--;
|
||||
}
|
||||
|
||||
static __inline__ uint64_t
|
||||
atomic_add_64(volatile uint64_t *target, uint64_t delta)
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ extern "C" {
|
||||
#define bzero(ptr,size) memset(ptr,0,size)
|
||||
#define bcopy(src,dest,size) memcpy(dest,src,size)
|
||||
#define ASSERT(x) BUG_ON(!(x))
|
||||
#define VERIFY(x)
|
||||
#define VERIFY(x) ASSERT(x)
|
||||
|
||||
#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
|
||||
const TYPE __left = (TYPE)(LEFT); \
|
||||
@@ -103,10 +103,12 @@ extern "C" {
|
||||
#endif /* DTRACE_PROBE4 */
|
||||
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
|
||||
|
||||
/* Missing globals
|
||||
*/
|
||||
/* Missing globals */
|
||||
extern int p0;
|
||||
|
||||
/* Missing misc functions */
|
||||
extern int highbit(unsigned long i);
|
||||
|
||||
#define makedevice(maj,min) makedev(maj,min)
|
||||
|
||||
/* XXX - Borrowed from zfs project libsolcompat/include/sys/sysmacros.h */
|
||||
|
||||
@@ -31,14 +31,9 @@ extern "C" {
|
||||
#define thread_exit() __thread_exit()
|
||||
#define curthread get_current()
|
||||
|
||||
/* We just need a valid type to pass around, it's unused */
|
||||
typedef struct proc_s {
|
||||
int foo;
|
||||
} proc_t;
|
||||
|
||||
extern kthread_t *__thread_create(caddr_t stk, size_t stksize,
|
||||
void (*proc)(void *), void *args,
|
||||
size_t len, proc_t *pp, int state,
|
||||
size_t len, int *pp, int state,
|
||||
pri_t pri);
|
||||
extern void __thread_exit(void);
|
||||
|
||||
|
||||
@@ -4,5 +4,39 @@
|
||||
#include <linux/mm.h>
|
||||
|
||||
#define physmem num_physpages
|
||||
#define ptob(pages) (pages * PAGE_SIZE)
|
||||
#define membar_producer() smp_wmb()
|
||||
|
||||
#if 0
|
||||
/* The approximate total number of free pages */
|
||||
#define freemem 0
|
||||
|
||||
/* The average number of free pages over the last 5 seconds */
|
||||
#define avefree 0
|
||||
|
||||
/* The average number of free pages over the last 30 seconds */
|
||||
#define avefree30 0
|
||||
|
||||
/* A guess as to how much memory has been promised to
|
||||
* processes but not yet allocated */
|
||||
#define deficit 0
|
||||
|
||||
/* A guess as to how many page are needed to satisfy
|
||||
* stalled page creation requests */
|
||||
#define needfree 0
|
||||
|
||||
/* A bootlean the controls the setting of deficit */
|
||||
#define desperate
|
||||
|
||||
/* When free memory is above this limit, no paging or swapping is done */
|
||||
#define lotsfree 0
|
||||
|
||||
/* When free memory is above this limit, swapping is not performed */
|
||||
#define desfree 0
|
||||
|
||||
/* Threshold for many low memory tests, e.g. swapping is
|
||||
* more active below this limit */
|
||||
#define minfree 0
|
||||
#endif
|
||||
|
||||
#endif /* SPL_VMSYSTM_H */
|
||||
|
||||
Reference in New Issue
Block a user