summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-01 00:45:59 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-03-01 00:45:59 +0000
commitf4b377415b4b53722addedc10801db24ad4e6f23 (patch)
treebe8f09aeabfeaf2361d8d84e975c49ec68d96483 /include
parent09b414e880b0c2e4ae08d82354bbae034dafdd9e (diff)
Reorganize /include/ to add a /sys/, this way we don't need to
muck with #includes in existing Solaris style source to get it to find the right stuff. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@18 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am10
-rw-r--r--include/list.h281
-rw-r--r--include/spl.h19
-rw-r--r--include/splat-ctl.h67
-rw-r--r--include/sys/Makefile.am5
-rw-r--r--include/sys/callb.h (renamed from include/spl-callb.h)2
-rw-r--r--include/sys/cmn_err.h4
-rw-r--r--include/sys/condvar.h (renamed from include/spl-condvar.h)0
-rw-r--r--include/sys/cred.h (renamed from include/spl-cred.h)0
-rw-r--r--include/sys/debug.h4
-rw-r--r--include/sys/generic.h (renamed from include/spl-generic.h)0
-rw-r--r--include/sys/kmem.h (renamed from include/spl-kmem.h)0
-rw-r--r--include/sys/kstat.h (renamed from include/spl-kstat.h)4
-rw-r--r--include/sys/mutex.h (renamed from include/spl-mutex.h)2
-rw-r--r--include/sys/param.h4
-rw-r--r--include/sys/random.h (renamed from include/spl-random.h)0
-rw-r--r--include/sys/rwlock.h (renamed from include/spl-rwlock.h)2
-rw-r--r--include/sys/spl.h19
-rw-r--r--include/sys/taskq.h (renamed from include/spl-taskq.h)2
-rw-r--r--include/sys/thread.h (renamed from include/spl-thread.h)4
-rw-r--r--include/sys/time.h (renamed from include/spl-time.h)2
-rw-r--r--include/sys/timer.h (renamed from include/spl-timer.h)0
-rw-r--r--include/sys/types.h (renamed from include/spl-types.h)0
23 files changed, 48 insertions, 383 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index b84da9a8e..161a93a8d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,7 +1,3 @@
-EXTRA_DIST = spl.h
-EXTRA_DIST += spl-condvar.h spl-kmem.h spl-random.h spl-thread.h
-EXTRA_DIST += spl-types.h spl-cred.h spl-kstat.h spl-rwlock.h
-EXTRA_DIST += spl-time.h spl-callb.h spl-generic.h spl-mutex.h
-EXTRA_DIST += spl-taskq.h spl-timer.h
-EXTRA_DIST += splat-ctl.h
-EXTRA_DIST += list.h
+SUBDIRS = sys
+
+EXTRA_DIST = splat-ctl.h
diff --git a/include/list.h b/include/list.h
deleted file mode 100644
index fe3fd006b..000000000
--- a/include/list.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/*****************************************************************************
- * $Id: list.h 2899 2002-12-11 19:00:36Z dun $
- *****************************************************************************
- * Copyright (C) 2001-2002 The Regents of the University of California.
- * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- * Written by Chris Dunlap <[email protected]>.
- *
- * This file is from LSD-Tools, the LLNL Software Development Toolbox.
- *
- * LSD-Tools is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * LSD-Tools is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with LSD-Tools; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *****************************************************************************/
-
-
-#ifndef LSD_LIST_H
-#define LSD_LIST_H
-
-
-/***********
- * Notes *
- ***********/
-/*
- * If NDEBUG is not defined, internal debug code will be enabled. This is
- * intended for development use only and production code should define NDEBUG.
- *
- * If WITH_LSD_FATAL_ERROR_FUNC is defined, the linker will expect to
- * find an external lsd_fatal_error(file,line,mesg) function. By default,
- * lsd_fatal_error(file,line,mesg) is a macro definition that outputs an
- * error message to stderr. This macro may be redefined to invoke another
- * routine instead.
- *
- * If WITH_LSD_NOMEM_ERROR_FUNC is defined, the linker will expect to
- * find an external lsd_nomem_error(file,line,mesg) function. By default,
- * lsd_nomem_error(file,line,mesg) is a macro definition that returns NULL.
- * This macro may be redefined to invoke another routine instead.
- *
- * If WITH_PTHREADS is defined, these routines will be thread-safe.
- */
-
-
-/****************
- * Data Types *
- ****************/
-
-typedef struct list * List;
-/*
- * List opaque data type.
- */
-
-typedef struct listIterator * ListIterator;
-/*
- * List Iterator opaque data type.
- */
-
-typedef void (*ListDelF) (void *x);
-/*
- * Function prototype to deallocate data stored in a list.
- * This function is responsible for freeing all memory associated
- * with an item, including all subordinate items (if applicable).
- */
-
-typedef int (*ListCmpF) (void *x, void *y);
-/*
- * Function prototype for comparing two items in a list.
- * Returns less-than-zero if (x<y), zero if (x==y), and
- * greather-than-zero if (x>y).
- */
-
-typedef int (*ListFindF) (void *x, void *key);
-/*
- * Function prototype for matching items in a list.
- * Returns non-zero if (x==key); o/w returns zero.
- */
-
-typedef int (*ListForF) (void *x, void *arg);
-/*
- * Function prototype for operating on each item in a list.
- * Returns less-than-zero on error.
- */
-
-
-/*******************************
- * General-Purpose Functions *
- *******************************/
-
-List list_create (ListDelF f);
-/*
- * Creates and returns a new empty list, or lsd_nomem_error() on failure.
- * The deletion function [f] is used to deallocate memory used by items
- * in the list; if this is NULL, memory associated with these items
- * will not be freed when the list is destroyed.
- * Note: Abandoning a list without calling list_destroy() will result
- * in a memory leak.
- */
-
-void list_destroy (List l);
-/*
- * Destroys list [l], freeing memory used for list iterators and the
- * list itself; if a deletion function was specified when the list
- * was created, it will be called for each item in the list.
- */
-
-int list_is_empty (List l);
-/*
- * Returns non-zero if list [l] is empty; o/w returns zero.
- */
-
-int list_count (List l);
-/*
- * Returns the number of items in list [l].
- */
-
-
-/***************************
- * List Access Functions *
- ***************************/
-
-void * list_append (List l, void *x);
-/*
- * Inserts data [x] at the end of list [l].
- * Returns the data's ptr, or lsd_nomem_error() if insertion failed.
- */
-
-void * list_prepend (List l, void *x);
-/*
- * Inserts data [x] at the beginning of list [l].
- * Returns the data's ptr, or lsd_nomem_error() if insertion failed.
- */
-
-void * list_find_first (List l, ListFindF f, void *key);
-/*
- * Traverses list [l] using [f] to match each item with [key].
- * Returns a ptr to the first item for which the function [f]
- * returns non-zero, or NULL if no such item is found.
- * Note: This function differs from list_find() in that it does not require
- * a list iterator; it should only be used when all list items are known
- * to be unique (according to the function [f]).
- */
-
-int list_delete_all (List l, ListFindF f, void *key);
-/*
- * Traverses list [l] using [f] to match each item with [key].
- * Removes all items from the list for which the function [f] returns
- * non-zero; if a deletion function was specified when the list was
- * created, it will be called to deallocate each item being removed.
- * Returns a count of the number of items removed from the list.
- */
-
-int list_for_each (List l, ListForF f, void *arg);
-/*
- * For each item in list [l], invokes the function [f] with [arg].
- * Returns a count of the number of items on which [f] was invoked.
- * If [f] returns <0 for a given item, the iteration is aborted and the
- * function returns the negative of that item's position in the list.
- */
-
-void list_sort (List l, ListCmpF f);
-/*
- * Sorts list [l] into ascending order according to the function [f].
- * Note: Sorting a list resets all iterators associated with the list.
- * Note: The sort algorithm is stable.
- */
-
-
-/****************************
- * Stack Access Functions *
- ****************************/
-
-void * list_push (List l, void *x);
-/*
- * Pushes data [x] onto the top of stack [l].
- * Returns the data's ptr, or lsd_nomem_error() if insertion failed.
- */
-
-void * list_pop (List l);
-/*
- * Pops the data item at the top of the stack [l].
- * Returns the data's ptr, or NULL if the stack is empty.
- */
-
-void * list_peek (List l);
-/*
- * Peeks at the data item at the top of the stack (or head of the queue) [l].
- * Returns the data's ptr, or NULL if the stack (or queue) is empty.
- * Note: The item is not removed from the list.
- */
-
-
-/****************************
- * Queue Access Functions *
- ****************************/
-
-void * list_enqueue (List l, void *x);
-/*
- * Enqueues data [x] at the tail of queue [l].
- * Returns the data's ptr, or lsd_nomem_error() if insertion failed.
- */
-
-void * list_dequeue (List l);
-/*
- * Dequeues the data item at the head of the queue [l].
- * Returns the data's ptr, or NULL if the queue is empty.
- */
-
-
-/*****************************
- * List Iterator Functions *
- *****************************/
-
-ListIterator list_iterator_create (List l);
-/*
- * Creates and returns a list iterator for non-destructively traversing
- * list [l], or lsd_nomem_error() on failure.
- */
-
-void list_iterator_reset (ListIterator i);
-/*
- * Resets the list iterator [i] to start traversal at the beginning
- * of the list.
- */
-
-void list_iterator_destroy (ListIterator i);
-/*
- * Destroys the list iterator [i]; list iterators not explicitly destroyed
- * in this manner will be destroyed when the list is deallocated via
- * list_destroy().
- */
-
-void * list_next (ListIterator i);
-/*
- * Returns a ptr to the next item's data,
- * or NULL once the end of the list is reached.
- * Example: i=list_iterator_create(i); while ((x=list_next(i))) {...}
- */
-
-void * list_insert (ListIterator i, void *x);
-/*
- * Inserts data [x] immediately before the last item returned via list
- * iterator [i]; once the list iterator reaches the end of the list,
- * insertion is made at the list's end.
- * Returns the data's ptr, or lsd_nomem_error() if insertion failed.
- */
-
-void * list_find (ListIterator i, ListFindF f, void *key);
-/*
- * Traverses the list from the point of the list iterator [i]
- * using [f] to match each item with [key].
- * Returns a ptr to the next item for which the function [f]
- * returns non-zero, or NULL once the end of the list is reached.
- * Example: i=list_iterator_reset(i); while ((x=list_find(i,f,k))) {...}
- */
-
-void * list_remove (ListIterator i);
-/*
- * Removes from the list the last item returned via list iterator [i]
- * and returns the data's ptr.
- * Note: The client is responsible for freeing the returned data.
- */
-
-int list_delete (ListIterator i);
-/*
- * Removes from the list the last item returned via list iterator [i];
- * if a deletion function was specified when the list was created,
- * it will be called to deallocate the item being removed.
- * Returns a count of the number of items removed from the list
- * (ie, '1' if the item was removed, and '0' otherwise).
- */
-
-
-#endif /* !LSD_LIST_H */
diff --git a/include/spl.h b/include/spl.h
deleted file mode 100644
index d069fd94d..000000000
--- a/include/spl.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _SPL_H
-#define _SPL_H
-
-#include "spl-callb.h"
-#include "spl-condvar.h"
-#include "spl-cred.h"
-#include "spl-generic.h"
-#include "spl-kmem.h"
-#include "spl-kstat.h"
-#include "spl-mutex.h"
-#include "spl-random.h"
-#include "spl-rwlock.h"
-#include "spl-taskq.h"
-#include "spl-thread.h"
-#include "spl-time.h"
-#include "spl-timer.h"
-#include "spl-types.h"
-
-#endif /* _SPL_H */
diff --git a/include/splat-ctl.h b/include/splat-ctl.h
deleted file mode 100644
index d905340fb..000000000
--- a/include/splat-ctl.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _SPLAT_CTL_H
-#define _SPLAT_CTL_H
-
-/* Contains shared definitions which both the userspace
- * and kernelspace portions of splat must agree on.
- */
-
-#define SPLAT_MAJOR 229 /* XXX - Arbitrary */
-#define SPLAT_MINORS 1
-#define SPLAT_DEV "/dev/splatctl"
-
-#define SPLAT_NAME_SIZE 12
-#define SPLAT_DESC_SIZE 60
-
-typedef struct splat_user {
- char name[SPLAT_NAME_SIZE]; /* short name */
- char desc[SPLAT_DESC_SIZE]; /* short description */
- int id; /* unique numeric id */
-} splat_user_t;
-
-#define SPLAT_CFG_MAGIC 0x15263748U
-typedef struct splat_cfg {
- unsigned int cfg_magic; /* Unique magic */
- int cfg_cmd; /* Config command */
- int cfg_arg1; /* Config command arg 1 */
- int cfg_rc1; /* Config response 1 */
- union {
- struct {
- int size;
- splat_user_t descs[0];
- } splat_subsystems;
- struct {
- int size;
- splat_user_t descs[0];
- } splat_tests;
- } cfg_data;
-} splat_cfg_t;
-
-#define SPLAT_CMD_MAGIC 0x9daebfc0U
-typedef struct splat_cmd {
- unsigned int cmd_magic; /* Unique magic */
- int cmd_subsystem; /* Target subsystem */
- int cmd_test; /* Subsystem test */
- int cmd_data_size; /* Extra opaque data */
- char cmd_data_str[0]; /* Opaque data region */
-} splat_cmd_t;
-
-/* Valid ioctls */
-#define SPLAT_CFG _IOWR('f', 101, long)
-#define SPLAT_CMD _IOWR('f', 102, long)
-
-/* Valid configuration commands */
-#define SPLAT_CFG_BUFFER_CLEAR 0x001 /* Clear text buffer */
-#define SPLAT_CFG_BUFFER_SIZE 0x002 /* Resize text buffer */
-#define SPLAT_CFG_SUBSYSTEM_COUNT 0x101 /* Number of subsystem */
-#define SPLAT_CFG_SUBSYSTEM_LIST 0x102 /* List of N subsystems */
-#define SPLAT_CFG_TEST_COUNT 0x201 /* Number of tests */
-#define SPLAT_CFG_TEST_LIST 0x202 /* List of N tests */
-
-/* Valid subsystem and test commands defined in each subsystem, we do
- * need to be careful to avoid colisions. That alone may argue to define
- * them all here, for now we just define the global error codes.
- */
-#define SPLAT_SUBSYSTEM_UNKNOWN 0xF00
-#define SPLAT_TEST_UNKNOWN 0xFFF
-
-#endif /* _SPLAT_CTL_H */
diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
new file mode 100644
index 000000000..c44748e02
--- /dev/null
+++ b/include/sys/Makefile.am
@@ -0,0 +1,5 @@
+EXTRA_DIST = callb.h cmn_err.h condvar.h cred.h
+EXTRA_DIST += debug.h generic.h kmem.h kstat.h
+EXTRA_DIST += mutex.h param.h random.h rwlock.h
+EXTRA_DIST += spl.h taskq.h thread.h time.h
+EXTRA_DIST += timer.h types.h
diff --git a/include/spl-callb.h b/include/sys/callb.h
index 98b966778..053ddf500 100644
--- a/include/spl-callb.h
+++ b/include/sys/callb.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
#include <linux/module.h>
-#include "spl-mutex.h"
+#include <sys/mutex.h>
#define DEBUG_CALLB
diff --git a/include/sys/cmn_err.h b/include/sys/cmn_err.h
new file mode 100644
index 000000000..44ccefc9f
--- /dev/null
+++ b/include/sys/cmn_err.h
@@ -0,0 +1,4 @@
+#ifndef _SPL_CMN_ERR_H
+#define _SPL_CMN_ERR_H
+
+#endif /* SPL_CMN_ERR_H */
diff --git a/include/spl-condvar.h b/include/sys/condvar.h
index 6a2060fd2..6a2060fd2 100644
--- a/include/spl-condvar.h
+++ b/include/sys/condvar.h
diff --git a/include/spl-cred.h b/include/sys/cred.h
index 0935a19fa..0935a19fa 100644
--- a/include/spl-cred.h
+++ b/include/sys/cred.h
diff --git a/include/sys/debug.h b/include/sys/debug.h
new file mode 100644
index 000000000..02f64c2cf
--- /dev/null
+++ b/include/sys/debug.h
@@ -0,0 +1,4 @@
+#ifndef _SPL_DEBUG_H
+#define _SPL_DEBUG_H
+
+#endif /* SPL_DEBUG_H */
diff --git a/include/spl-generic.h b/include/sys/generic.h
index 2d0989233..2d0989233 100644
--- a/include/spl-generic.h
+++ b/include/sys/generic.h
diff --git a/include/spl-kmem.h b/include/sys/kmem.h
index 89367c069..89367c069 100644
--- a/include/spl-kmem.h
+++ b/include/sys/kmem.h
diff --git a/include/spl-kstat.h b/include/sys/kstat.h
index cbef067d5..0b79a41c0 100644
--- a/include/spl-kstat.h
+++ b/include/sys/kstat.h
@@ -6,8 +6,8 @@ extern "C" {
#endif
#include <linux/module.h>
-#include "spl-types.h"
-#include "spl-time.h"
+#include <sys/types.h>
+#include <sys/time.h>
/* XXX - The minimum functionality here is stubbed out but nothing works. */
diff --git a/include/spl-mutex.h b/include/sys/mutex.h
index dec5dd7de..2db4a7f96 100644
--- a/include/spl-mutex.h
+++ b/include/sys/mutex.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
#include <linux/module.h>
-#include "spl-types.h"
+#include <sys/types.h>
/* See the "Big Theory Statement" in solaris mutex.c.
*
diff --git a/include/sys/param.h b/include/sys/param.h
new file mode 100644
index 000000000..f924006ef
--- /dev/null
+++ b/include/sys/param.h
@@ -0,0 +1,4 @@
+#ifndef _SPL_PARAM_H
+#define _SPL_PARAM_H
+
+#endif /* SPL_PARAM_H */
diff --git a/include/spl-random.h b/include/sys/random.h
index b7f83ce1a..b7f83ce1a 100644
--- a/include/spl-random.h
+++ b/include/sys/random.h
diff --git a/include/spl-rwlock.h b/include/sys/rwlock.h
index b04a4f0db..6c55ced98 100644
--- a/include/spl-rwlock.h
+++ b/include/sys/rwlock.h
@@ -5,7 +5,7 @@
#include <linux/slab.h>
#include <linux/rwsem.h>
#include <asm/current.h>
-#include "spl-types.h"
+#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
diff --git a/include/sys/spl.h b/include/sys/spl.h
new file mode 100644
index 000000000..7cc1cab58
--- /dev/null
+++ b/include/sys/spl.h
@@ -0,0 +1,19 @@
+#ifndef _SPL_H
+#define _SPL_H
+
+#include <sys/callb.h>
+#include <sys/condvar.h>
+#include <sys/cred.h>
+#include <sys/generic.h>
+#include <sys/kmem.h>
+#include <sys/kstat.h>
+#include <sys/mutex.h>
+#include <sys/random.h>
+#include <sys/rwlock.h>
+#include <sys/taskq.h>
+#include <sys/thread.h>
+#include <sys/time.h>
+#include <sys/timer.h>
+#include <sys/types.h>
+
+#endif /* _SPL_H */
diff --git a/include/spl-taskq.h b/include/sys/taskq.h
index 3723a6d47..2d7583daf 100644
--- a/include/spl-taskq.h
+++ b/include/sys/taskq.h
@@ -24,7 +24,7 @@ extern "C" {
#include <linux/gfp.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
-#include "spl-types.h"
+#include <sys/types.h>
#undef DEBUG_TASKQ_UNIMPLEMENTED
diff --git a/include/spl-thread.h b/include/sys/thread.h
index 8833846e9..e7f99c96d 100644
--- a/include/spl-thread.h
+++ b/include/sys/thread.h
@@ -8,8 +8,8 @@ extern "C" {
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
-#include "spl-types.h"
-#include "spl-generic.h"
+#include <sys/types.h>
+#include <sys/generic.h>
/*
* Thread interfaces
diff --git a/include/spl-time.h b/include/sys/time.h
index 576fd191c..726bd5f8a 100644
--- a/include/spl-time.h
+++ b/include/sys/time.h
@@ -12,7 +12,7 @@ extern "C" {
#include <linux/module.h>
#include <linux/time.h>
-#include "spl-types.h"
+#include <sys/types.h>
extern unsigned long long monotonic_clock(void);
typedef struct timespec timestruc_t; /* definition per SVr4 */
diff --git a/include/spl-timer.h b/include/sys/timer.h
index 237195d76..237195d76 100644
--- a/include/spl-timer.h
+++ b/include/sys/timer.h
diff --git a/include/spl-types.h b/include/sys/types.h
index b72b6c9e0..b72b6c9e0 100644
--- a/include/spl-types.h
+++ b/include/sys/types.h