![]() |
MOS Source Code
|
Go to the source code of this file.
Macros | |
#define | MOS_STATIC_ASSERT _Static_assert |
#define | __BEGIN_DECLS |
#define | __END_DECLS |
#define | __aligned(x) |
#define | __malloc __attribute__((__malloc__)) |
#define | __packed __attribute__((__packed__)) |
#define | __printf(a, b) |
#define | __pure __attribute__((__pure__)) |
#define | __section(S) |
#define | __maybe_unused __attribute__((__unused__)) |
#define | __used __attribute__((__used__)) |
#define | __nodiscard __attribute__((__warn_unused_result__)) |
#define | should_inline __maybe_unused static inline |
#define | likely(x) |
#define | unlikely(x) |
#define | __types_compatible(a, b) |
#define | do_container_of(ptr, type, member) |
#define | container_of(ptr, type, member) |
#define | is_aligned(ptr, alignment) |
#define | GET_BIT(x, n) |
#define | MASK_BITS(value, width) |
#define | SET_BITS(bit, width, value) |
#define | MOS_STRINGIFY2(x) |
#define | MOS_STRINGIFY(x) |
#define | MOS_UNUSED(x) |
#define | MOS_CONCAT_INNER(a, b) |
#define | MOS_CONCAT(a, b) |
#define | MOS_WARNING_PUSH MOS_PRAGMA(diagnostic push) |
#define | MOS_WARNING_POP MOS_PRAGMA(diagnostic pop) |
#define | MOS_WARNING_DISABLE(text) |
#define | ALIGN_UP(addr, size) |
#define | ALIGN_DOWN(addr, size) |
#define | ALIGN_UP_TO_PAGE(addr) |
#define | ALIGN_DOWN_TO_PAGE(addr) |
#define | MOS_IN_RANGE(addr, start, end) |
#define | MOS_FOURCC(a, b, c, d) |
#define | MOS_ARRAY_SIZE(x) |
#define | MOS_MAX_VADDR ((ptr_t) ~0) |
#define | READ_ONCE(x) |
#define | KB * 1024 |
#define | MB * 1024 KB |
#define | GB * (u64) 1024 MB |
#define | TB * (u64) 1024 GB |
#define | statement_expr(type, ...) |
#define | __NO_OP(...) |
#define | BIT(x) |
#define | MOSAPI extern |
#define | MOS_CONFIG(feat) |
#define | MOS_DEBUG_FEATURE(feat) |
#define | once() |
Returns true for the first call, false for all subsequent calls. | |
#define | MOS_PUT_IN_SECTION(_section, _struct, _var, ...) |
#define | IS_ERR_VALUE(x) |
#define | MOS_STUB_IMPL(...) |
#define MOS_STATIC_ASSERT _Static_assert |
Definition at line 14 of file mos_global.h.
Referenced by MOS_STATIC_ASSERT().
#define __BEGIN_DECLS |
Definition at line 22 of file mos_global.h.
#define __END_DECLS |
Definition at line 23 of file mos_global.h.
#define __aligned | ( | x | ) |
Definition at line 27 of file mos_global.h.
#define __malloc __attribute__((__malloc__)) |
Definition at line 28 of file mos_global.h.
#define __packed __attribute__((__packed__)) |
Definition at line 29 of file mos_global.h.
Referenced by ioapic_init(), ioapic_read_redirection_entry(), and ioapic_write_redirection_entry().
#define __printf | ( | a, | |
b ) |
Definition at line 30 of file mos_global.h.
#define __pure __attribute__((__pure__)) |
Definition at line 31 of file mos_global.h.
Referenced by hashmap_compare_string(), hashmap_hash_string(), hashmap_simple_key_compare(), and string_hash().
#define __section | ( | S | ) |
Definition at line 32 of file mos_global.h.
Referenced by __section(), and __section().
#define __maybe_unused __attribute__((__unused__)) |
Definition at line 33 of file mos_global.h.
Referenced by ISerialDevice::GetModelStatus(), ipi_do_handle(), ipi_send(), ipi_send_all(), and platform_arch_syscall().
#define __used __attribute__((__used__)) |
Definition at line 34 of file mos_global.h.
Referenced by __section(), __section(), and vfs_flusher_entry().
#define __nodiscard __attribute__((__warn_unused_result__)) |
Definition at line 35 of file mos_global.h.
Referenced by buf_putchar(), dentry_dump_refstat(), dentry_unref_one_norelease(), elf_do_fill_process(), pml1_free(), pml3_destroy_range(), pml4_destroy_range(), and sysfs_file_ensure_ready().
#define should_inline __maybe_unused static inline |
Definition at line 37 of file mos_global.h.
Referenced by __attribute__(), _pmm_ref_pfn_range(), _pmm_unref_pfn_range(), buf_putchar(), CPIO_INODE(), cpu_rdmsr(), cpu_wrmsr(), current_stdio(), dentry_parent(), dispatch_syscall(), file_format_perm(), get_ansi_color(), ioapic_enable_interrupt(), ioapic_read(), ioapic_read_redirection_entry(), ioapic_write(), ioapic_write_redirection_entry(), lapic_get_id(), mdelay(), mutex_init(), path_is_absolute(), platform_syscall0(), platform_syscall0(), platform_syscall1(), platform_syscall1(), platform_syscall2(), platform_syscall2(), platform_syscall3(), platform_syscall3(), platform_syscall4(), platform_syscall4(), platform_syscall5(), platform_syscall5(), platform_syscall6(), platform_syscall6(), pmle_set_flags(), port_inb(), port_inl(), port_inw(), port_outb(), port_outl(), port_outw(), pte_get_flags(), rdtsc(), recursive_spinlock_acquire(), recursive_spinlock_is_locked(), recursive_spinlock_release(), ring_buffer_is_empty(), ring_buffer_is_full(), ring_buffer_pop_back(), ring_buffer_pop_back_byte(), ring_buffer_pop_front(), ring_buffer_pop_front_byte(), ring_buffer_pos_is_empty(), ring_buffer_pos_is_full(), ring_buffer_pos_pop_back_byte(), ring_buffer_pos_pop_front_byte(), ring_buffer_pos_push_back_byte(), ring_buffer_pos_push_front_byte(), ring_buffer_push_back(), ring_buffer_push_back_byte(), ring_buffer_push_front(), ring_buffer_push_front_byte(), spinlock_is_locked(), syscall_arch_syscall(), syscall_clock_gettimeofday(), syscall_clock_msleep(), syscall_create_thread(), syscall_dmabuf_alloc(), syscall_dmabuf_free(), syscall_dmabuf_share(), syscall_dmabuf_unshare(), syscall_execveat(), syscall_fd_manipulate(), syscall_fork(), syscall_futex_wait(), syscall_futex_wake(), syscall_get_parent_pid(), syscall_get_pid(), syscall_get_tid(), syscall_io_close(), syscall_io_dup(), syscall_io_dup2(), syscall_io_poll(), syscall_io_pread(), syscall_io_pselect(), syscall_io_read(), syscall_io_readv(), syscall_io_seek(), syscall_io_tell(), syscall_io_write(), syscall_ipc_accept(), syscall_ipc_connect(), syscall_ipc_create(), syscall_memfd_create(), syscall_mmap_anonymous(), syscall_mmap_file(), syscall_munmap(), syscall_pipe(), syscall_poweroff(), syscall_signal_mask_op(), syscall_signal_process(), syscall_signal_register(), syscall_signal_thread(), syscall_spawn(), syscall_thread_getname(), syscall_thread_setname(), syscall_vfs_chdirat(), syscall_vfs_fchmodat(), syscall_vfs_fstatat(), syscall_vfs_fsync(), syscall_vfs_getcwd(), syscall_vfs_list_dir(), syscall_vfs_mkdir(), syscall_vfs_mount(), syscall_vfs_openat(), syscall_vfs_readlinkat(), syscall_vfs_symlink(), syscall_vfs_unlinkat(), syscall_vfs_unmount(), syscall_vm_protect(), syscall_wait_for_process(), syscall_wait_for_thread(), syscall_yield_cpu(), sysfs_register_root_file(), udelay(), verify_sdt_checksum(), x86_cpu_halt(), x86_cpu_invlpg(), and x86_cpu_invlpg_all().
#define likely | ( | x | ) |
Definition at line 39 of file mos_global.h.
Referenced by enter_scheduler(), mm_replace_page_locked(), reschedule(), slab_alloc(), and userfs_ensure_connected().
#define unlikely | ( | x | ) |
Definition at line 40 of file mos_global.h.
Referenced by buddy_alloc_n_exact(), cpio_i_iterate_dir(), cpio_mount(), cpio_read_metadata(), dentry_lookup_child(), dentry_resolve_lastseg(), dentry_resolve_to_parent(), do_invoke_setup(), fork(), format_size(), futex_wake(), initrd_read(), ipc_read_as_msg(), ipc_write_as_msg(), lvprintk(), madt_parse_table(), IO::map(), mm_clone_vmap_locked(), mm_map_user_pages(), mm_replace_page_locked(), mos_start_kernel(), munmap(), parse_printf_flags(), IO::pread(), printf_cs(), printf_diouxX(), Process::Process(), process_detach_fd(), process_do_execveat(), process_do_fork(), process_exit(), process_new(), IO::read(), IO::ref(), rpc_simple_callv(), IO::seek(), slab_allocate_mem(), stack_grow(), stack_pop(), stack_push(), sysfs_register_file(), try_handle_kernel_panics_at(), IO::unmap(), IO::unref(), userfs_ensure_connected(), IO::VerifyMMapPermissions(), vfs_list_dir(), vfs_mount(), IO::write(), x86_dump_stack_at(), x86_interrupt_entry(), zero_page(), and SyslogStreamWriter::~SyslogStreamWriter().
#define __types_compatible | ( | a, | |
b ) |
Definition at line 42 of file mos_global.h.
#define do_container_of | ( | ptr, | |
type, | |||
member ) |
Definition at line 45 of file mos_global.h.
#define container_of | ( | ptr, | |
type, | |||
member ) |
Definition at line 52 of file mos_global.h.
#define is_aligned | ( | ptr, | |
alignment ) |
Definition at line 56 of file mos_global.h.
Referenced by __ubsan_handle_type_mismatch(), platform_dump_stack(), slab_free(), and slab_realloc().
#define GET_BIT | ( | x, | |
n ) |
Definition at line 58 of file mos_global.h.
#define MASK_BITS | ( | value, | |
width ) |
Definition at line 59 of file mos_global.h.
Referenced by gdt_set_entry().
#define SET_BITS | ( | bit, | |
width, | |||
value ) |
Definition at line 60 of file mos_global.h.
Referenced by lapic_interrupt_full().
#define MOS_STRINGIFY2 | ( | x | ) |
Definition at line 62 of file mos_global.h.
#define MOS_STRINGIFY | ( | x | ) |
Definition at line 63 of file mos_global.h.
#define MOS_UNUSED | ( | x | ) |
Definition at line 65 of file mos_global.h.
Referenced by __cxa_atexit(), acpi_sysfs_munmap(), cmdline_dynamic_array_insert(), cow_zod_fault_handler(), create_idle_task(), dispatch_syscall(), dmabuf_free(), elf_determine_loadbias(), elf_do_fill_process(), get_ansi_color(), idle_task(), invalid_page_fault(), io_pselect(), ipc_dump_name_waitlist(), ipc_sysfs_create_server(), ipc_sysfs_list_ipcs(), ipc_sysfs_lookup_ipc(), mmstat_sysfs_phyframe_stat_store(), mmstat_sysfs_store_pid(), mos_test_engine_run_tests(), mutex_release(), platform_ap_entry(), platform_arch_syscall(), platform_context_cleanup(), platform_ipi_send(), platform_pml2e_set_pml1(), platform_pml3e_set_pml2(), platform_pml4e_set_pml3(), pml1e_do_copy_callback(), pml1e_do_flag_callback(), pml1e_do_map_callback(), pml1e_do_mask_callback(), pml1e_do_unmap_callback(), pml2e_do_copy_callback(), pml2e_do_flag_callback(), pml2e_do_map_callback(), pml2e_do_unmap_callback(), pml3_entry(), pml3e_do_copy_callback(), pml3e_do_flag_callback(), pml3e_do_map_callback(), pml3e_do_unmap_callback(), pml4_entry(), pml4e_do_copy_callback(), pml4e_do_flag_callback(), pml4e_do_map_callback(), pml4e_do_unmap_callback(), pml5_entry(), pml5e_is_present(), process_do_execveat(), reschedule(), rtc_irq_handler(), sbi_console_clear(), sbi_console_get_color(), sbi_console_set_color(), sbi_console_write(), serial_console_irq_handler(), simple_flush_page_discard_data(), simple_page_write_begin(), simple_page_write_end(), stat_receiver(), sys_mem_mmap(), sys_mem_munmap(), sysfs_fops_mmap(), sysfs_fops_open(), test_foreach_function(), test_foreach_stop_at_quux(), thread_wait_for_tid(), timer_do_wakeup(), tmpfs_fill_cache(), tmpfs_i_hardlink(), tmpfs_i_rename(), tmpfs_i_rmdir(), tmpfs_i_unlink(), userfs_fop_open(), userfs_iop_hardlink(), userfs_iop_mknode(), userfs_iop_rename(), userfs_iop_rmdir(), userfs_iop_symlink(), userfs_manager_server_exec(), vfs_do_open_dentry(), vfs_flusher_entry(), vfs_generic_inode_drop(), vfs_ipc_file_read(), vfs_ipc_file_write(), vfs_open_ipc(), vfs_simple_write_begin(), vfs_verify_permissions(), x86_keyboard_handler(), and x86_pit_timer_handler().
#define MOS_CONCAT_INNER | ( | a, | |
b ) |
Definition at line 67 of file mos_global.h.
#define MOS_CONCAT | ( | a, | |
b ) |
Definition at line 68 of file mos_global.h.
#define MOS_WARNING_PUSH MOS_PRAGMA(diagnostic push) |
Definition at line 70 of file mos_global.h.
Referenced by __section(), MOS_TEST_CASE(), MOS_TEST_CASE(), and MOS_TEST_CASE().
#define MOS_WARNING_POP MOS_PRAGMA(diagnostic pop) |
Definition at line 71 of file mos_global.h.
Referenced by __section(), MOS_TEST_CASE(), MOS_TEST_CASE(), and MOS_TEST_CASE().
#define MOS_WARNING_DISABLE | ( | text | ) |
Definition at line 72 of file mos_global.h.
Referenced by __section(), MOS_TEST_CASE(), MOS_TEST_CASE(), and MOS_TEST_CASE().
#define ALIGN_UP | ( | addr, | |
size ) |
Definition at line 74 of file mos_global.h.
Referenced by cpio_i_iterate_dir(), elf_setup_main_thread(), platform_startup_setup_kernel_mm(), slab_allocate_mem(), and x86_setup_direct_map().
#define ALIGN_DOWN | ( | addr, | |
size ) |
Definition at line 75 of file mos_global.h.
#define ALIGN_UP_TO_PAGE | ( | addr | ) |
Definition at line 76 of file mos_global.h.
Referenced by acpi_sysfs_mmap(), dmabuf_share(), dmabuf_unshare(), elf_map_segment(), ipc_connect_to_server(), limine_entry(), mmap_anonymous(), mmap_file(), munmap(), pagetable_do_dump(), pipe_create(), pmm_init(), register_sysfs_acpi_node(), register_sysfs_acpi_rsdp(), setup_sane_environment(), slab_alloc(), slab_realloc(), thread_new(), vfs_fsync(), and vm_protect().
#define ALIGN_DOWN_TO_PAGE | ( | addr | ) |
Definition at line 77 of file mos_global.h.
Referenced by elf_map_segment(), mm_do_get_flags(), mm_do_get_pfn(), mm_do_get_present(), mm_replace_page_locked(), munmap(), slab_free(), slab_realloc(), and vfs_fault_handler().
#define MOS_IN_RANGE | ( | addr, | |
start, | |||
end ) |
Definition at line 79 of file mos_global.h.
Referenced by elf_do_fill_process(), mm_handle_fault(), and x86_handle_exception().
#define MOS_FOURCC | ( | a, | |
b, | |||
c, | |||
d ) |
Definition at line 81 of file mos_global.h.
#define MOS_ARRAY_SIZE | ( | x | ) |
Definition at line 84 of file mos_global.h.
Referenced by break_the_order(), buddy_alloc_n_exact(), buddy_dump_all(), buddy_init(), format_size(), slab_for(), slab_init(), try_merge(), userfs_manager_server_exec(), and x86_cpu_setup_xsave_area().
#define MOS_MAX_VADDR ((ptr_t) ~0) |
Definition at line 93 of file mos_global.h.
#define READ_ONCE | ( | x | ) |
Definition at line 95 of file mos_global.h.
#define KB * 1024 |
Definition at line 98 of file mos_global.h.
Referenced by invalid_page_fault(), limine_entry(), and x86_dump_stack_at().
#define MB * 1024 KB |
Definition at line 99 of file mos_global.h.
Referenced by __mos_test_wrapped_test_kmalloc_large(), add_to_memmap(), and x86_setup_direct_map().
Definition at line 100 of file mos_global.h.
Referenced by platform_startup_setup_kernel_mm(), and x86_setup_direct_map().
Definition at line 101 of file mos_global.h.
#define statement_expr | ( | type, | |
... ) |
Definition at line 102 of file mos_global.h.
Referenced by PipeIOImpl::on_closed(), platform_switch_to_thread(), and reschedule().
#define __NO_OP | ( | ... | ) |
Definition at line 105 of file mos_global.h.
#define BIT | ( | x | ) |
Definition at line 107 of file mos_global.h.
Referenced by lapic_wait_sent(), riscv64_trap_handler(), x86_cpu_initialise_caps(), and x86_cpu_setup_xsave_area().
#define MOSAPI extern |
Definition at line 112 of file mos_global.h.
Referenced by __ubsan_handle_add_overflow(), __ubsan_handle_builtin_unreachable(), __ubsan_handle_divrem_overflow(), __ubsan_handle_invalid_builtin(), __ubsan_handle_load_invalid_value(), __ubsan_handle_mul_overflow(), __ubsan_handle_negate_overflow(), __ubsan_handle_negate_overflow_v1(), __ubsan_handle_out_of_bounds(), __ubsan_handle_pointer_overflow(), __ubsan_handle_shift_out_of_bounds(), __ubsan_handle_sub_overflow(), __ubsan_handle_type_mismatch(), __ubsan_handle_type_mismatch_v1(), __ubsan_handle_vla_bound_not_positive(), atexit(), do_kcalloc(), do_kfree(), do_kmalloc(), do_krealloc(), exit(), fgetc(), fputc(), fputs(), getchar(), int(), int(), putchar(), puts(), rpc_call_arg_s16(), rpc_call_arg_u16(), rpc_context_get_function_id(), start_thread(), strdup(), strndup(), strtoul(), vdprintf(), vfprintf(), void(), vprintf(), and vsnprintf().
#define MOS_CONFIG | ( | feat | ) |
Definition at line 117 of file mos_global.h.
#define MOS_DEBUG_FEATURE | ( | feat | ) |
Definition at line 119 of file mos_global.h.
#define once | ( | ) |
Returns true for the first call, false for all subsequent calls.
Definition at line 124 of file mos_global.h.
Referenced by lapic_enable(), and try_handle_kernel_panics_at().
#define MOS_PUT_IN_SECTION | ( | _section, | |
_struct, | |||
_var, | |||
... ) |
Definition at line 135 of file mos_global.h.
#define IS_ERR_VALUE | ( | x | ) |
Definition at line 137 of file mos_global.h.
Referenced by dmabuf_alloc(), dmabuf_share(), do_flush_and_drop_cached_page(), io_readv(), ksyscall_enter(), File::on_read(), File::on_write(), rpc_client_create(), rpc_server_create(), rpc_server_destroy(), rpc_server_exec(), and vfs_ipc_file_read().
#define MOS_STUB_IMPL | ( | ... | ) |
Definition at line 139 of file mos_global.h.