Minor cleanup and Solaris API additions.

Minor formatting cleanups.

API additions:
* {U}INT8_{MIN,MAX}, {U}INT16_{MIN,MAX} macros.
* id_t typedef
* ddi_get_lbolt(), ddi_get_lbolt64() functions.
This commit is contained in:
Brian Behlendorf 2010-06-11 14:57:49 -07:00
parent b868e22f05
commit 32c6147dee
4 changed files with 41 additions and 28 deletions

View File

@ -26,10 +26,7 @@
#define _SPL_SID_H
typedef struct ksiddomain {
uint_t kd_ref;
uint_t kd_len;
char *kd_name;
avl_node_t kd_link;
} ksiddomain_t;
static inline ksiddomain_t *

View File

@ -38,10 +38,21 @@
#define FALSE 0
#define TRUE 1
#define INT8_MAX (127)
#define INT8_MIN (-128)
#define UINT8_MAX (255)
#define UINT8_MIN (0)
#define INT16_MAX (32767)
#define INT16_MIN (-32768)
#define UINT16_MAX (65535)
#define UINT16_MIN (0)
#define INT32_MAX INT_MAX
#define INT32_MIN INT_MIN
#define UINT32_MAX UINT_MAX
#define UINT32_MIN UINT_MIN
#define INT64_MAX LLONG_MAX
#define INT64_MIN LLONG_MIN
#define UINT64_MAX ULLONG_MAX
@ -178,6 +189,7 @@ extern void spl_cleanup(void);
* type of the alignment. For example, if (x) is of type uint64_t,
* and we want to round it up to a page boundary using "PAGESIZE" as
* the alignment, we can do either
*
* P2ROUNDUP(x, (uint64_t)PAGESIZE)
* or
* P2ROUNDUP_TYPED(x, PAGESIZE, uint64_t)

View File

@ -32,6 +32,9 @@
#define lbolt ((clock_t)jiffies)
#define lbolt64 ((int64_t)get_jiffies_64())
#define ddi_get_lbolt() ((clock_t)jiffies)
#define ddi_get_lbolt64() ((int64_t)get_jiffies_64())
#define delay(ticks) schedule_timeout((long)(ticks))
#endif /* _SPL_TIMER_H */

View File

@ -80,6 +80,7 @@ typedef ulong_t pfn_t;
typedef ulong_t pgcnt_t;
typedef long spgcnt_t;
typedef short index_t;
typedef int id_t;
extern proc_t p0;