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

View File

@ -1,6 +1,8 @@
DEFAULT_INCLUDES = -I. -I.. -I../lib
AM_CFLAGS = -g -O2 -W -Wall -Wstrict-prototypes -Wshadow
INCLUDES = -I$(top_srcdir)/include
sbin_PROGRAMS = splat
splat_SOURCES = splat.c
splat_LDFLAGS = $(top_builddir)/lib/libcommon.la
EXTRA_DIST = splat.h

View File

@ -2,7 +2,7 @@
#define _SPLAT_H
#include "list.h"
#include "splat-ctl.h"
#include "../include/splat-ctl.h"
#define DEV_NAME "/dev/splatctl"
#define COLOR_BLACK "\033[0;30m"

View File

@ -2,7 +2,7 @@ AC_INIT
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(spl, 0.0.1)
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_HEADERS([config.h])
AC_PROG_INSTALL
AC_PROG_CC
@ -115,6 +115,7 @@ AC_CONFIG_FILES([ Makefile
modules/spl/Makefile
modules/splat/Makefile
include/Makefile
include/sys/Makefile
scripts/Makefile
scripts/spl.spec
])

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

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 */

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
include/sys/Makefile.am Normal file
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

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
include/sys/cmn_err.h Normal file
View File

@ -0,0 +1,4 @@
#ifndef _SPL_CMN_ERR_H
#define _SPL_CMN_ERR_H
#endif /* SPL_CMN_ERR_H */

4
include/sys/debug.h Normal file
View File

@ -0,0 +1,4 @@
#ifndef _SPL_DEBUG_H
#define _SPL_DEBUG_H
#endif /* SPL_DEBUG_H */

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. */

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
include/sys/param.h Normal file
View File

@ -0,0 +1,4 @@
#ifndef _SPL_PARAM_H
#define _SPL_PARAM_H
#endif /* SPL_PARAM_H */

View File

@ -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
include/sys/spl.h Normal file
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 */

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

View File

@ -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

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 */

View File

@ -1,3 +1,7 @@
INCLUDES = -I$(top_srcdir)/include
DEFAULT_INCLUDES = -I. -I..
AM_CFLAGS = -g -O2 -W -Wall -Wstrict-prototypes -Wshadow
noinst_LTLIBRARIES = libcommon.la
libcommon_la_SOURCES = list.c
EXTRA_DIST = list.h

View File

@ -776,7 +776,7 @@ list_alloc_aux (int size, void *pfreelist)
void **plast;
assert(sizeof(char) == 1);
assert(size >= sizeof(void *));
assert(size >= (int)sizeof(void *));
assert(pfreelist != NULL);
assert(LIST_ALLOC > 0);
list_mutex_lock(&list_free_lock);

View File

@ -1,4 +1,4 @@
#include "spl-generic.h"
#include <sys/generic.h>
#include "config.h"
/*

View File

@ -1,4 +1,4 @@
#include "spl-kmem.h"
#include <sys/kmem.h>
/*
* Memory allocation interfaces

View File

@ -1,4 +1,4 @@
#include <spl-rwlock.h>
#include <sys/rwlock.h>
int
rw_lock_held(krwlock_t *rwlp)

View File

@ -1,4 +1,4 @@
#include <spl-taskq.h>
#include <sys/taskq.h>
/*
* Task queue interface

View File

@ -1,4 +1,4 @@
#include <spl-thread.h>
#include <sys/thread.h>
/*
* Thread interfaces

View File

@ -18,7 +18,7 @@
#include <asm/uaccess.h>
#include <stdarg.h>
#include "spl.h"
#include <sys/spl.h>
#include "splat-ctl.h"
#define SPLAT_SUBSYSTEM_INIT(type) \