Home
last modified time | relevance | path

Searched full:guard (Results 1 – 25 of 1435) sorted by relevance

12345678910>>...58

/linux/rust/kernel/sync/
H A Dcondvar.rs8 use super::{lock::Backend, lock::Guard, LockClassKey};
59 /// let mut guard = e.value.lock();
60 /// while *guard != v {
61 /// e.value_changed.wait(&mut guard);
117 guard: &mut Guard<'_, T, B>, in wait_internal()
131 let ret = guard.do_unlocked(|| unsafe { bindings::schedule_timeout(timeout_in_jiffies) }); in wait_internal()
141 /// Atomically releases the given lock (whose ownership is proven by the guard) and puts the
145 pub fn wait<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>) { in wait()
146 self.wait_internal(TASK_UNINTERRUPTIBLE, guard, MAX_SCHEDULE_TIMEOUT); in wait()
156 pub fn wait_interruptible<T: ?Sized, B: Backend>(&self, guard: &mut Guard<'_, T, B>) -> bool { in wait_interruptible()
[all …]
H A Dlock.rs3 //! Generic kernel lock and guard.
5 //! It contains a generic Rust lock and guard that allow for different backends (e.g., mutexes,
174 pub fn lock(&self) -> Guard<'_, T, B> { in lock()
179 unsafe { Guard::new(self, state) }
184 /// Returns a guard that can be used to access the data protected by the lock if successful.
188 pub fn try_lock(&self) -> Option<Guard<'_, T, B>> { in try_lock()
191 unsafe { B::try_lock(self.state.get()).map(|state| Guard::new(self, state)) }
195 /// A lock guard.
198 /// when a guard goes out of scope. It also provides a safe and convenient way to access the data struct
200 #[must_use = "the lock unlocks immediately when the guard i argument
204 _not_sendGuard global() argument
205 unsafe impl<T: Sync + ?Sized, B: Backend> Sync for Guard<'_, T, B> {} global() implementation
207 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { global() implementation
275 impl<T: ?Sized, B: Backend> core::ops::Deref for Guard<'_, T, B> { global() implementation
284 impl<T: ?Sized, B: Backend> core::ops::DerefMut for Guard<'_, T, B> global() implementation
294 impl<T: ?Sized, B: Backend> Drop for Guard<'_, T, B> { global() implementation
301 impl<'a, T: ?Sized, B: Backend> Guard<'a, T, B> { global() implementation
[all...]
H A Dsrcu.rs32 /// SRCU readers may sleep while holding the read-side guard.
35 /// If a read-side guard has been leaked, dropping an [`Srcu`] may never return.
66 /// Leaking the returned [`Guard`] leaves the SRCU read-side critical
69 pub fn read_lock(&self) -> Guard<'_> { in read_lock()
74 Guard { in read_lock()
112 // This should only happen if a guard was leaked with `mem::forget`, which is in drop()
120 // If this ever happens, that means the guard was leaked by mistake and the in drop()
143 /// Guard for an active SRCU read-side critical section on a particular [`Srcu`].
145 /// Leaking this guard with [`core::mem::forget`] leaves the SRCU read-side
152 pub struct Guard<'a> { struct
[all …]
/linux/tools/testing/selftests/mm/
H A Dguard-regions.c372 /* Establish a guard page at the end of the mapping. */ in TEST_F()
376 /* Check that both guard pages result in SIGSEGV. */ in TEST_F()
380 /* Remove the first guard page. */ in TEST_F()
386 /* Remove the last guard page. */ in TEST_F()
395 * these be faulted in, so this also tests that we can install guard in TEST_F()
400 /* Make sure they are all guard pages. */ in TEST_F()
414 /* Remove guard pages. */ in TEST_F()
425 * Now remove all guard pages, make sure we don't remove existing in TEST_F()
478 * Now mark the whole range as guard pages and make sure all VMAs are as in TEST_F()
592 /* We want guard marker in TEST_F()
[all...]
/linux/rust/kernel/
H A Dxarray.rs43 /// let mut guard = xa.lock();
45 /// assert_eq!(guard.get(0), None);
47 /// assert_eq!(guard.store(0, dead, GFP_KERNEL)?.as_deref(), None);
48 /// assert_eq!(guard.get(0).copied(), Some(0xdead));
50 /// *guard.get_mut(0).unwrap() = 0xffff;
51 /// assert_eq!(guard.get(0).copied(), Some(0xffff));
53 /// assert_eq!(guard.store(0, beef, GFP_KERNEL)?.as_deref().copied(), Some(0xffff));
54 /// assert_eq!(guard.get(0).copied(), Some(0xbeef));
56 /// guard.remove(0);
57 /// assert_eq!(guard
150 pub struct Guard<'a, T: ForeignOwnable> { global() struct
155 impl<T: ForeignOwnable> Drop for Guard<'_, T> { global() implementation
180 impl<'a, T: ForeignOwnable> Guard<'a, T> { global() implementation
[all...]
H A Drevocable.rs43 /// let guard = v.try_access()?;
44 /// Some(guard.a + guard.b)
65 /// let guard = rcu::read_lock();
66 /// let e = v.try_access_with_guard(&guard)?;
105 /// Returns a guard that gives access to the object otherwise; the object is guaranteed to in try_access()
106 /// remain accessible while the guard is alive. In such cases, callers are not allowed to sleep in try_access()
109 let guard = rcu::read_lock();
113 Some(RevocableGuard::new(self.data.get(), guard))
124 /// remain accessible while the rcu read side guard i in try_access_with_guard()
100 let guard = rcu::read_lock(); try_access() localVariable
[all...]
/linux/drivers/android/binder/
H A Dnode.rs10 sync::lock::{spinlock::SpinLockBackend, Guard},
332 guard: &mut Guard<'_, ProcessInner, SpinLockBackend>,
338 self.inner.access_mut(guard).death_list.push_back(death); in add_death()
491 guard: &Guard<'_, ProcessInner, SpinLockBackend>,
493 let inner = self.inner.access(guard); in populate_counts()
501 guard: &Guard<'_, ProcessInner, SpinLockBackend>,
505 let inner = self.inner.access(guard); in populate_debug_info()
551 let mut guard = self.owner.inner.lock(); release() localVariable
566 let mut guard = self.owner.inner.lock(); pending_oneway_finished() localVariable
669 let mut guard = self.owner.inner.lock(); add_freeze_listener() localVariable
689 let mut guard = self.owner.inner.lock(); remove_freeze_listener() localVariable
820 let mut guard = self.node.owner.inner.lock(); absorb() localVariable
[all...]
/linux/drivers/virt/coco/guest/
H A Dreport.c96 guard(rwsem_write)(&tsm_rwsem); in tsm_report_privlevel_store()
121 guard(rwsem_read)(&tsm_rwsem); in tsm_report_privlevel_floor_show()
138 guard(rwsem_write)(&tsm_rwsem); in tsm_report_service_provider_store()
162 guard(rwsem_write)(&tsm_rwsem); in tsm_report_service_guid_store()
188 guard(rwsem_write)(&tsm_rwsem); in tsm_report_service_manifest_version_store()
204 guard(rwsem_write)(&tsm_rwsem); in tsm_report_inblob_write()
220 guard(rwsem_read)(&tsm_rwsem); in tsm_report_generation_show()
227 guard(rwsem_read)(&tsm_rwsem); in tsm_report_provider_show()
267 guard(rwsem_read)(&tsm_rwsem); in read_cached_report()
295 guard(rwsem_writ in tsm_report_read()
[all...]
/linux/drivers/char/tpm/
H A Dtpm_tis_i2c.c34 /* Default Guard Time of 250µs until interface capability register is read */
38 /* Guard Time of 250µs after I2C slave NACK */
42 /* Guard Time bit masks; SR is repeated start, RW is read then write, etc. */
278 * Guard Time:
283 * Before the Guard Time is read (or after the TPM failed to send an I2C NACK),
284 * a Guard Time of 250µs applies.
286 * Various flags in the same register indicate if a guard time is needed:
287 * - SR: <I2C read with repeated start> <guard time> <I2C read>
288 * - RR: <I2C read> <guard time> <I2C read>
289 * - RW: <I2C read> <guard tim
[all...]
/linux/include/rdma/
H A Dsignature.h33 * enum ib_t10_dif_bg_type - Signature T10-DIF block-guard types
45 * @bg_type: T10-DIF block guard type (CRC|CSUM)
47 * @bg: seed of guard computation.
48 * @app_tag: application tag of guard block
49 * @ref_tag: initial guard block reference tag.
103 * | GUARD | APPTAG | REFTAG |
/linux/Documentation/mm/
H A Dvmalloced-kernel-stacks.rst25 Virtually mapped kernel stacks with guard pages cause kernel stack
30 support for virtually mapped stacks with guard pages. This feature
53 - If the stack overflows into a guard page, something reasonable
64 with guard pages. This causes kernel stack overflows to be caught
123 Leading and trailing guard pages help detect stack overflows. When the stack
124 overflows into the guard pages, handlers have to be careful not to overflow
131 Testing VMAP allocation with guard pages
135 and trailing guard page? The following lkdtm tests can help detect any
/linux/drivers/net/wireless/morsemicro/mm81x/
H A Dmmrc.c136 * Fixed point conversion for 3.6 * 2^8 used for long guard symbol tx time
142 * Fixed point conversion for 4.0 * 2^8 used for short guard symbol tx time
231 hweight_long(caps->guard) * in bit_index()
243 u16 guard = hweight_long(tb->caps.guard); in rows_from_sta_caps()
246 index = bit_index(tb->caps.guard, rate->guard) + in rows_from_sta_caps()
247 bit_index(tb->caps.bandwidth, rate->bw) * guard + in rows_from_sta_caps()
248 bit_index(tb->caps.spatial_streams, rate->ss) * guard * bw + in rows_from_sta_caps()
249 bit_index(tb->caps.rates, rate->rate) * bw * streams * guard; in rows_from_sta_caps()
263 u16 guard = hweight_long(tb->caps.guard); rate_update_index() local
286 u16 guard = hweight_long(tb->caps.guard); get_rate_row() local
[all...]
/linux/sound/pci/ice1712/
H A Dpontis.c115 guard(mutex)(&ice->gpio_mutex); in wm_dac_vol_get()
130 guard(mutex)(&ice->gpio_mutex); in wm_dac_vol_put()
168 guard(mutex)(&ice->gpio_mutex); in wm_adc_vol_get()
183 guard(mutex)(&ice->gpio_mutex); in wm_adc_vol_put()
207 guard(mutex)(&ice->gpio_mutex); in wm_adc_mux_get()
219 guard(mutex)(&ice->gpio_mutex); in wm_adc_mux_put()
241 guard(mutex)(&ice->gpio_mutex); in wm_bypass_get()
252 guard(mutex)(&ice->gpio_mutex); in wm_bypass_put()
274 guard(mutex)(&ice->gpio_mutex); in wm_chswap_get()
285 guard(mutex)(&ice->gpio_mutex); in wm_chswap_put()
[all …]
/linux/arch/parisc/math-emu/
H A Dcnv_float.h88 #define Dbl_to_sgl_mantissa(srcA,srcB,dest,inexact,guard,sticky,odd) \ argument
90 guard = Dbit3p2(srcB); \
92 inexact = guard | sticky; \
95 #define Dbl_to_sgl_denormalized(srcA,srcB,exp,dest,inexact,guard,sticky,odd,tiny) \ argument
101 guard = inexact >> 31; \
124 if (guard && (sticky || odd)) { \
134 guard = odd; \
136 inexact |= guard; \
144 guard = inexact >> 31; \
157 guard = inexact >> 31; \
[all …]
/linux/drivers/gpu/drm/xe/
H A Dxe_gt_freq.c73 guard(xe_pm_runtime)(dev_to_xe(dev)); in act_freq_show()
88 guard(xe_pm_runtime)(dev_to_xe(dev)); in cur_freq_show()
114 guard(xe_pm_runtime)(dev_to_xe(dev)); in rpe_freq_show()
128 guard(xe_pm_runtime)(dev_to_xe(dev)); in rpa_freq_show()
153 guard(xe_pm_runtime)(dev_to_xe(dev)); in min_freq_show()
173 guard(xe_pm_runtime)(dev_to_xe(dev)); in min_freq_store()
190 guard(xe_pm_runtime)(dev_to_xe(dev)); in max_freq_show()
210 guard(xe_pm_runtime)(dev_to_xe(dev)); in max_freq_store()
238 guard(xe_pm_runtime)(dev_to_xe(dev)); in power_profile_store()
/linux/rust/kernel/sync/lock/
H A Dglobal.rs9 sync::lock::{Backend, Guard, Lock},
97 /// A guard for a [`GlobalLock`].
100 #[must_use = "the lock unlocks immediately when the guard is unused"]
102 inner: Guard<'static, B::Item, B::Backend>,
165 // SAFETY: The lock is globally unique, so there can only be one guard.
173 // SAFETY: The lock is globally unique, so there can only be one guard.
204 /// let mut guard = MY_COUNTER.lock();
205 /// *guard += 1;
206 /// *guard
242 /// fn increment(&self, guard
[all...]
/linux/sound/core/seq/
H A Dseq_timer.c92 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_defaults()
123 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_reset()
174 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_set_tempo()
195 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_set_tempo_ppq()
218 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_set_position_tick()
232 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_set_position_time()
249 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_set_skew()
341 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_stop()
391 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_start()
414 guard(spinlock_irqsave)(&tmr->lock); in snd_seq_timer_continue()
[all …]
/linux/drivers/gpio/
H A Dgpiolib.c467 CLASS(gpio_chip_guard, guard)(desc); in gpiod_get_direction()
468 if (!guard.gc) in gpiod_get_direction()
482 ret = gpiochip_get_direction(guard.gc, offset); in gpiod_get_direction()
587 guard(srcu)(&gpio_devices_srcu); in gpio_name_to_desc()
591 guard(srcu)(&gdev->srcu); in gpio_name_to_desc()
1112 guard(srcu)(&gpio_devices_srcu); in gpiochip_set_data()
1116 guard(srcu)(&gdev->srcu);
1522 guard(srcu)(&gpio_devices_srcu); in gpio_device_find_by_label()
1529 guard(srcu)(&gdev->srcu); in gpio_chip_match_by_fwnode()
2656 CLASS(gpio_chip_guard, guard)(des in gpiod_request()
[all...]
/linux/drivers/gpu/drm/i915/
H A Di915_vma_resource.h82 * @guard: The size of guard area preceding and trailing the bind.
129 u32 guard; member
194 * @guard: The size of the guard area preceding and trailing the bind.
214 u32 guard) in i915_vma_resource_init() argument
232 vma_res->guard = guard; in i915_vma_resource_init()
/linux/drivers/thermal/
H A Dthermal_core.c145 guard(mutex)(&thermal_governor_lock); in thermal_zone_device_set_policy()
146 guard(thermal_zone)(tz); in thermal_zone_device_set_policy()
162 guard(mutex)(&thermal_governor_lock); in thermal_build_list_of_policies()
176 guard(mutex)(&thermal_governor_lock); in thermal_unregister_governors()
186 guard(mutex)(&thermal_governor_lock); in thermal_register_governors()
606 guard(thermal_zone)(tz); in thermal_zone_device_set_mode()
641 guard(thermal_zone)(tz); in thermal_zone_device_update()
652 guard(mutex)(&thermal_governor_lock); in for_each_thermal_governor()
670 guard(mutex)(&thermal_list_lock); in for_each_thermal_cooling_device()
688 guard(mute in for_each_thermal_zone()
[all...]
/linux/Documentation/devicetree/bindings/display/
H A Datmel,lcdc-display.yaml28 - required: [ 'atmel,guard-time' ]
39 atmel,guard-time:
41 description: lcd guard time (Delay in frame periods)
74 - atmel,guard-time
86 atmel,guard-time = <9>;
/linux/sound/aoa/codecs/
H A Donyx.c126 guard(mutex)(&onyx->mutex); in onyx_snd_vol_get()
149 guard(mutex)(&onyx->mutex); in onyx_snd_vol_put()
198 guard(mutex)(&onyx->mutex); in onyx_snd_inputgain_get()
216 guard(mutex)(&onyx->mutex); in onyx_snd_inputgain_put()
250 guard(mutex)(&onyx->mutex); in onyx_snd_capture_source_get()
262 guard(mutex)(&onyx->mutex); in onyx_set_capture_source()
308 guard(mutex)(&onyx->mutex); in onyx_snd_mute_get()
324 guard(mutex)(&onyx->mutex); in onyx_snd_mute_put()
365 guard(mutex)(&onyx->mutex); in onyx_snd_single_bit_get()
385 guard(mute in onyx_snd_single_bit_put()
[all...]
/linux/include/linux/
H A Dcleanup.h45 * dropped when the scope where guard() is invoked ends::
49 * guard(pci_dev)(dev);
51 * The lifetime of the lock obtained by the guard() helper follows the
58 * guard(pci_dev)(dev); // pci_dev_lock() invoked here
66 * The ACQUIRE() macro can be used in all places that guard() can be
77 * Now, when a function uses both __free() and guard()/ACQUIRE(), or
122 * guard(mutex)(&lock);
136 * That bug is fixed by changing init() to call guard() and define +
139 * guard(mutex)(&lock);
323 * guard(nam
415 #define guard( global() macro
[all...]
/linux/arch/x86/include/asm/
H A Dcpu_entry_area.h35 /* The exception stacks' physical storage. No guard pages required */
40 /* The effective cpu entry area mapping with guard pages. */
95 * a read-only guard page. On 32-bit the GDT must be writeable, so
96 * it needs an extra guard page.
116 * Exception stacks used for IST entries with guard pages.
/linux/drivers/input/serio/
H A Dserio.c42 guard(mutex)(&serio->drv_mutex); in serio_connect_driver()
49 guard(mutex)(&serio->drv_mutex); in serio_reconnect_driver()
59 guard(mutex)(&serio->drv_mutex); in serio_disconnect_driver()
146 guard(spinlock_irqsave)(&serio_event_lock); in serio_get_event()
168 guard(spinlock_irqsave)(&serio_event_lock); in serio_remove_duplicate_events()
190 guard(mutex)(&serio_mutex); in serio_handle_event()
230 guard(spinlock_irqsave)(&serio_event_lock); in serio_queue_event()
278 guard(spinlock_irqsave)(&serio_event_lock); in serio_remove_pending_events()
299 guard(spinlock_irqsave)(&serio_event_lock); in serio_get_pending_child()
502 guard(serio_pause_rx)(parent); in serio_add_port()
[all …]

12345678910>>...58