Lines Matching +full:user +full:- +full:defined
20 this document, being grossly under-qualified, but I always wanted to
30 - not associated with any process, serving a hardware interrupt;
32 - not associated with any process, serving a softirq or tasklet;
34 - running in kernel space, associated with a process (user context);
36 - running a process in user space.
44 We'll see a number of ways that the user context can block interrupts,
45 to become truly non-preemptable.
47 User Context
48 ------------
50 User context is when you are coming in from a system call or other trap:
56 You are always in user context on module load and unload, and on
59 In user context, the ``current`` pointer (indicating the task we are
69 -------------------------------
74 handler is never re-entered: if the same interrupt arrives, it is queued
88 -------------------------------------------------
96 take advantage of multiple CPUs. Shortly after we switched from wind-up
97 computers made of match-sticks and snot, we abandoned this limitation
108 dynamically-registrable (meaning you can have as many as you want), and
129 If you corrupt memory, whether in user context or interrupt context,
134 The FPU context is not saved; even in user context the FPU state
136 with some user process' FPU state. If you really want to do this,
143 6K for most 32-bit architectures: it's about 14K on most 64-bit
149 Let's keep it that way. Your code should be 64-bit clean, and
150 endian-independent. You should also minimize CPU specific stuff,
153 architecture-dependent part of the kernel tree.
176 Inside the ioctl you're in user context to a process. When a error
178 ``include/uapi/asm-generic/errno-base.h``,
179 ``include/uapi/asm-generic/errno.h`` and ``include/linux/errno.h``),
184 ``-ERESTARTSYS`` error. The system call entry code will switch back to
185 user context, process the signal handler and then your system call will
186 be restarted (unless the user disabled that). So you should be prepared
193 return -ERESTARTSYS;
212 - You are in user context.
214 - You do not own any spinlocks.
216 - You have interrupts enabled (actually, Andi Kleen says that the
220 Note that some functions may sleep implicitly: common ones are the user
234 ------------------
236 Defined in ``include/linux/printk.h``
262 typoing printf as printk in your user programs :)
268 chit-chat". You should follow that advice.
271 ---------------------------------------------------------------------------------------------------
273 Defined in ``include/linux/uaccess.h`` / ``asm/uaccess.h``
280 data should be copied using these routines. Both return ``-EFAULT`` or
293 up every year or so. --RR.]
296 user context (it makes no sense), with interrupts disabled, or a
300 -------------------------------------
302 Defined in ``include/linux/slab.h``
306 These routines are used to dynamically request pointer-aligned chunks of
311 May sleep and swap to free memory. Only allowed in user context, but
317 out-of-memory error-handling strategy.
345 Before inventing your own cache of often-used objects consider using a
349 ------------------
351 Defined in ``include/asm/current.h``
354 task structure, so is only valid in user context. For example, when a
359 -------------------------------------
361 Defined in ``include/asm/delay.h`` / ``include/linux/delay.h``
365 overflow - the helper function :c:func:`mdelay()` is useful here, or
369 -----------------------------------------------------------------------------------------------
371 Defined in ``include/asm/byteorder.h``
382 is the "in-situ" family, such as :c:func:`cpu_to_be32s()`, which
386 --------------------------------------------------------
388 Defined in ``include/linux/irqflags.h``
399 --------------------------------------------------------
401 Defined in ``include/linux/bottom_half.h``
410 ----------------------------
412 Defined in ``include/linux/smp.h``
425 ------------------------------------
427 Defined in ``include/linux/init.h``
436 with :c:func:`EXPORT_SYMBOL()` or :c:func:`EXPORT_SYMBOL_GPL()`- this
440 ----------------------------------------------
442 Defined in ``include/linux/init.h`` / ``include/linux/module.h``
445 (dynamically-loadable parts of the kernel). Using the
459 into the kernel). This function is called in user context with
463 -----------------------
466 Defined in ``include/linux/module.h``
475 not be removable (except for 'rmmod -f').
478 -------------------------------------------------
480 Defined in ``include/linux/module.h``
506 ---------
514 -------
521 this expression is true, or ``-ERESTARTSYS`` if a signal is received. The
525 ----------------------
552 ``unsigned long``, defined in ``include/linux/bitops.h``. These
563 ``BITS_PER_LONG``. The resulting behavior is strange on big-endian
576 -------------------------
578 Defined in ``include/linux/export.h``
584 -----------------------------
586 Defined in ``include/linux/export.h``
597 ----------------------------
599 Defined in ``include/linux/export.h``
603 Documentation/core-api/symbol-namespaces.rst
606 --------------------------------
608 Defined in ``include/linux/export.h``
612 Documentation/core-api/symbol-namespaces.rst
617 Double-linked lists ``include/linux/list.h``
618 --------------------------------------------
620 There used to be three sets of linked-list routines in the kernel
627 ------------------
629 For code called in user context, it's very common to defy C convention,
630 and return 0 for success, and a negative error number (eg. ``-EFAULT``) for
640 --------------------
652 ------------------------------
655 initialisers, as defined by ISO C99, eg::
669 --------------
674 info page section "C Extensions" for more details - Yes, really the info
677 - Inline functions
679 - Statement expressions (ie. the ({ and }) constructs).
681 - Declaring attributes of a function / variable / type
684 - typeof
686 - Zero length arrays
688 - Macro varargs
690 - Arithmetic on void pointers
692 - Non-Constant initializers
694 - Assembler Instructions (not outside arch/ and include/asm/)
696 - Function names as strings (__func__).
698 - __builtin_constant_p()
706 ---
714 ---
718 pre-processor statements throughout the source code.
726 - Figure out who are the owners of the code you've been modifying. Look
736 - Usually you want a configuration option for your kernel hack. Edit
739 ``Documentation/kbuild/kconfig-language.rst``.
742 expert user and the user who knows nothing about your feature.
747 - Edit the ``Makefile``: the CONFIG variables are exported here so you
748 can usually just add a "obj-$(CONFIG_xxx) += xxx.o" line. The syntax
751 - Put yourself in ``CREDITS`` if you consider what you've done
755 it implies a more-than-passing commitment to some part of the code.
757 - Finally, don't forget to read
758 ``Documentation/process/submitting-patches.rst``
779 * This should be a per-architecture thing, to allow different
784 #define IS_ERR(ptr) ((unsigned long)(ptr) > (unsigned long)(-1000))
798 * At least we *know* we can't spell, and use a spell-checker.
807 /* Tested on SS-5, SS-10. Probably someone at Sun applied a spell-checker. */
826 clarity fixes, and some excellent non-obvious points. Werner Almesberger