aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h59
1 files changed, 35 insertions, 24 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 953352a8833..54bf5a471e1 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -56,6 +56,14 @@
56 56
57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
59#define DIV_ROUND_UP_ULL(ll,d) \
60 ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
61
62#if BITS_PER_LONG == 32
63# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
64#else
65# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
66#endif
59 67
60/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ 68/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
61#define roundup(x, y) ( \ 69#define roundup(x, y) ( \
@@ -121,7 +129,7 @@ extern int _cond_resched(void);
121# define might_resched() do { } while (0) 129# define might_resched() do { } while (0)
122#endif 130#endif
123 131
124#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 132#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
125 void __might_sleep(const char *file, int line, int preempt_offset); 133 void __might_sleep(const char *file, int line, int preempt_offset);
126/** 134/**
127 * might_sleep - annotation for functions that can sleep 135 * might_sleep - annotation for functions that can sleep
@@ -646,29 +654,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
646 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 654 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
647 (type *)( (char *)__mptr - offsetof(type,member) );}) 655 (type *)( (char *)__mptr - offsetof(type,member) );})
648 656
649struct sysinfo;
650extern int do_sysinfo(struct sysinfo *info);
651
652#endif /* __KERNEL__ */
653
654#define SI_LOAD_SHIFT 16
655struct sysinfo {
656 long uptime; /* Seconds since boot */
657 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
658 unsigned long totalram; /* Total usable main memory size */
659 unsigned long freeram; /* Available memory size */
660 unsigned long sharedram; /* Amount of shared memory */
661 unsigned long bufferram; /* Memory used by buffers */
662 unsigned long totalswap; /* Total swap space size */
663 unsigned long freeswap; /* swap space still available */
664 unsigned short procs; /* Number of current processes */
665 unsigned short pad; /* explicit padding for m68k */
666 unsigned long totalhigh; /* Total high memory size */
667 unsigned long freehigh; /* Available high memory size */
668 unsigned int mem_unit; /* Memory unit size in bytes */
669 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
670};
671
672#ifdef __CHECKER__ 657#ifdef __CHECKER__
673#define BUILD_BUG_ON_NOT_POWER_OF_2(n) 658#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
674#define BUILD_BUG_ON_ZERO(e) (0) 659#define BUILD_BUG_ON_ZERO(e) (0)
@@ -736,4 +721,30 @@ extern int __build_bug_on_failed;
736# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 721# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
737#endif 722#endif
738 723
724struct sysinfo;
725extern int do_sysinfo(struct sysinfo *info);
726
727#endif /* __KERNEL__ */
728
729#define SI_LOAD_SHIFT 16
730struct sysinfo {
731 long uptime; /* Seconds since boot */
732 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
733 unsigned long totalram; /* Total usable main memory size */
734 unsigned long freeram; /* Available memory size */
735 unsigned long sharedram; /* Amount of shared memory */
736 unsigned long bufferram; /* Memory used by buffers */
737 unsigned long totalswap; /* Total swap space size */
738 unsigned long freeswap; /* swap space still available */
739 unsigned short procs; /* Number of current processes */
740 unsigned short pad; /* explicit padding for m68k */
741 unsigned long totalhigh; /* Total high memory size */
742 unsigned long freehigh; /* Available high memory size */
743 unsigned int mem_unit; /* Memory unit size in bytes */
744 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
745};
746
747/* To identify board information in panic logs, set this */
748extern char *mach_panic_string;
749
739#endif 750#endif