aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-06 23:12:55 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-06 23:12:55 +0000
commit77b1fe8fa86809b7d2bc82abfe7e74fc047bedfe (patch)
tree93b4edfe4cc84a055247beaf23cce33242245333 /include/sys
parenta713518f5d9e4f7b1c361035f1f3ef79869a960f (diff)
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
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/kstat.h16
-rw-r--r--include/sys/sysmacros.h8
-rw-r--r--include/sys/thread.h7
-rw-r--r--include/sys/vmsystm.h34
4 files changed, 55 insertions, 10 deletions
diff --git a/include/sys/kstat.h b/include/sys/kstat.h
index dea7987f5..0b6ce0583 100644
--- a/include/sys/kstat.h
+++ b/include/sys/kstat.h
@@ -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)
{
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index 65070d858..1927a060d 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -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 */
diff --git a/include/sys/thread.h b/include/sys/thread.h
index d1009ab6d..4532aee5b 100644
--- a/include/sys/thread.h
+++ b/include/sys/thread.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);
diff --git a/include/sys/vmsystm.h b/include/sys/vmsystm.h
index 5d1c385b0..e66872f0c 100644
--- a/include/sys/vmsystm.h
+++ b/include/sys/vmsystm.h
@@ -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 */