summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/debug_ll.h16
-rw-r--r--include/fs.h3
-rw-r--r--include/linux/bitmap.h7
-rw-r--r--include/linux/bitops.h16
-rw-r--r--include/linux/err.h2
-rw-r--r--include/string.h1
6 files changed, 41 insertions, 4 deletions
diff --git a/include/debug_ll.h b/include/debug_ll.h
index 735033b314..856a157bf5 100644
--- a/include/debug_ll.h
+++ b/include/debug_ll.h
@@ -33,17 +33,25 @@ static inline void putc_ll(char value)
PUTC_LL(value);
}
-static inline void puthex_ll(unsigned long value)
+static inline void puthexc_ll(unsigned char value)
{
int i; unsigned char ch;
- for (i = sizeof(unsigned long) * 2; i--; ) {
+ for (i = 2; i--; ) {
ch = ((value >> (i * 4)) & 0xf);
ch += (ch >= 10) ? 'a' - 10 : '0';
putc_ll(ch);
}
}
+static inline void puthex_ll(unsigned long value)
+{
+ int i;
+
+ for (i = sizeof(unsigned long); i--; )
+ puthexc_ll(value >> (i * 8));
+}
+
/*
* Be careful with puts_ll, it only works if the binary is running at the
* link address which often is not the case during early startup. If in doubt
@@ -66,6 +74,10 @@ static inline void putc_ll(char value)
{
}
+static inline void puthexc_ll(unsigned char value)
+{
+}
+
static inline void puthex_ll(unsigned long value)
{
}
diff --git a/include/fs.h b/include/fs.h
index b501db38ad..f96839f9eb 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -147,6 +147,9 @@ int ls(const char *path, ulong flags);
char *mkmodestr(unsigned long mode, char *str);
+void stat_print(const char *filename, const struct stat *st);
+void cdev_print(const struct cdev *cdev);
+
char *canonicalize_path(const char *pathname);
char *get_mounted_path(const char *path);
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index adaf5428fe..7d06fac68d 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -81,6 +81,13 @@
*/
/*
+ * Allocation and deallocation of bitmap.
+ * Provided in lib/bitmap.c to avoid circular dependency.
+ */
+unsigned long *bitmap_zalloc(unsigned int nbits);
+unsigned long *bitmap_xzalloc(unsigned int nbits);
+
+/*
* lib/bitmap.c provides these functions:
*/
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 645fd2e6f6..eb5ff37f2f 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -2,7 +2,7 @@
#ifndef _LINUX_BITOPS_H
#define _LINUX_BITOPS_H
-#include <asm/types.h>
+#include <linux/types.h>
#ifdef __KERNEL__
#define BIT(nr) (1UL << (nr))
@@ -194,6 +194,20 @@ static inline unsigned long __ffs64(u64 word)
return __ffs((unsigned long)word);
}
+/**
+ * assign_bit - Assign value to a bit in memory
+ * @nr: the bit to set
+ * @addr: the address to start counting from
+ * @value: the value to assign
+ */
+static inline void assign_bit(long nr, volatile unsigned long *addr, bool value)
+{
+ if (value)
+ set_bit(nr, addr);
+ else
+ clear_bit(nr, addr);
+}
+
#ifdef __KERNEL__
#ifndef set_mask_bits
diff --git a/include/linux/err.h b/include/linux/err.h
index 69efc7c4ac..db7ad6cc5b 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -19,7 +19,7 @@
#ifndef __ASSEMBLY__
-#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+#define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
static inline void *ERR_PTR(long error)
{
diff --git a/include/string.h b/include/string.h
index d423bee6fb..499f2ec03c 100644
--- a/include/string.h
+++ b/include/string.h
@@ -4,6 +4,7 @@
#include <linux/string.h>
+void *mempcpy(void *dest, const void *src, size_t count);
int strtobool(const char *str, int *val);
char *strsep_unescaped(char **, const char *);
char *stpcpy(char *dest, const char *src);