arch/um/include/shared/os.h
Source file repositories/reference/linux-study-clean/arch/um/include/shared/os.h
File Facts
- System
- Linux kernel
- Corpus path
arch/um/include/shared/os.h- Extension
.h- Size
- 11763 bytes
- Lines
- 360
- Domain
- Architecture Layer
- Bucket
- arch/um
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
irq_user.hlongjmp.hmm_id.hlinux/types.hsys/types.h
Detected Declarations
struct uml_statstruct openflagsstruct os_helper_threadfunction of_readfunction of_writefunction of_rdwrfunction of_set_rwfunction of_syncfunction of_createfunction of_truncfunction of_appendfunction of_exclfunction of_cloexecfunction os_local_ipi_enable
Annotated Snippet
struct uml_stat {
int ust_dev; /* device */
unsigned long long ust_ino; /* inode */
int ust_mode; /* protection */
int ust_nlink; /* number of hard links */
int ust_uid; /* user ID of owner */
int ust_gid; /* group ID of owner */
unsigned long long ust_size; /* total size, in bytes */
int ust_blksize; /* blocksize for filesystem I/O */
unsigned long long ust_blocks; /* number of blocks allocated */
unsigned long ust_atime; /* time of last access */
unsigned long ust_mtime; /* time of last modification */
unsigned long ust_ctime; /* time of last change */
};
struct openflags {
unsigned int r : 1;
unsigned int w : 1;
unsigned int s : 1; /* O_SYNC */
unsigned int c : 1; /* O_CREAT */
unsigned int t : 1; /* O_TRUNC */
unsigned int a : 1; /* O_APPEND */
unsigned int e : 1; /* O_EXCL */
unsigned int cl : 1; /* FD_CLOEXEC */
};
#define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \
.t = 0, .a = 0, .e = 0, .cl = 0 })
static inline struct openflags of_read(struct openflags flags)
{
flags.r = 1;
return flags;
}
static inline struct openflags of_write(struct openflags flags)
{
flags.w = 1;
return flags;
}
static inline struct openflags of_rdwr(struct openflags flags)
{
return of_read(of_write(flags));
}
static inline struct openflags of_set_rw(struct openflags flags, int r, int w)
{
flags.r = r;
flags.w = w;
return flags;
}
static inline struct openflags of_sync(struct openflags flags)
{
flags.s = 1;
return flags;
}
static inline struct openflags of_create(struct openflags flags)
{
flags.c = 1;
return flags;
}
static inline struct openflags of_trunc(struct openflags flags)
{
flags.t = 1;
return flags;
}
static inline struct openflags of_append(struct openflags flags)
{
flags.a = 1;
return flags;
}
static inline struct openflags of_excl(struct openflags flags)
{
flags.e = 1;
return flags;
}
static inline struct openflags of_cloexec(struct openflags flags)
{
flags.cl = 1;
return flags;
}
/* file.c */
Annotation
- Immediate include surface: `irq_user.h`, `longjmp.h`, `mm_id.h`, `linux/types.h`, `sys/types.h`.
- Detected declarations: `struct uml_stat`, `struct openflags`, `struct os_helper_thread`, `function of_read`, `function of_write`, `function of_rdwr`, `function of_set_rw`, `function of_sync`, `function of_create`, `function of_trunc`.
- Atlas domain: Architecture Layer / arch/um.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.