MOS Source Code
Loading...
Searching...
No Matches
assert.h File Reference
#include "mos/misc/panic.h"
#include <mos/mos_global.h>
#include <mos/types.h>
+ Include dependency graph for assert.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MOS_UNIMPLEMENTED(content)
 
#define MOS_UNREACHABLE()
 
#define MOS_UNREACHABLE_X(msg, ...)
 
#define MOS_ASSERT_ONCE(...)
 
#define MOS_ASSERT(cond)
 
#define MOS_ASSERT_X(cond, msg, ...)
 
#define mos_warn(fmt, ...)
 
#define mos_warn_once(...)
 
#define spinlock_assert_locked(lock)
 

Functions

 __BEGIN_DECLS (3, 4) void mos_kwarn(const char *func
 

Variables

u32 line
 
u32 const char * fmt
 

Macro Definition Documentation

◆ MOS_UNIMPLEMENTED

#define MOS_UNIMPLEMENTED ( content)
Value:
mos_panic("\nUNIMPLEMENTED: %s", content)
#define mos_panic(fmt,...)
Definition panic.h:55

Definition at line 10 of file assert.h.

Referenced by platform_arch_syscall().

◆ MOS_UNREACHABLE

◆ MOS_UNREACHABLE_X

#define MOS_UNREACHABLE_X ( msg,
... )
Value:
mos_panic("\nUNREACHABLE line %d reached in file: %s\n" msg, __LINE__, __FILE__, ##__VA_ARGS__)

Definition at line 12 of file assert.h.

Referenced by do_signal_exit_to_user_prepare(), and is_fatal_signal().

◆ MOS_ASSERT_ONCE

#define MOS_ASSERT_ONCE ( ...)
Value:
MOS_ASSERT_X(once(), __VA_ARGS__)
#define MOS_ASSERT_X(cond, msg,...)
Definition assert.h:15
#define once()
Returns true for the first call, false for all subsequent calls.
Definition mos_global.h:114

Definition at line 13 of file assert.h.

Referenced by pmm_init().

◆ MOS_ASSERT

#define MOS_ASSERT ( cond)
Value:
MOS_ASSERT_X(cond, "")

Definition at line 14 of file assert.h.

Referenced by _pmm_unref_phyframes(), add_to_freelist(), break_the_order(), break_this_pfn(), buddy_free_n(), cow_zod_fault_handler(), cpio_fill_cache(), cpio_i_iterate_dir(), cpio_mount(), dentry_attach(), dentry_create(), dentry_from_fd(), dentry_get_mount(), dentry_lookup_child(), dentry_ref(), dentry_resolve(), dentry_resolve_lastseg(), dentry_resolve_to_parent(), dentry_root_get_mountpoint(), dentry_try_release(), do_attach_vmap(), dump_fdt_node(), elf_map_segment(), elf_setup_main_thread(), enter_scheduler(), extract_exact_range(), futex_wait(), inode_ref(), inode_unlink(), inode_unref(), invalid_page_fault(), ipc_client_close_channel(), ipc_connect_to_server(), ipc_server_accept(), ipc_server_close(), ipc_server_close_channel(), ipc_sysfs_list_ipcs(), lapic_read32(), lapic_read64(), lapic_write32(), lapic_write64(), mm_destroy_context(), mm_flag_pages_locked(), mm_get_is_mapped_locked(), mm_handle_fault(), mm_map_kernel_pages(), mm_resolve_cow_fault(), mmstat_dec(), mmstat_inc(), pagecache_get_page_for_read(), pipe_read(), pipe_write(), pipeio_io_read(), pipeio_io_write(), platform_context_setup_child_thread(), pml1_destroy_range(), pmm_allocate_frames(), populate_freelist(), process_attach_ref_fd(), process_destroy(), process_detach_fd(), process_do_execveat(), process_do_fork(), process_exit(), process_get_fd(), process_wait_for_pid(), riscv64_trap_handler(), rtc_irq_handler(), scheduler_add_thread(), scheduler_remove_thread(), signal_exit_to_user_prepare(), signal_exit_to_user_prepare_syscall(), signal_get_next_pending(), sigset_add(), sigset_del(), sigset_test(), sysfs_fsop_mount(), sysfs_register(), sysfs_register_file(), thread_complete_init(), timer_msleep(), tmpfs_fsop_mount(), tmpfs_i_rmdir(), userfs_iop_iterate_dir(), vfs_do_open_dentry(), vfs_fault_handler(), vfs_fstatat(), vfs_generic_iterate_dir(), vfs_io_ops_mmap(), vfs_mount(), vfs_open_ipc(), vfs_register_filesystem(), vfs_unmount(), vfs_verify_permissions(), vm_protect(), vmap_destroy(), vmap_finalise_init(), vmap_obtain(), vmap_split(), vmap_split_for_range(), x86_handle_exception(), x86_keyboard_handler(), x86_pit_timer_handler(), x86_unblock_aps(), and zero_page().

◆ MOS_ASSERT_X

◆ mos_warn

◆ mos_warn_once

#define mos_warn_once ( ...)
Value:
do \
{ \
if (once()) \
mos_warn(__VA_ARGS__); \
} while (0)

Definition at line 25 of file assert.h.

Referenced by pmm_init().

◆ spinlock_assert_locked

#define spinlock_assert_locked ( lock)
Value:
#define MOS_ASSERT(cond)
Definition assert.h:14
should_inline bool spinlock_is_locked(const spinlock_t *lock)
Definition spinlock.h:68

Definition at line 32 of file assert.h.

Function Documentation

◆ __BEGIN_DECLS()

__BEGIN_DECLS ( 3 ,
4  ) const

Variable Documentation

◆ line

◆ fmt

u32 const char* fmt

Definition at line 36 of file assert.h.

Referenced by do_syslog(), lvprintk(), mos_kwarn(), sysfs_printf(), and test_engine_warning_handler().