aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/drm/radeon_drm.h6
-rw-r--r--include/linux/bitmap.h18
-rw-r--r--include/linux/cpumask.h20
-rw-r--r--include/linux/gen_stats.h5
-rw-r--r--include/linux/mm.h15
-rw-r--r--include/linux/mm_types.h2
-rw-r--r--include/linux/pm.h101
-rw-r--r--include/linux/pm_runtime.h114
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/security.h24
-rw-r--r--include/net/act_api.h2
-rw-r--r--include/net/gen_stats.h10
-rw-r--r--include/net/netfilter/xt_rateest.h2
-rw-r--r--include/net/sch_generic.h2
14 files changed, 270 insertions, 52 deletions
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index af4b4826997e..2ba61e18fc8b 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -508,6 +508,7 @@ typedef struct {
508#define DRM_RADEON_INFO 0x27 508#define DRM_RADEON_INFO 0x27
509#define DRM_RADEON_GEM_SET_TILING 0x28 509#define DRM_RADEON_GEM_SET_TILING 0x28
510#define DRM_RADEON_GEM_GET_TILING 0x29 510#define DRM_RADEON_GEM_GET_TILING 0x29
511#define DRM_RADEON_GEM_BUSY 0x2a
511 512
512#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) 513#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
513#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) 514#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
@@ -548,6 +549,7 @@ typedef struct {
548#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) 549#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
549#define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling) 550#define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
550#define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling) 551#define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
552#define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
551 553
552typedef struct drm_radeon_init { 554typedef struct drm_radeon_init {
553 enum { 555 enum {
@@ -707,6 +709,7 @@ typedef struct drm_radeon_indirect {
707#define RADEON_PARAM_FB_LOCATION 14 /* FB location */ 709#define RADEON_PARAM_FB_LOCATION 14 /* FB location */
708#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ 710#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
709#define RADEON_PARAM_DEVICE_ID 16 711#define RADEON_PARAM_DEVICE_ID 16
712#define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */
710 713
711typedef struct drm_radeon_getparam { 714typedef struct drm_radeon_getparam {
712 int param; 715 int param;
@@ -838,7 +841,7 @@ struct drm_radeon_gem_wait_idle {
838 841
839struct drm_radeon_gem_busy { 842struct drm_radeon_gem_busy {
840 uint32_t handle; 843 uint32_t handle;
841 uint32_t busy; 844 uint32_t domain;
842}; 845};
843 846
844struct drm_radeon_gem_pread { 847struct drm_radeon_gem_pread {
@@ -895,6 +898,7 @@ struct drm_radeon_cs {
895 898
896#define RADEON_INFO_DEVICE_ID 0x00 899#define RADEON_INFO_DEVICE_ID 0x00
897#define RADEON_INFO_NUM_GB_PIPES 0x01 900#define RADEON_INFO_NUM_GB_PIPES 0x01
901#define RADEON_INFO_NUM_Z_PIPES 0x02
898 902
899struct drm_radeon_info { 903struct drm_radeon_info {
900 uint32_t request; 904 uint32_t request;
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 2878811c6134..756d78b8c1c5 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -94,13 +94,13 @@ extern void __bitmap_shift_right(unsigned long *dst,
94 const unsigned long *src, int shift, int bits); 94 const unsigned long *src, int shift, int bits);
95extern void __bitmap_shift_left(unsigned long *dst, 95extern void __bitmap_shift_left(unsigned long *dst,
96 const unsigned long *src, int shift, int bits); 96 const unsigned long *src, int shift, int bits);
97extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, 97extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1,
98 const unsigned long *bitmap2, int bits); 98 const unsigned long *bitmap2, int bits);
99extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, 99extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1,
100 const unsigned long *bitmap2, int bits); 100 const unsigned long *bitmap2, int bits);
101extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, 101extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1,
102 const unsigned long *bitmap2, int bits); 102 const unsigned long *bitmap2, int bits);
103extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, 103extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1,
104 const unsigned long *bitmap2, int bits); 104 const unsigned long *bitmap2, int bits);
105extern int __bitmap_intersects(const unsigned long *bitmap1, 105extern int __bitmap_intersects(const unsigned long *bitmap1,
106 const unsigned long *bitmap2, int bits); 106 const unsigned long *bitmap2, int bits);
@@ -171,13 +171,12 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src,
171 } 171 }
172} 172}
173 173
174static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, 174static inline int bitmap_and(unsigned long *dst, const unsigned long *src1,
175 const unsigned long *src2, int nbits) 175 const unsigned long *src2, int nbits)
176{ 176{
177 if (small_const_nbits(nbits)) 177 if (small_const_nbits(nbits))
178 *dst = *src1 & *src2; 178 return (*dst = *src1 & *src2) != 0;
179 else 179 return __bitmap_and(dst, src1, src2, nbits);
180 __bitmap_and(dst, src1, src2, nbits);
181} 180}
182 181
183static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, 182static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
@@ -198,13 +197,12 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1,
198 __bitmap_xor(dst, src1, src2, nbits); 197 __bitmap_xor(dst, src1, src2, nbits);
199} 198}
200 199
201static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, 200static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1,
202 const unsigned long *src2, int nbits) 201 const unsigned long *src2, int nbits)
203{ 202{
204 if (small_const_nbits(nbits)) 203 if (small_const_nbits(nbits))
205 *dst = *src1 & ~(*src2); 204 return (*dst = *src1 & ~(*src2)) != 0;
206 else 205 return __bitmap_andnot(dst, src1, src2, nbits);
207 __bitmap_andnot(dst, src1, src2, nbits);
208} 206}
209 207
210static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, 208static inline void bitmap_complement(unsigned long *dst, const unsigned long *src,
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index c5ac87ca7bc6..796df12091b7 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -43,10 +43,10 @@
43 * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask 43 * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask
44 * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask 44 * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask
45 * 45 *
46 * void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] 46 * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]
47 * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] 47 * void cpus_or(dst, src1, src2) dst = src1 | src2 [union]
48 * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 48 * void cpus_xor(dst, src1, src2) dst = src1 ^ src2
49 * void cpus_andnot(dst, src1, src2) dst = src1 & ~src2 49 * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2
50 * void cpus_complement(dst, src) dst = ~src 50 * void cpus_complement(dst, src) dst = ~src
51 * 51 *
52 * int cpus_equal(mask1, mask2) Does mask1 == mask2? 52 * int cpus_equal(mask1, mask2) Does mask1 == mask2?
@@ -179,10 +179,10 @@ static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
179} 179}
180 180
181#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) 181#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
182static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, 182static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
183 const cpumask_t *src2p, int nbits) 183 const cpumask_t *src2p, int nbits)
184{ 184{
185 bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); 185 return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
186} 186}
187 187
188#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) 188#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
@@ -201,10 +201,10 @@ static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
201 201
202#define cpus_andnot(dst, src1, src2) \ 202#define cpus_andnot(dst, src1, src2) \
203 __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) 203 __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
204static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, 204static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
205 const cpumask_t *src2p, int nbits) 205 const cpumask_t *src2p, int nbits)
206{ 206{
207 bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); 207 return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
208} 208}
209 209
210#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) 210#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
@@ -738,11 +738,11 @@ static inline void cpumask_clear(struct cpumask *dstp)
738 * @src1p: the first input 738 * @src1p: the first input
739 * @src2p: the second input 739 * @src2p: the second input
740 */ 740 */
741static inline void cpumask_and(struct cpumask *dstp, 741static inline int cpumask_and(struct cpumask *dstp,
742 const struct cpumask *src1p, 742 const struct cpumask *src1p,
743 const struct cpumask *src2p) 743 const struct cpumask *src2p)
744{ 744{
745 bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), 745 return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p),
746 cpumask_bits(src2p), nr_cpumask_bits); 746 cpumask_bits(src2p), nr_cpumask_bits);
747} 747}
748 748
@@ -779,11 +779,11 @@ static inline void cpumask_xor(struct cpumask *dstp,
779 * @src1p: the first input 779 * @src1p: the first input
780 * @src2p: the second input 780 * @src2p: the second input
781 */ 781 */
782static inline void cpumask_andnot(struct cpumask *dstp, 782static inline int cpumask_andnot(struct cpumask *dstp,
783 const struct cpumask *src1p, 783 const struct cpumask *src1p,
784 const struct cpumask *src2p) 784 const struct cpumask *src2p)
785{ 785{
786 bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), 786 return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p),
787 cpumask_bits(src2p), nr_cpumask_bits); 787 cpumask_bits(src2p), nr_cpumask_bits);
788} 788}
789 789
diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h
index 0ffa41df0ee8..710e901085d0 100644
--- a/include/linux/gen_stats.h
+++ b/include/linux/gen_stats.h
@@ -22,6 +22,11 @@ struct gnet_stats_basic
22{ 22{
23 __u64 bytes; 23 __u64 bytes;
24 __u32 packets; 24 __u32 packets;
25};
26struct gnet_stats_basic_packed
27{
28 __u64 bytes;
29 __u32 packets;
25} __attribute__ ((packed)); 30} __attribute__ ((packed));
26 31
27/** 32/**
diff --git a/include/linux/mm.h b/include/linux/mm.h
index ba3a7cb1eaa0..9a72cc78e6b8 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -34,8 +34,6 @@ extern int sysctl_legacy_va_layout;
34#define sysctl_legacy_va_layout 0 34#define sysctl_legacy_va_layout 0
35#endif 35#endif
36 36
37extern unsigned long mmap_min_addr;
38
39#include <asm/page.h> 37#include <asm/page.h>
40#include <asm/pgtable.h> 38#include <asm/pgtable.h>
41#include <asm/processor.h> 39#include <asm/processor.h>
@@ -575,19 +573,6 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
575} 573}
576 574
577/* 575/*
578 * If a hint addr is less than mmap_min_addr change hint to be as
579 * low as possible but still greater than mmap_min_addr
580 */
581static inline unsigned long round_hint_to_min(unsigned long hint)
582{
583 hint &= PAGE_MASK;
584 if (((void *)hint != NULL) &&
585 (hint < mmap_min_addr))
586 return PAGE_ALIGN(mmap_min_addr);
587 return hint;
588}
589
590/*
591 * Some inline functions in vmstat.h depend on page_zone() 576 * Some inline functions in vmstat.h depend on page_zone()
592 */ 577 */
593#include <linux/vmstat.h> 578#include <linux/vmstat.h>
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 7acc8439d9b3..0042090a4d70 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -240,8 +240,6 @@ struct mm_struct {
240 240
241 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ 241 unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */
242 242
243 s8 oom_adj; /* OOM kill score adjustment (bit shift) */
244
245 cpumask_t cpu_vm_mask; 243 cpumask_t cpu_vm_mask;
246 244
247 /* Architecture-specific MM context */ 245 /* Architecture-specific MM context */
diff --git a/include/linux/pm.h b/include/linux/pm.h
index b3f74764a586..2b6e20df0e52 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -22,6 +22,10 @@
22#define _LINUX_PM_H 22#define _LINUX_PM_H
23 23
24#include <linux/list.h> 24#include <linux/list.h>
25#include <linux/workqueue.h>
26#include <linux/spinlock.h>
27#include <linux/wait.h>
28#include <linux/timer.h>
25 29
26/* 30/*
27 * Callbacks for platform drivers to implement. 31 * Callbacks for platform drivers to implement.
@@ -165,6 +169,28 @@ typedef struct pm_message {
165 * It is allowed to unregister devices while the above callbacks are being 169 * It is allowed to unregister devices while the above callbacks are being
166 * executed. However, it is not allowed to unregister a device from within any 170 * executed. However, it is not allowed to unregister a device from within any
167 * of its own callbacks. 171 * of its own callbacks.
172 *
173 * There also are the following callbacks related to run-time power management
174 * of devices:
175 *
176 * @runtime_suspend: Prepare the device for a condition in which it won't be
177 * able to communicate with the CPU(s) and RAM due to power management.
178 * This need not mean that the device should be put into a low power state.
179 * For example, if the device is behind a link which is about to be turned
180 * off, the device may remain at full power. If the device does go to low
181 * power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a
182 * hardware mechanism allowing the device to request a change of its power
183 * state, such as PCI PME) should be enabled for it.
184 *
185 * @runtime_resume: Put the device into the fully active state in response to a
186 * wake-up event generated by hardware or at the request of software. If
187 * necessary, put the device into the full power state and restore its
188 * registers, so that it is fully operational.
189 *
190 * @runtime_idle: Device appears to be inactive and it might be put into a low
191 * power state if all of the necessary conditions are satisfied. Check
192 * these conditions and handle the device as appropriate, possibly queueing
193 * a suspend request for it. The return value is ignored by the PM core.
168 */ 194 */
169 195
170struct dev_pm_ops { 196struct dev_pm_ops {
@@ -182,6 +208,9 @@ struct dev_pm_ops {
182 int (*thaw_noirq)(struct device *dev); 208 int (*thaw_noirq)(struct device *dev);
183 int (*poweroff_noirq)(struct device *dev); 209 int (*poweroff_noirq)(struct device *dev);
184 int (*restore_noirq)(struct device *dev); 210 int (*restore_noirq)(struct device *dev);
211 int (*runtime_suspend)(struct device *dev);
212 int (*runtime_resume)(struct device *dev);
213 int (*runtime_idle)(struct device *dev);
185}; 214};
186 215
187/** 216/**
@@ -315,14 +344,80 @@ enum dpm_state {
315 DPM_OFF_IRQ, 344 DPM_OFF_IRQ,
316}; 345};
317 346
347/**
348 * Device run-time power management status.
349 *
350 * These status labels are used internally by the PM core to indicate the
351 * current status of a device with respect to the PM core operations. They do
352 * not reflect the actual power state of the device or its status as seen by the
353 * driver.
354 *
355 * RPM_ACTIVE Device is fully operational. Indicates that the device
356 * bus type's ->runtime_resume() callback has completed
357 * successfully.
358 *
359 * RPM_SUSPENDED Device bus type's ->runtime_suspend() callback has
360 * completed successfully. The device is regarded as
361 * suspended.
362 *
363 * RPM_RESUMING Device bus type's ->runtime_resume() callback is being
364 * executed.
365 *
366 * RPM_SUSPENDING Device bus type's ->runtime_suspend() callback is being
367 * executed.
368 */
369
370enum rpm_status {
371 RPM_ACTIVE = 0,
372 RPM_RESUMING,
373 RPM_SUSPENDED,
374 RPM_SUSPENDING,
375};
376
377/**
378 * Device run-time power management request types.
379 *
380 * RPM_REQ_NONE Do nothing.
381 *
382 * RPM_REQ_IDLE Run the device bus type's ->runtime_idle() callback
383 *
384 * RPM_REQ_SUSPEND Run the device bus type's ->runtime_suspend() callback
385 *
386 * RPM_REQ_RESUME Run the device bus type's ->runtime_resume() callback
387 */
388
389enum rpm_request {
390 RPM_REQ_NONE = 0,
391 RPM_REQ_IDLE,
392 RPM_REQ_SUSPEND,
393 RPM_REQ_RESUME,
394};
395
318struct dev_pm_info { 396struct dev_pm_info {
319 pm_message_t power_state; 397 pm_message_t power_state;
320 unsigned can_wakeup:1; 398 unsigned int can_wakeup:1;
321 unsigned should_wakeup:1; 399 unsigned int should_wakeup:1;
322 enum dpm_state status; /* Owned by the PM core */ 400 enum dpm_state status; /* Owned by the PM core */
323#ifdef CONFIG_PM_SLEEP 401#ifdef CONFIG_PM_SLEEP
324 struct list_head entry; 402 struct list_head entry;
325#endif 403#endif
404#ifdef CONFIG_PM_RUNTIME
405 struct timer_list suspend_timer;
406 unsigned long timer_expires;
407 struct work_struct work;
408 wait_queue_head_t wait_queue;
409 spinlock_t lock;
410 atomic_t usage_count;
411 atomic_t child_count;
412 unsigned int disable_depth:3;
413 unsigned int ignore_children:1;
414 unsigned int idle_notification:1;
415 unsigned int request_pending:1;
416 unsigned int deferred_resume:1;
417 enum rpm_request request;
418 enum rpm_status runtime_status;
419 int runtime_error;
420#endif
326}; 421};
327 422
328/* 423/*
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
new file mode 100644
index 000000000000..44087044910f
--- /dev/null
+++ b/include/linux/pm_runtime.h
@@ -0,0 +1,114 @@
1/*
2 * pm_runtime.h - Device run-time power management helper functions.
3 *
4 * Copyright (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_RUNTIME_H
10#define _LINUX_PM_RUNTIME_H
11
12#include <linux/device.h>
13#include <linux/pm.h>
14
15#ifdef CONFIG_PM_RUNTIME
16
17extern struct workqueue_struct *pm_wq;
18
19extern int pm_runtime_idle(struct device *dev);
20extern int pm_runtime_suspend(struct device *dev);
21extern int pm_runtime_resume(struct device *dev);
22extern int pm_request_idle(struct device *dev);
23extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
24extern int pm_request_resume(struct device *dev);
25extern int __pm_runtime_get(struct device *dev, bool sync);
26extern int __pm_runtime_put(struct device *dev, bool sync);
27extern int __pm_runtime_set_status(struct device *dev, unsigned int status);
28extern int pm_runtime_barrier(struct device *dev);
29extern void pm_runtime_enable(struct device *dev);
30extern void __pm_runtime_disable(struct device *dev, bool check_resume);
31
32static inline bool pm_children_suspended(struct device *dev)
33{
34 return dev->power.ignore_children
35 || !atomic_read(&dev->power.child_count);
36}
37
38static inline void pm_suspend_ignore_children(struct device *dev, bool enable)
39{
40 dev->power.ignore_children = enable;
41}
42
43static inline void pm_runtime_get_noresume(struct device *dev)
44{
45 atomic_inc(&dev->power.usage_count);
46}
47
48static inline void pm_runtime_put_noidle(struct device *dev)
49{
50 atomic_add_unless(&dev->power.usage_count, -1, 0);
51}
52
53#else /* !CONFIG_PM_RUNTIME */
54
55static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
56static inline int pm_runtime_suspend(struct device *dev) { return -ENOSYS; }
57static inline int pm_runtime_resume(struct device *dev) { return 0; }
58static inline int pm_request_idle(struct device *dev) { return -ENOSYS; }
59static inline int pm_schedule_suspend(struct device *dev, unsigned int delay)
60{
61 return -ENOSYS;
62}
63static inline int pm_request_resume(struct device *dev) { return 0; }
64static inline int __pm_runtime_get(struct device *dev, bool sync) { return 1; }
65static inline int __pm_runtime_put(struct device *dev, bool sync) { return 0; }
66static inline int __pm_runtime_set_status(struct device *dev,
67 unsigned int status) { return 0; }
68static inline int pm_runtime_barrier(struct device *dev) { return 0; }
69static inline void pm_runtime_enable(struct device *dev) {}
70static inline void __pm_runtime_disable(struct device *dev, bool c) {}
71
72static inline bool pm_children_suspended(struct device *dev) { return false; }
73static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
74static inline void pm_runtime_get_noresume(struct device *dev) {}
75static inline void pm_runtime_put_noidle(struct device *dev) {}
76
77#endif /* !CONFIG_PM_RUNTIME */
78
79static inline int pm_runtime_get(struct device *dev)
80{
81 return __pm_runtime_get(dev, false);
82}
83
84static inline int pm_runtime_get_sync(struct device *dev)
85{
86 return __pm_runtime_get(dev, true);
87}
88
89static inline int pm_runtime_put(struct device *dev)
90{
91 return __pm_runtime_put(dev, false);
92}
93
94static inline int pm_runtime_put_sync(struct device *dev)
95{
96 return __pm_runtime_put(dev, true);
97}
98
99static inline int pm_runtime_set_active(struct device *dev)
100{
101 return __pm_runtime_set_status(dev, RPM_ACTIVE);
102}
103
104static inline void pm_runtime_set_suspended(struct device *dev)
105{
106 __pm_runtime_set_status(dev, RPM_SUSPENDED);
107}
108
109static inline void pm_runtime_disable(struct device *dev)
110{
111 __pm_runtime_disable(dev, true);
112}
113
114#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3ab08e4bb6b8..0f1ea4a66957 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1198,6 +1198,7 @@ struct task_struct {
1198 * a short time 1198 * a short time
1199 */ 1199 */
1200 unsigned char fpu_counter; 1200 unsigned char fpu_counter;
1201 s8 oomkilladj; /* OOM kill score adjustment (bit shift). */
1201#ifdef CONFIG_BLK_DEV_IO_TRACE 1202#ifdef CONFIG_BLK_DEV_IO_TRACE
1202 unsigned int btrace_seq; 1203 unsigned int btrace_seq;
1203#endif 1204#endif
diff --git a/include/linux/security.h b/include/linux/security.h
index 5eff459b3833..1f16eea2017b 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -28,6 +28,7 @@
28#include <linux/resource.h> 28#include <linux/resource.h>
29#include <linux/sem.h> 29#include <linux/sem.h>
30#include <linux/shm.h> 30#include <linux/shm.h>
31#include <linux/mm.h> /* PAGE_ALIGN */
31#include <linux/msg.h> 32#include <linux/msg.h>
32#include <linux/sched.h> 33#include <linux/sched.h>
33#include <linux/key.h> 34#include <linux/key.h>
@@ -66,6 +67,9 @@ extern int cap_inode_setxattr(struct dentry *dentry, const char *name,
66extern int cap_inode_removexattr(struct dentry *dentry, const char *name); 67extern int cap_inode_removexattr(struct dentry *dentry, const char *name);
67extern int cap_inode_need_killpriv(struct dentry *dentry); 68extern int cap_inode_need_killpriv(struct dentry *dentry);
68extern int cap_inode_killpriv(struct dentry *dentry); 69extern int cap_inode_killpriv(struct dentry *dentry);
70extern int cap_file_mmap(struct file *file, unsigned long reqprot,
71 unsigned long prot, unsigned long flags,
72 unsigned long addr, unsigned long addr_only);
69extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); 73extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags);
70extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, 74extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
71 unsigned long arg4, unsigned long arg5); 75 unsigned long arg4, unsigned long arg5);
@@ -92,6 +96,7 @@ extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
92extern int cap_netlink_recv(struct sk_buff *skb, int cap); 96extern int cap_netlink_recv(struct sk_buff *skb, int cap);
93 97
94extern unsigned long mmap_min_addr; 98extern unsigned long mmap_min_addr;
99extern unsigned long dac_mmap_min_addr;
95/* 100/*
96 * Values used in the task_security_ops calls 101 * Values used in the task_security_ops calls
97 */ 102 */
@@ -116,6 +121,21 @@ struct request_sock;
116#define LSM_UNSAFE_PTRACE 2 121#define LSM_UNSAFE_PTRACE 2
117#define LSM_UNSAFE_PTRACE_CAP 4 122#define LSM_UNSAFE_PTRACE_CAP 4
118 123
124/*
125 * If a hint addr is less than mmap_min_addr change hint to be as
126 * low as possible but still greater than mmap_min_addr
127 */
128static inline unsigned long round_hint_to_min(unsigned long hint)
129{
130 hint &= PAGE_MASK;
131 if (((void *)hint != NULL) &&
132 (hint < mmap_min_addr))
133 return PAGE_ALIGN(mmap_min_addr);
134 return hint;
135}
136extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp,
137 void __user *buffer, size_t *lenp, loff_t *ppos);
138
119#ifdef CONFIG_SECURITY 139#ifdef CONFIG_SECURITY
120 140
121struct security_mnt_opts { 141struct security_mnt_opts {
@@ -2197,9 +2217,7 @@ static inline int security_file_mmap(struct file *file, unsigned long reqprot,
2197 unsigned long addr, 2217 unsigned long addr,
2198 unsigned long addr_only) 2218 unsigned long addr_only)
2199{ 2219{
2200 if ((addr < mmap_min_addr) && !capable(CAP_SYS_RAWIO)) 2220 return cap_file_mmap(file, reqprot, prot, flags, addr, addr_only);
2201 return -EACCES;
2202 return 0;
2203} 2221}
2204 2222
2205static inline int security_file_mprotect(struct vm_area_struct *vma, 2223static inline int security_file_mprotect(struct vm_area_struct *vma,
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 565eed8fe496..c05fd717c588 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -16,7 +16,7 @@ struct tcf_common {
16 u32 tcfc_capab; 16 u32 tcfc_capab;
17 int tcfc_action; 17 int tcfc_action;
18 struct tcf_t tcfc_tm; 18 struct tcf_t tcfc_tm;
19 struct gnet_stats_basic tcfc_bstats; 19 struct gnet_stats_basic_packed tcfc_bstats;
20 struct gnet_stats_queue tcfc_qstats; 20 struct gnet_stats_queue tcfc_qstats;
21 struct gnet_stats_rate_est tcfc_rate_est; 21 struct gnet_stats_rate_est tcfc_rate_est;
22 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h
index d136b5240ef2..c1488553e349 100644
--- a/include/net/gen_stats.h
+++ b/include/net/gen_stats.h
@@ -28,7 +28,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type,
28 spinlock_t *lock, struct gnet_dump *d); 28 spinlock_t *lock, struct gnet_dump *d);
29 29
30extern int gnet_stats_copy_basic(struct gnet_dump *d, 30extern int gnet_stats_copy_basic(struct gnet_dump *d,
31 struct gnet_stats_basic *b); 31 struct gnet_stats_basic_packed *b);
32extern int gnet_stats_copy_rate_est(struct gnet_dump *d, 32extern int gnet_stats_copy_rate_est(struct gnet_dump *d,
33 struct gnet_stats_rate_est *r); 33 struct gnet_stats_rate_est *r);
34extern int gnet_stats_copy_queue(struct gnet_dump *d, 34extern int gnet_stats_copy_queue(struct gnet_dump *d,
@@ -37,14 +37,14 @@ extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len);
37 37
38extern int gnet_stats_finish_copy(struct gnet_dump *d); 38extern int gnet_stats_finish_copy(struct gnet_dump *d);
39 39
40extern int gen_new_estimator(struct gnet_stats_basic *bstats, 40extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
41 struct gnet_stats_rate_est *rate_est, 41 struct gnet_stats_rate_est *rate_est,
42 spinlock_t *stats_lock, struct nlattr *opt); 42 spinlock_t *stats_lock, struct nlattr *opt);
43extern void gen_kill_estimator(struct gnet_stats_basic *bstats, 43extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
44 struct gnet_stats_rate_est *rate_est); 44 struct gnet_stats_rate_est *rate_est);
45extern int gen_replace_estimator(struct gnet_stats_basic *bstats, 45extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats,
46 struct gnet_stats_rate_est *rate_est, 46 struct gnet_stats_rate_est *rate_est,
47 spinlock_t *stats_lock, struct nlattr *opt); 47 spinlock_t *stats_lock, struct nlattr *opt);
48extern bool gen_estimator_active(const struct gnet_stats_basic *bstats, 48extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats,
49 const struct gnet_stats_rate_est *rate_est); 49 const struct gnet_stats_rate_est *rate_est);
50#endif 50#endif
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h
index 65d594dffbff..ddbf37e19616 100644
--- a/include/net/netfilter/xt_rateest.h
+++ b/include/net/netfilter/xt_rateest.h
@@ -8,7 +8,7 @@ struct xt_rateest {
8 spinlock_t lock; 8 spinlock_t lock;
9 struct gnet_estimator params; 9 struct gnet_estimator params;
10 struct gnet_stats_rate_est rstats; 10 struct gnet_stats_rate_est rstats;
11 struct gnet_stats_basic bstats; 11 struct gnet_stats_basic_packed bstats;
12}; 12};
13 13
14extern struct xt_rateest *xt_rateest_lookup(const char *name); 14extern struct xt_rateest *xt_rateest_lookup(const char *name);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 964ffa0d8815..5482e9582f55 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -72,7 +72,7 @@ struct Qdisc
72 */ 72 */
73 unsigned long state; 73 unsigned long state;
74 struct sk_buff_head q; 74 struct sk_buff_head q;
75 struct gnet_stats_basic bstats; 75 struct gnet_stats_basic_packed bstats;
76 struct gnet_stats_queue qstats; 76 struct gnet_stats_queue qstats;
77}; 77};
78 78