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
This commit is contained in:
behlendo
2008-03-01 00:45:59 +00:00
parent 09b414e880
commit f4b377415b
34 changed files with 66 additions and 113 deletions
+3 -7
View File
@@ -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
-281
View File
@@ -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 <cdunlap@llnl.gov>.
*
* 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 */
-19
View File
@@ -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 */
-67
View File
@@ -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 */
+5
View File
@@ -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
+1 -1
View File
@@ -6,7 +6,7 @@ extern "C" {
#endif
#include <linux/module.h>
#include "spl-mutex.h"
#include <sys/mutex.h>
#define DEBUG_CALLB
+4
View File
@@ -0,0 +1,4 @@
#ifndef _SPL_CMN_ERR_H
#define _SPL_CMN_ERR_H
#endif /* SPL_CMN_ERR_H */
+4
View File
@@ -0,0 +1,4 @@
#ifndef _SPL_DEBUG_H
#define _SPL_DEBUG_H
#endif /* SPL_DEBUG_H */
+2 -2
View File
@@ -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. */
+1 -1
View File
@@ -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.
*
+4
View File
@@ -0,0 +1,4 @@
#ifndef _SPL_PARAM_H
#define _SPL_PARAM_H
#endif /* SPL_PARAM_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" {
+19
View File
@@ -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 */
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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 */