generic
[Miscellanea]


Files

file  align.h
file  arch.h
file  atomic.h
file  bitops.h
file  byteorder.h
file  config.h
file  context.h
file  cpu.h
file  elf.h
file  errno.h
file  fpu_context.h
file  func.h
file  macros.h
file  memstr.h
file  panic.h
file  preemption.h
file  print.h
file  printf_core.h
file  putchar.h
file  cap.h
file  ipi.h
file  smp.h
file  sort.h
file  stackarg.h
file  stdarg.h
file  symtab.h
file  copy.h
file  sysarg64.h
 Wrapper for explicit 64-bit arguments passed to syscalls.
file  syscall.h
file  sysinfo.h
file  test.h
file  typedefs.h
file  userspace.h
file  cpu.c
 CPU subsystem initialization and listing.
file  elf.c
 Kernel ELF loader.
file  func.c
 Miscellaneous functions.
file  memstr.c
 Memory string operations.
file  sort.c
 Sorting functions.
file  preemption.c
 Preemption control.
file  printf.c
file  printf_core.c
 Printing functions.
file  snprintf.c
file  sprintf.c
file  vprintf.c
file  vsnprintf.c
file  vsprintf.c
file  cap.c
 Capabilities control.
file  ipi.c
 Generic IPI interface.
file  copy.c
 Copying between kernel and userspace.
file  syscall.c
 Syscall table and syscall wrappers.
file  sysinfo.c

Data Structures

struct  the
struct  atomic
struct  init_task_t
struct  init_t
struct  config_t
struct  cpu
struct  elf32_header
struct  elf64_header
struct  elf32_segment_header
struct  elf64_segment_header
struct  elf32_section_header
struct  elf64_section_header
struct  elf32_symbol
struct  elf64_symbol
struct  printf_spec
struct  va_list
struct  symtab_entry
struct  sysarg64_t
union  sysinfo_item_val
struct  sysinfo_item
struct  sysinfo_rettype
struct  vsnprintf_data

Defines

#define ALIGN_DOWN(s, a)   ((s) & ~((a) - 1))
#define ALIGN_UP(s, a)   (((s) + ((a) - 1)) & ~((a) - 1))
#define CPU   THE->cpu
#define THREAD   THE->thread
#define TASK   THE->task
#define AS   THE->as
#define PREEMPTION_DISABLED   THE->preemption_disabled
#define THE   ((the_t *)(get_stack_base()))
#define fnzb(x)   fnzb32(x)
#define STACK_SIZE   PAGE_SIZE
#define CONFIG_MEMORY_SIZE   (8 * 1024 * 1024)
#define CONFIG_INIT_TASKS   32
#define context_set(c, _pc, stack, size)
#define context_save(c)   context_save_arch(c)
#define CPU_STACK_SIZE   STACK_SIZE
#define EV_CURRENT   1
#define ET_NONE   0
#define ET_REL   1
#define ET_EXEC   2
#define ET_DYN   3
#define ET_CORE   4
#define ET_LOPROC   0xff00
#define ET_HIPROC   0xffff
#define EM_NO   0
#define EM_SPARC   2
#define EM_386   3
#define EM_MIPS   8
#define EM_MIPS_RS3_LE   10
#define EM_PPC   20
#define EM_PPC64   21
#define EM_SPARCV9   43
#define EM_IA_64   50
#define EM_X86_64   62
#define EI_MAG0   0
#define EI_MAG1   1
#define EI_MAG2   2
#define EI_MAG3   3
#define EI_CLASS   4
#define EI_DATA   5
#define EI_VERSION   6
#define EI_OSABI   7
#define EI_ABIVERSION   8
#define EI_PAD   9
#define EI_NIDENT   16
#define ELFMAG0   0x7f
#define ELFMAG1   'E'
#define ELFMAG2   'L'
#define ELFMAG3   'F'
#define ELFCLASSNONE   0
#define ELFCLASS32   1
#define ELFCLASS64   2
#define ELFDATANONE   0
#define ELFDATA2LSB   1
#define ELFDATA2MSB   2
#define EE_OK   0
#define EE_INVALID   1
#define EE_MEMORY   2
#define EE_INCOMPATIBLE   3
#define EE_UNSUPPORTED   4
#define EE_IRRECOVERABLE   5
#define SHT_NULL   0
#define SHT_PROGBITS   1
#define SHT_SYMTAB   2
#define SHT_STRTAB   3
#define SHT_RELA   4
#define SHT_HASH   5
#define SHT_DYNAMIC   6
#define SHT_NOTE   7
#define SHT_NOBITS   8
#define SHT_REL   9
#define SHT_SHLIB   10
#define SHT_DYNSYM   11
#define SHT_LOOS   0x60000000
#define SHT_HIOS   0x6fffffff
#define SHT_LOPROC   0x70000000
#define SHT_HIPROC   0x7fffffff
#define SHT_LOUSER   0x80000000
#define SHT_HIUSER   0xffffffff
#define SHF_WRITE   0x1
#define SHF_ALLOC   0x2
#define SHF_EXECINSTR   0x4
#define SHF_MASKPROC   0xf0000000
#define STB_LOCAL   0
#define STB_GLOBAL   1
#define STB_WEAK   2
#define STB_LOPROC   13
#define STB_HIPROC   15
#define STT_NOTYPE   0
#define STT_OBJECT   1
#define STT_FUNC   2
#define STT_SECTION   3
#define STT_FILE   4
#define STT_LOPROC   13
#define STT_HIPROC   15
#define PT_NULL   0
#define PT_LOAD   1
#define PT_DYNAMIC   2
#define PT_INTERP   3
#define PT_NOTE   4
#define PT_SHLIB   5
#define PT_PHDR   6
#define PT_LOPROC   0x70000000
#define PT_HIPROC   0x7fffffff
#define PF_X   1
#define PF_W   2
#define PF_R   4
#define ENOENT   -1
#define ENOMEM   -2
#define ELIMIT   -3
#define EREFUSED   -4
#define EFORWARD   -5
#define EPERM   -6
#define EHANGUP   -7
#define EEXISTS   -8
#define EBADMEM   -9
#define ENOTSUP   -10
#define EADDRNOTAVAIL   -11
#define ETIMEOUT   -12
#define EINVAL   -13
#define EBUSY   -14
#define is_digit(d)   (((d) >= '0') && ((d)<='9'))
#define is_lower(c)   (((c) >= 'a') && ((c) <= 'z'))
#define is_upper(c)   (((c) >= 'A') && ((c) <= 'Z'))
#define is_alpha(c)   (is_lower(c) || is_upper(c))
#define is_alphanum(c)   (is_alpha(c) || is_digit(c))
#define is_white(c)   (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
#define min(a, b)   ((a)<(b)?(a):(b))
#define max(a, b)   ((a)>(b)?(a):(b))
#define PA_overlaps(x, szx, y, szy)   overlaps(KA2PA(x),szx,KA2PA(y), szy)
#define panic(format,)   panic_printf("Kernel panic: " format, ##__VA_ARGS__);
#define EOF   (-1)
#define CAP_CAP   (1<<0)
#define CAP_MEM_MANAGER   (1<<1)
#define CAP_IO_MANAGER   (1<<2)
#define CAP_PREEMPT_CONTROL   (1<<3)
#define CAP_IRQ_REG   (1<<4)
#define va_start(ap, lst)
#define va_arg(ap, type)   (*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type))))
#define va_copy(dst, src)   dst=src
#define va_end(ap)
#define va_start(ap, last)   __builtin_va_start(ap, last)
#define va_arg(ap, type)   __builtin_va_arg(ap, type)
#define va_end(ap)   __builtin_va_end(ap)
#define va_copy(dst, src)   __builtin_va_copy(dst,src)
#define MAX_SYMBOL_NAME   64
#define SYSINFO_VAL_VAL   0
#define SYSINFO_VAL_FUNCTION   1
#define SYSINFO_VAL_UNDEFINED   '?'
#define SYSINFO_SUBINFO_NONE   0
#define SYSINFO_SUBINFO_TABLE   1
#define SYSINFO_SUBINFO_FUNCTION   2
#define false   0
#define true   1
#define EBUFSIZE   32
#define __PRINTF_FLAG_PREFIX   0x00000001
#define __PRINTF_FLAG_SIGNED   0x00000002
#define __PRINTF_FLAG_ZEROPADDED   0x00000004
#define __PRINTF_FLAG_LEFTALIGNED   0x00000010
#define __PRINTF_FLAG_SHOWPLUS   0x00000020
#define __PRINTF_FLAG_SPACESIGN   0x00000040
#define __PRINTF_FLAG_BIGCHARS   0x00000080
#define __PRINTF_FLAG_NEGATIVE   0x00000100
#define PRINT_NUMBER_BUFFER_SIZE   (64+5)

Typedefs

typedef atomic atomic_t
typedef __u64 elf_xword
typedef __s64 elf_sxword
typedef __u32 elf_word
typedef __s32 elf_sword
typedef __u16 elf_half
typedef __u32 elf32_addr
typedef __u32 elf32_off
typedef __u64 elf64_addr
typedef __u64 elf64_off
typedef __u32 cap_t
typedef __builtin_va_list va_list
typedef sysinfo_item_val sysinfo_item_val_t
typedef sysinfo_item sysinfo_item_t
typedef __native(* sysinfo_val_fn_t )(sysinfo_item_t *root)
typedef __native(* sysinfo_subinfo_fn_t )(const char *subname)
typedef sysinfo_rettype sysinfo_rettype_t
typedef short bool
typedef unsigned long size_t
typedef unsigned long count_t
typedef unsigned long index_t
typedef unsigned long long task_id_t
typedef cpu_info cpu_info_t
typedef cpu cpu_t
typedef cpu_arch cpu_arch_t
typedef task task_t
typedef enum state state_t
typedef thread thread_t
typedef context context_t
typedef fpu_context fpu_context_t
typedef timeout timeout_t
typedef runq runq_t
typedef spinlock spinlock_t
typedef mutex mutex_t
typedef semaphore semaphore_t
typedef rwlock rwlock_t
typedef enum rwlock_type rwlock_type_t
typedef condvar condvar_t
typedef waitq waitq_t
typedef futex futex_t
typedef buddy_system buddy_system_t
typedef buddy_system_operations buddy_system_operations_t
typedef as_area as_area_t
typedef as as_t
typedef link link_t
typedef the the_t
typedef chardev chardev_t
typedef enum cmd_arg_type cmd_arg_type_t
typedef cmd_arg cmd_arg_t
typedef cmd_info cmd_info_t
typedef istate istate_t
typedef void(* iroutine )(int n, istate_t *istate)
typedef hash_table hash_table_t
typedef hash_table_operations hash_table_operations_t
typedef btree_node btree_node_t
typedef btree btree_t

Enumerations

enum  syscall_t {
  SYS_IO = 0, SYS_TLS_SET = 1, SYS_THREAD_CREATE, SYS_THREAD_EXIT,
  SYS_TASK_GET_ID, SYS_FUTEX_SLEEP, SYS_FUTEX_WAKEUP, SYS_AS_AREA_CREATE,
  SYS_AS_AREA_RESIZE, SYS_AS_AREA_DESTROY, SYS_IPC_CALL_SYNC_FAST, SYS_IPC_CALL_SYNC,
  SYS_IPC_CALL_ASYNC_FAST, SYS_IPC_CALL_ASYNC, SYS_IPC_ANSWER_FAST, SYS_IPC_ANSWER,
  SYS_IPC_FORWARD_FAST, SYS_IPC_WAIT, SYS_IPC_HANGUP, SYS_IPC_REGISTER_IRQ,
  SYS_IPC_UNREGISTER_IRQ, SYS_CAP_GRANT, SYS_CAP_REVOKE, SYS_MAP_PHYSMEM,
  SYS_IOSPACE_ENABLE, SYS_PREEMPT_CONTROL, SYS_SYSINFO_VALID, SYS_SYSINFO_VALUE,
  SYS_DEBUG_ENABLE_CONSOLE, SYSCALL_END
}
enum  qualifier_t {
  PrintfQualifierByte = 0, PrintfQualifierShort, PrintfQualifierInt, PrintfQualifierLong,
  PrintfQualifierLongLong, PrintfQualifierNative, PrintfQualifierPointer
}

Functions

void the_initialize (the_t *the)
void the_copy (the_t *src, the_t *dst)
void arch_pre_main (void)
void arch_pre_mm_init (void)
void arch_post_mm_init (void)
void arch_pre_smp_init (void)
void arch_post_smp_init (void)
void calibrate_delay_loop (void)
ipl_t interrupts_disable (void)
ipl_t interrupts_enable (void)
void interrupts_restore (ipl_t ipl)
ipl_t interrupts_read (void)
static void atomic_set (atomic_t *val, long i)
static long atomic_get (atomic_t *val)
static int fnzb32 (__u32 arg)
static int fnzb64 (__u64 arg)
static __u64 __u64_byteorder_swap (__u64 n)
static __u32 __u32_byteorder_swap (__u32 n)
int context_save_arch (context_t *c)
void context_restore_arch (context_t *c) __attribute__((noreturn))
static void context_restore (context_t *c)
void cpu_init (void)
void cpu_list (void)
void cpu_arch_init (void)
void cpu_identify (void)
void cpu_print_report (cpu_t *m)
int elf_load (elf_header_t *header, as_t *as)
char * elf_error (int rc)
void fpu_context_save (fpu_context_t *)
void fpu_context_restore (fpu_context_t *)
void fpu_init (void)
void fpu_enable (void)
void fpu_disable (void)
void halt (void)
size_t strlen (const char *str)
int strncmp (const char *src, const char *dst, size_t len)
void strncpy (char *dest, const char *src, size_t len)
__native atoi (const char *text)
static int overlaps (__address s1, size_t sz1, __address s2, size_t sz2)
void * _memcpy (void *dst, const void *src, size_t cnt)
void _memsetb (__address dst, size_t cnt, __u8 x)
void _memsetw (__address dst, size_t cnt, __u16 x)
void panic_printf (char *fmt,...) __attribute__((noreturn))
void preemption_disable (void)
void preemption_enable (void)
int printf (const char *fmt,...)
int sprintf (char *str, const char *fmt,...)
int snprintf (char *str, size_t size, const char *fmt,...)
int vprintf (const char *fmt, va_list ap)
int vsprintf (char *str, const char *fmt, va_list ap)
int vsnprintf (char *str, size_t size, const char *fmt, va_list ap)
int printf_core (const char *fmt, struct printf_spec *ps, va_list ap)
void putchar (const char ch)
void cap_set (task_t *t, cap_t caps)
cap_t cap_get (task_t *t)
__native sys_cap_grant (sysarg64_t *uspace_taskid_arg, cap_t caps)
__native sys_cap_revoke (sysarg64_t *uspace_taskid_arg, cap_t caps)
void ipi_broadcast (int ipi)
void ipi_broadcast_arch (int ipi)
void smp_init (void)
void bubblesort (void *data, count_t n, size_t e_size, int(*cmp)(void *a, void *b))
void qsort (void *data, count_t n, size_t e_size, int(*cmp)(void *a, void *b))
int int_cmp (void *a, void *b)
int __u32_cmp (void *a, void *b)
int __u16_cmp (void *a, void *b)
int __u8_cmp (void *a, void *b)
char * get_symtab_entry (__native addr)
__address get_symbol_addr (const char *name)
void symtab_print_search (const char *name)
int symtab_compl (char *name)
int copy_from_uspace (void *dst, const void *uspace_src, size_t size)
int copy_to_uspace (void *dst_uspace, const void *src, size_t size)
int memcpy_from_uspace (void *dst, const void *uspace_src, size_t size)
int memcpy_to_uspace (void *uspace_dst, const void *src, size_t size)
void sysinfo_set_item_val (const char *name, sysinfo_item_t **root, __native val)
void sysinfo_dump (sysinfo_item_t **root, int depth)
void sysinfo_set_item_function (const char *name, sysinfo_item_t **root, sysinfo_val_fn_t fn)
void sysinfo_set_item_undefined (const char *name, sysinfo_item_t **root)
sysinfo_rettype_t sysinfo_get_val (const char *name, sysinfo_item_t **root)
__native sys_sysinfo_valid (__native ptr, __native len)
__native sys_sysinfo_value (__native ptr, __native len)
void test (void)
void userspace (uspace_arg_t *uarg) __attribute__((noreturn))
static int segment_header (elf_segment_header_t *entry, elf_header_t *elf, as_t *as)
static int section_header (elf_section_header_t *entry, elf_header_t *elf, as_t *as)
static int load_segment (elf_segment_header_t *entry, elf_header_t *elf, as_t *as)
void _qsort (void *data, count_t n, size_t e_size, int(*cmp)(void *a, void *b), void *tmp, void *pivot)
void _bubblesort (void *data, count_t n, size_t e_size, int(*cmp)(void *a, void *b), void *slot)
 SPINLOCK_INITIALIZE (printflock)
static int isdigit (int c)
static int printf_putnchars (const char *buf, size_t count, struct printf_spec *ps)
static int printf_putstr (const char *str, struct printf_spec *ps)
static int printf_putchar (int c, struct printf_spec *ps)
static int print_char (char c, int width, __u64 flags, struct printf_spec *ps)
static int print_string (char *s, int width, int precision, __u64 flags, struct printf_spec *ps)
static int print_number (__u64 num, int width, int precision, int base, __u64 flags, struct printf_spec *ps)
int vprintf_write (const char *str, size_t count, void *unused)
int vsnprintf_write (const char *str, size_t count, struct vsnprintf_data *data)
static __native sys_io (int fd, const void *buf, size_t count)
static __native sys_debug_enable_console (void)
__native syscall_handler (__native a1, __native a2, __native a3, __native a4, __native id)
static sysinfo_item_tsysinfo_find_item (const char *name, sysinfo_item_t *subtree)
static sysinfo_item_tsysinfo_create_path (const char *name, sysinfo_item_t **psubtree)

Variables

config_t config
init_t init
cpu_tcpus
atomic_t haltstate
spinlock_t printflock
symtab_entry symbol_table []
char memcpy_from_uspace_failover_address
char memcpy_to_uspace_failover_address
cpu_tcpus
static char * error_codes []
atomic_t haltstate = {0}
static char digits_small [] = "0123456789abcdef"
static char digits_big [] = "0123456789ABCDEF"
syshandler_t syscall_table [SYSCALL_END]
sysinfo_item_t_root = NULL

Define Documentation

#define __PRINTF_FLAG_BIGCHARS   0x00000080
 

show big characters

Definition at line 55 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_LEFTALIGNED   0x00000010
 

align to left

Definition at line 52 of file printf_core.c.

Referenced by print_char(), print_number(), print_string(), and printf_core().

#define __PRINTF_FLAG_NEGATIVE   0x00000100
 

number has - sign

Definition at line 56 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_PREFIX   0x00000001
 

show prefixes 0x or 0

Definition at line 49 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_SHOWPLUS   0x00000020
 

always show + sign

Definition at line 53 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_SIGNED   0x00000002
 

signed / unsigned number

Definition at line 50 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_SPACESIGN   0x00000040
 

print space instead of plus

Definition at line 54 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define __PRINTF_FLAG_ZEROPADDED   0x00000004
 

print leading zeroes

Definition at line 51 of file printf_core.c.

Referenced by print_number(), and printf_core().

#define ALIGN_DOWN s,
 )     ((s) & ~((a) - 1))
 

Align to the nearest lower address.

Parameters:
s Address or size to be aligned.
a Size of alignment, must be power of 2.

Definition at line 45 of file align.h.

Referenced by anon_page_fault(), elf_page_fault(), phys_page_fault(), sys_futex_sleep_timeout(), sys_futex_wakeup(), sys_physmem_map(), used_space_insert(), and used_space_remove().

#define ALIGN_UP s,
 )     (((s) + ((a) - 1)) & ~((a) - 1))
 

Align to the nearest higher address.

Parameters:
s Address or size to be aligned.
a Size of alignment, must be power of 2.

Definition at line 53 of file align.h.

Referenced by _memcpy(), _slab_cache_create(), bitmap_clear_range(), bitmap_set_range(), elf_frame_free(), elf_page_fault(), hw_map(), io_perm_bitmap_install(), load_segment(), and main_bsp().

#define AS   THE->as
 

Definition at line 49 of file arch.h.

Referenced by answer_preprocess(), as_area_destroy(), as_area_resize(), as_destroy(), as_get_size(), as_page_fault(), as_switch(), phys_page_fault(), sys_as_area_create(), sys_as_area_destroy(), sys_as_area_resize(), sys_futex_sleep_timeout(), and sys_futex_wakeup().

#define CAP_CAP   (1<<0)
 

CAP_CAP allows its holder to grant/revoke arbitrary privilege to/from other tasks.

Definition at line 58 of file cap.h.

Referenced by sys_cap_grant(), and sys_cap_revoke().

#define CAP_IO_MANAGER   (1<<2)
 

CAP_IO_MANAGER allows its holder to access I/O space to other tasks.

Definition at line 70 of file cap.h.

Referenced by ddi_iospace_enable().

#define CAP_IRQ_REG   (1<<4)
 

CAP_IRQ_REG entitles its holder to register IRQ handlers.

Definition at line 80 of file cap.h.

Referenced by sys_ipc_register_irq(), and sys_ipc_unregister_irq().

#define CAP_MEM_MANAGER   (1<<1)
 

CAP_MEM_MANAGER allows its holder to map physical memory to other tasks.

Definition at line 64 of file cap.h.

Referenced by ddi_physmem_map().

#define CAP_PREEMPT_CONTROL   (1<<3)
 

CAP_PREEMPT_CONTROL allows its holder to disable/enable preemption.

Definition at line 75 of file cap.h.

Referenced by sys_preempt_control().

#define CONFIG_INIT_TASKS   32
 

Definition at line 46 of file config.h.

#define CONFIG_MEMORY_SIZE   (8 * 1024 * 1024)
 

Definition at line 44 of file config.h.

#define context_save  )     context_save_arch(c)
 

Save register context.

Save current register context (including stack pointers) to context structure.

Note that call to context_restore() will return at the same address as the corresponding call to context_save().

This MUST be a macro, gcc -O0 does not inline functions even if they are marked inline and context_save_arch must be called from level <= that when context_restore is called.

Parameters:
c Context structure.
Returns:
context_save() returns 1, context_restore() returns 0.

Definition at line 68 of file context.h.

Referenced by scheduler(), thread_create(), and waitq_sleep_timeout_unsafe().

#define context_set c,
_pc,
stack,
size   ) 
 

Value:

(c)->pc = (__address) (_pc);            \
        (c)->sp = ((__address) (stack)) + (size) - SP_DELTA;

Definition at line 44 of file context.h.

Referenced by main_ap(), scheduler(), and thread_create().

#define CPU   THE->cpu
 

Definition at line 46 of file arch.h.

Referenced by _getc(), before_thread_runs(), before_thread_runs_arch(), clock(), clock_update_counters(), cpu_arch_init(), cpu_identify(), delay(), find_best_thread(), get_full_current_mag(), gp_fault(), halt(), io_perm_bitmap_install(), kcpulb(), magazine_obj_get(), magazine_obj_put(), main_ap(), make_empty_current_mag(), relink_rq(), scheduler(), scheduler_separated_stack(), thread_ready(), timeout_init(), timeout_register(), tlb_shootdown_finalize(), tlb_shootdown_ipi_recv(), and tlb_shootdown_start().

#define CPU_STACK_SIZE   STACK_SIZE
 

Definition at line 49 of file cpu.h.

Referenced by main_ap(), and scheduler().

#define EADDRNOTAVAIL   -11
 

Definition at line 52 of file errno.h.

#define EBADMEM   -9
 

Definition at line 50 of file errno.h.

Referenced by ipc_irq_register().

#define EBUFSIZE   32
 

Definition at line 46 of file sort.c.

Referenced by bubblesort(), and qsort().

#define EBUSY   -14
 

Definition at line 55 of file errno.h.

#define EE_INCOMPATIBLE   3
 

Definition at line 115 of file elf.h.

Referenced by elf_load().

#define EE_INVALID   1
 

Definition at line 113 of file elf.h.

Referenced by elf_load(), and load_segment().

#define EE_IRRECOVERABLE   5
 

Definition at line 117 of file elf.h.

#define EE_MEMORY   2
 

Definition at line 114 of file elf.h.

Referenced by load_segment().

#define EE_OK   0
 

ELF error return codes

Definition at line 112 of file elf.h.

Referenced by elf_load(), load_segment(), section_header(), segment_header(), and task_run_program().

#define EE_UNSUPPORTED   4
 

Definition at line 116 of file elf.h.

Referenced by elf_load(), load_segment(), and segment_header().

#define EEXISTS   -8
 

Definition at line 49 of file errno.h.

Referenced by ipc_irq_register().

#define EFORWARD   -5
 

Definition at line 44 of file errno.h.

Referenced by ipc_call(), process_answer(), and sys_ipc_forward_fast().

#define EHANGUP   -7
 

Definition at line 46 of file errno.h.

Referenced by answer_preprocess(), ipc_call(), ipc_cleanup_call_list(), and process_answer().

#define EI_ABIVERSION   8
 

Definition at line 83 of file elf.h.

#define EI_CLASS   4
 

Definition at line 79 of file elf.h.

Referenced by elf_load().

#define EI_DATA   5
 

Definition at line 80 of file elf.h.

Referenced by elf_load().

#define EI_MAG0   0
 

ELF identification indexes

Definition at line 75 of file elf.h.

Referenced by elf_load().

#define EI_MAG1   1
 

Definition at line 76 of file elf.h.

Referenced by elf_load().

#define EI_MAG2   2
 

Definition at line 77 of file elf.h.

Referenced by elf_load().

#define EI_MAG3   3
 

Definition at line 78 of file elf.h.

Referenced by elf_load().

#define EI_NIDENT   16
 

Definition at line 85 of file elf.h.

#define EI_OSABI   7
 

Definition at line 82 of file elf.h.

#define EI_PAD   9
 

Definition at line 84 of file elf.h.

#define EI_VERSION   6
 

Definition at line 81 of file elf.h.

Referenced by elf_load().

#define EINVAL   -13
 

Definition at line 54 of file errno.h.

Referenced by thread_join_timeout().

#define ELFCLASS32   1
 

Definition at line 99 of file elf.h.

#define ELFCLASS64   2
 

Definition at line 100 of file elf.h.

#define ELFCLASSNONE   0
 

ELF file classes

Definition at line 98 of file elf.h.

#define ELFDATA2LSB   1
 

Definition at line 106 of file elf.h.

#define ELFDATA2MSB   2
 

Definition at line 107 of file elf.h.

#define ELFDATANONE   0
 

ELF data encoding types

Definition at line 105 of file elf.h.

#define ELFMAG0   0x7f
 

ELF magic number

Definition at line 90 of file elf.h.

Referenced by elf_load().

#define ELFMAG1   'E'
 

Definition at line 91 of file elf.h.

Referenced by elf_load().

#define ELFMAG2   'L'
 

Definition at line 92 of file elf.h.

Referenced by elf_load().

#define ELFMAG3   'F'
 

Definition at line 93 of file elf.h.

Referenced by elf_load().

#define ELIMIT   -3
 

Definition at line 42 of file errno.h.

Referenced by process_request(), request_preprocess(), sys_io(), sys_ipc_register_irq(), and sys_ipc_unregister_irq().

#define EM_386   3
 

Definition at line 63 of file elf.h.

#define EM_IA_64   50
 

Definition at line 69 of file elf.h.

#define EM_MIPS   8
 

Definition at line 64 of file elf.h.

#define EM_MIPS_RS3_LE   10
 

Definition at line 65 of file elf.h.

#define EM_NO   0
 

ELF machine types

Definition at line 61 of file elf.h.

#define EM_PPC   20
 

Definition at line 66 of file elf.h.

#define EM_PPC64   21
 

Definition at line 67 of file elf.h.

#define EM_SPARC   2
 

Definition at line 62 of file elf.h.

#define EM_SPARCV9   43
 

Definition at line 68 of file elf.h.

#define EM_X86_64   62
 

Definition at line 70 of file elf.h.

#define ENOENT   -1
 

Definition at line 40 of file errno.h.

Referenced by as_area_destroy(), as_area_resize(), as_area_share(), ddi_iospace_enable(), ddi_iospace_enable_arch(), ipc_call(), sys_cap_grant(), sys_cap_revoke(), sys_futex_sleep_timeout(), sys_futex_wakeup(), sys_ipc_answer(), sys_ipc_answer_fast(), sys_ipc_call_sync(), sys_ipc_call_sync_fast(), sys_ipc_forward_fast(), sys_ipc_hangup(), and task_kill().

#define ENOMEM   -2
 

Definition at line 41 of file errno.h.

Referenced by as_area_share(), ddi_iospace_enable_arch(), ddi_physmem_map(), sys_io(), and sys_thread_create().

#define ENOTSUP   -10
 

Definition at line 51 of file errno.h.

Referenced by as_area_resize(), and as_area_share().

#define EOF   (-1)
 

Definition at line 45 of file print.h.

#define EPERM   -6
 

Definition at line 45 of file errno.h.

Referenced by as_area_resize(), as_area_share(), copy_from_uspace(), copy_to_uspace(), ddi_iospace_enable(), ddi_physmem_map(), request_preprocess(), sys_cap_grant(), sys_cap_revoke(), sys_preempt_control(), and task_kill().

#define EREFUSED   -4
 

Definition at line 43 of file errno.h.

#define ET_CORE   4
 

Definition at line 54 of file elf.h.

#define ET_DYN   3
 

Definition at line 53 of file elf.h.

#define ET_EXEC   2
 

Definition at line 52 of file elf.h.

Referenced by elf_load().

#define ET_HIPROC   0xffff
 

Definition at line 56 of file elf.h.

#define ET_LOPROC   0xff00
 

Definition at line 55 of file elf.h.

#define ET_NONE   0
 

ELF types

Definition at line 50 of file elf.h.

#define ET_REL   1
 

Definition at line 51 of file elf.h.

#define ETIMEOUT   -12
 

Definition at line 53 of file errno.h.

#define EV_CURRENT   1
 

current ELF version

Definition at line 45 of file elf.h.

Referenced by elf_load().

#define false   0
 

Definition at line 38 of file typedefs.h.

#define fnzb  )     fnzb32(x)
 

Definition at line 65 of file bitops.h.

Referenced by _slab_cache_create(), _zone_merge(), fb_init(), malloc(), zone_conf_size(), zone_construct(), and zone_merge().

#define is_alpha  )     (is_lower(c) || is_upper(c))
 

Definition at line 41 of file macros.h.

#define is_alphanum  )     (is_alpha(c) || is_digit(c))
 

Definition at line 42 of file macros.h.

#define is_digit  )     (((d) >= '0') && ((d)<='9'))
 

Definition at line 38 of file macros.h.

#define is_lower  )     (((c) >= 'a') && ((c) <= 'z'))
 

Definition at line 39 of file macros.h.

Referenced by active_read_key_pressed(), and key_pressed().

#define is_upper  )     (((c) >= 'A') && ((c) <= 'Z'))
 

Definition at line 40 of file macros.h.

#define is_white  )     (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r'))
 

Definition at line 43 of file macros.h.

Referenced by parse_argument().

#define max a,
 )     ((a)>(b)?(a):(b))
 

Definition at line 46 of file macros.h.

Referenced by cmd_register(), and parse_cmdline().

#define MAX_SYMBOL_NAME   64
 

Definition at line 40 of file symtab.h.

Referenced by cmdtab_compl(), parse_int_arg(), and symtab_compl().

#define min a,
 )     ((a)<(b)?(a):(b))
 

Definition at line 45 of file macros.h.

Referenced by bitmap_clear_range(), bitmap_set_range(), kconsole(), and parse_int_arg().

#define PA_overlaps x,
szx,
y,
szy   )     overlaps(KA2PA(x),szx,KA2PA(y), szy)
 

Definition at line 57 of file macros.h.

Referenced by main_bsp().

#define panic format   )     panic_printf("Kernel panic: " format, ##__VA_ARGS__);
 

Definition at line 41 of file panic.h.

Referenced by _rwlock_read_lock_timeout(), acpi_madt_parse(), arch_pre_mm_init(), as_area_resize(), as_init(), btree_insert(), btree_remove(), clock_counter_init(), cmd_init(), cpu_init(), debugger_init(), exc_init(), exc_undef(), fb_init(), frame_alloc_generic(), gp_fault(), hash_table_create(), hw_map(), kinit(), klog_init(), main_bsp_separated_stack(), nm_fault(), null_interrupt(), page_fault(), phys_page_fault(), pm_init(), scheduler_separated_stack(), slab_cache_destroy(), ss_fault(), timeout_register(), tlb_shootdown_ipi_recv(), trap_virtual_disable_irqs(), trap_virtual_enable_irqs(), trap_virtual_eoi(), and zones_add_zone().

#define PF_R   4
 

Definition at line 187 of file elf.h.

Referenced by load_segment().

#define PF_W   2
 

Definition at line 186 of file elf.h.

Referenced by elf_frame_free(), and load_segment().

#define PF_X   1
 

Program segment attributes.

Definition at line 185 of file elf.h.

Referenced by load_segment().

#define PREEMPTION_DISABLED   THE->preemption_disabled
 

Definition at line 50 of file arch.h.

#define PRINT_NUMBER_BUFFER_SIZE   (64+5)
 

Buffer big enought for 64 bit number printed in base 2, sign, prefix and 0 to terminate string.. (last one is only for better testing end of buffer by zero-filling subroutine)

Definition at line 58 of file printf_core.c.

Referenced by print_number().

#define PT_DYNAMIC   2
 

Definition at line 174 of file elf.h.

Referenced by segment_header().

#define PT_HIPROC   0x7fffffff
 

Definition at line 180 of file elf.h.

Referenced by segment_header().

#define PT_INTERP   3
 

Definition at line 175 of file elf.h.

Referenced by segment_header().

#define PT_LOAD   1
 

Definition at line 173 of file elf.h.

Referenced by segment_header().

#define PT_LOPROC   0x70000000
 

Definition at line 179 of file elf.h.

Referenced by segment_header().

#define PT_NOTE   4
 

Definition at line 176 of file elf.h.

Referenced by segment_header().

#define PT_NULL   0
 

Program segment types

Definition at line 172 of file elf.h.

Referenced by segment_header().

#define PT_PHDR   6
 

Definition at line 178 of file elf.h.

Referenced by segment_header().

#define PT_SHLIB   5
 

Definition at line 177 of file elf.h.

Referenced by segment_header().

#define SHF_ALLOC   0x2
 

Definition at line 145 of file elf.h.

#define SHF_EXECINSTR   0x4
 

Definition at line 146 of file elf.h.

#define SHF_MASKPROC   0xf0000000
 

Definition at line 147 of file elf.h.

#define SHF_WRITE   0x1
 

ELF section flags

Definition at line 144 of file elf.h.

#define SHT_DYNAMIC   6
 

Definition at line 128 of file elf.h.

#define SHT_DYNSYM   11
 

Definition at line 133 of file elf.h.

#define SHT_HASH   5
 

Definition at line 127 of file elf.h.

#define SHT_HIOS   0x6fffffff
 

Definition at line 135 of file elf.h.

#define SHT_HIPROC   0x7fffffff
 

Definition at line 137 of file elf.h.

#define SHT_HIUSER   0xffffffff
 

Definition at line 139 of file elf.h.

#define SHT_LOOS   0x60000000
 

Definition at line 134 of file elf.h.

#define SHT_LOPROC   0x70000000
 

Definition at line 136 of file elf.h.

#define SHT_LOUSER   0x80000000
 

Definition at line 138 of file elf.h.

#define SHT_NOBITS   8
 

Definition at line 130 of file elf.h.

#define SHT_NOTE   7
 

Definition at line 129 of file elf.h.

#define SHT_NULL   0
 

ELF section types

Definition at line 122 of file elf.h.

#define SHT_PROGBITS   1
 

Definition at line 123 of file elf.h.

#define SHT_REL   9
 

Definition at line 131 of file elf.h.

#define SHT_RELA   4
 

Definition at line 126 of file elf.h.

#define SHT_SHLIB   10
 

Definition at line 132 of file elf.h.

#define SHT_STRTAB   3
 

Definition at line 125 of file elf.h.

#define SHT_SYMTAB   2
 

Definition at line 124 of file elf.h.

#define STACK_SIZE   PAGE_SIZE
 

Definition at line 42 of file config.h.

Referenced by get_stack_base().

#define STB_GLOBAL   1
 

Definition at line 153 of file elf.h.

#define STB_HIPROC   15
 

Definition at line 156 of file elf.h.

#define STB_LOCAL   0
 

Symbol binding

Definition at line 152 of file elf.h.

#define STB_LOPROC   13
 

Definition at line 155 of file elf.h.

#define STB_WEAK   2
 

Definition at line 154 of file elf.h.

#define STT_FILE   4
 

Definition at line 165 of file elf.h.

#define STT_FUNC   2
 

Definition at line 163 of file elf.h.

#define STT_HIPROC   15
 

Definition at line 167 of file elf.h.

#define STT_LOPROC   13
 

Definition at line 166 of file elf.h.

#define STT_NOTYPE   0
 

Symbol types

Definition at line 161 of file elf.h.

#define STT_OBJECT   1
 

Definition at line 162 of file elf.h.

#define STT_SECTION   3
 

Definition at line 164 of file elf.h.

#define SYSINFO_SUBINFO_FUNCTION   2
 

Definition at line 69 of file sysinfo.h.

#define SYSINFO_SUBINFO_NONE   0
 

Definition at line 67 of file sysinfo.h.

Referenced by sysinfo_create_path(), and sysinfo_dump().

#define SYSINFO_SUBINFO_TABLE   1
 

Definition at line 68 of file sysinfo.h.

Referenced by sysinfo_create_path(), sysinfo_dump(), and sysinfo_find_item().

#define SYSINFO_VAL_FUNCTION   1
 

Definition at line 64 of file sysinfo.h.

Referenced by sysinfo_dump(), and sysinfo_set_item_function().

#define SYSINFO_VAL_UNDEFINED   '?'
 

Definition at line 65 of file sysinfo.h.

Referenced by sysinfo_create_path(), sysinfo_dump(), sysinfo_get_val(), and sysinfo_set_item_undefined().

#define SYSINFO_VAL_VAL   0
 

Definition at line 63 of file sysinfo.h.

Referenced by sysinfo_dump(), sysinfo_get_val(), and sysinfo_set_item_val().

#define TASK   THE->task
 

Definition at line 48 of file arch.h.

Referenced by _ipc_call_init(), answer_preprocess(), check_call_limit(), ddi_iospace_enable(), ddi_physmem_map(), futex_cleanup(), futex_find(), get_call(), gp_fault(), io_perm_bitmap_install(), ipc_answerbox_init(), ipc_cleanup(), kinit(), ktaskclnp(), ktaskgc(), phone_alloc(), phone_connect(), phone_dealloc(), request_preprocess(), scheduler_separated_stack(), sys_cap_grant(), sys_cap_revoke(), sys_ipc_answer(), sys_ipc_answer_fast(), sys_ipc_forward_fast(), sys_ipc_register_irq(), sys_ipc_unregister_irq(), sys_ipc_wait_for_call(), sys_preempt_control(), sys_task_get_id(), sys_thread_create(), syscall_handler(), task_destroy(), and task_init().

#define THE   ((the_t *)(get_stack_base()))
 

Definition at line 65 of file arch.h.

Referenced by main_ap(), main_bsp_separated_stack(), preemption_disable(), preemption_enable(), scheduler(), and scheduler_separated_stack().

#define THREAD   THE->thread
 

Definition at line 47 of file arch.h.

Referenced by _rwlock_read_lock_timeout(), _rwlock_write_lock_timeout(), as_page_fault(), before_thread_runs(), before_thread_runs_arch(), copy_from_uspace(), copy_to_uspace(), cushion(), exc_dispatch(), kcpulb(), kinit(), ktaskclnp(), scheduler(), scheduler_separated_stack(), sys_tls_set(), syscall_handler(), thread_exit(), thread_init(), thread_join_timeout(), thread_register_call_me(), waitq_sleep_prepare(), and waitq_sleep_timeout_unsafe().

#define true   1
 

Definition at line 39 of file typedefs.h.

#define va_arg ap,
type   )     __builtin_va_arg(ap, type)
 

Definition at line 47 of file stdarg.h.

#define va_arg ap,
type   )     (*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type))))
 

Definition at line 55 of file stackarg.h.

Referenced by printf_core().

#define va_copy dst,
src   )     __builtin_va_copy(dst,src)
 

Definition at line 49 of file stdarg.h.

#define va_copy dst,
src   )     dst=src
 

Definition at line 58 of file stackarg.h.

Referenced by klog_vprintf().

#define va_end ap   )     __builtin_va_end(ap)
 

Definition at line 48 of file stdarg.h.

#define va_end ap   ) 
 

Definition at line 59 of file stackarg.h.

Referenced by klog_printf(), klog_vprintf(), printf(), snprintf(), and sprintf().

#define va_start ap,
last   )     __builtin_va_start(ap, last)
 

Definition at line 46 of file stdarg.h.

#define va_start ap,
lst   ) 
 

Value:

(ap).pos = sizeof(lst);                         \
        (ap).last = (__u8 *) &(lst)

Definition at line 51 of file stackarg.h.

Referenced by klog_printf(), printf(), snprintf(), and sprintf().


Typedef Documentation

typedef struct as_area as_area_t
 

Definition at line 75 of file typedefs.h.

typedef struct as as_t
 

Definition at line 76 of file typedefs.h.

typedef struct atomic atomic_t
 

typedef short bool
 

Definition at line 41 of file typedefs.h.

typedef struct btree_node btree_node_t
 

Definition at line 94 of file typedefs.h.

typedef struct btree btree_t
 

Definition at line 95 of file typedefs.h.

typedef struct buddy_system_operations buddy_system_operations_t
 

Definition at line 73 of file typedefs.h.

typedef struct buddy_system buddy_system_t
 

Definition at line 72 of file typedefs.h.

typedef __u32 cap_t
 

Definition at line 82 of file cap.h.

typedef struct chardev chardev_t
 

Definition at line 82 of file typedefs.h.

typedef struct cmd_arg cmd_arg_t
 

Definition at line 85 of file typedefs.h.

typedef enum cmd_arg_type cmd_arg_type_t
 

Definition at line 84 of file typedefs.h.

typedef struct cmd_info cmd_info_t
 

Definition at line 86 of file typedefs.h.

typedef struct condvar condvar_t
 

Definition at line 68 of file typedefs.h.

typedef struct context context_t
 

Definition at line 56 of file typedefs.h.

typedef unsigned long count_t
 

Definition at line 44 of file typedefs.h.

typedef struct cpu_arch cpu_arch_t
 

Definition at line 52 of file typedefs.h.

typedef struct cpu_info cpu_info_t
 

Definition at line 49 of file typedefs.h.

typedef struct cpu cpu_t
 

Definition at line 51 of file typedefs.h.

typedef __u32 elf32_addr
 

32-bit ELF data types.

These types are specific for 32-bit format.

Definition at line 207 of file elf.h.

typedef __u32 elf32_off
 

Definition at line 208 of file elf.h.

typedef __u64 elf64_addr
 

64-bit ELF data types.

These types are specific for 64-bit format.

Definition at line 215 of file elf.h.

typedef __u64 elf64_off
 

Definition at line 216 of file elf.h.

typedef __u16 elf_half
 

Definition at line 200 of file elf.h.

typedef __s32 elf_sword
 

Definition at line 199 of file elf.h.

typedef __s64 elf_sxword
 

Definition at line 197 of file elf.h.

typedef __u32 elf_word
 

Definition at line 198 of file elf.h.

typedef __u64 elf_xword
 

ELF data types

These types are found to be identical in both 32-bit and 64-bit ELF object file specifications. They are the only types used in ELF header.

Definition at line 196 of file elf.h.

typedef struct fpu_context fpu_context_t
 

Definition at line 57 of file typedefs.h.

typedef struct futex futex_t
 

Definition at line 70 of file typedefs.h.

typedef struct hash_table_operations hash_table_operations_t
 

Definition at line 92 of file typedefs.h.

typedef struct hash_table hash_table_t
 

Definition at line 91 of file typedefs.h.

typedef unsigned long index_t
 

Definition at line 45 of file typedefs.h.

typedef void(* iroutine)(int n, istate_t *istate)
 

Definition at line 89 of file typedefs.h.

typedef struct istate istate_t
 

Definition at line 88 of file typedefs.h.

typedef struct link link_t
 

Definition at line 78 of file typedefs.h.

typedef struct mutex mutex_t
 

Definition at line 64 of file typedefs.h.

typedef struct runq runq_t
 

Definition at line 61 of file typedefs.h.

typedef struct rwlock rwlock_t
 

Definition at line 66 of file typedefs.h.

typedef enum rwlock_type rwlock_type_t
 

Definition at line 67 of file typedefs.h.

typedef struct semaphore semaphore_t
 

Definition at line 65 of file typedefs.h.

typedef unsigned long size_t
 

Definition at line 43 of file typedefs.h.

typedef struct spinlock spinlock_t
 

Definition at line 63 of file typedefs.h.

typedef enum state state_t
 

Definition at line 54 of file typedefs.h.

typedef struct sysinfo_item sysinfo_item_t
 

typedef union sysinfo_item_val sysinfo_item_val_t
 

typedef struct sysinfo_rettype sysinfo_rettype_t
 

typedef __native(* sysinfo_subinfo_fn_t)(const char *subname)
 

Definition at line 73 of file sysinfo.h.

typedef __native(* sysinfo_val_fn_t)(sysinfo_item_t *root)
 

Definition at line 72 of file sysinfo.h.

typedef unsigned long long task_id_t
 

Definition at line 47 of file typedefs.h.

typedef struct task task_t
 

Definition at line 53 of file typedefs.h.

typedef struct the the_t
 

Definition at line 80 of file typedefs.h.

typedef struct thread thread_t
 

Definition at line 55 of file typedefs.h.

typedef struct timeout timeout_t
 

Definition at line 59 of file typedefs.h.

typedef __builtin_va_list va_list
 

Definition at line 44 of file stdarg.h.

typedef struct waitq waitq_t
 

Definition at line 69 of file typedefs.h.


Enumeration Type Documentation

enum qualifier_t
 

Enumeration of possible arguments types.

Enumerator:
PrintfQualifierByte 
PrintfQualifierShort 
PrintfQualifierInt 
PrintfQualifierLong 
PrintfQualifierLongLong 
PrintfQualifierNative 
PrintfQualifierPointer 

Definition at line 65 of file printf_core.c.

enum syscall_t
 

Enumerator:
SYS_IO 
SYS_TLS_SET 
SYS_THREAD_CREATE 
SYS_THREAD_EXIT 
SYS_TASK_GET_ID 
SYS_FUTEX_SLEEP 
SYS_FUTEX_WAKEUP 
SYS_AS_AREA_CREATE 
SYS_AS_AREA_RESIZE 
SYS_AS_AREA_DESTROY 
SYS_IPC_CALL_SYNC_FAST 
SYS_IPC_CALL_SYNC 
SYS_IPC_CALL_ASYNC_FAST 
SYS_IPC_CALL_ASYNC 
SYS_IPC_ANSWER_FAST 
SYS_IPC_ANSWER 
SYS_IPC_FORWARD_FAST 
SYS_IPC_WAIT 
SYS_IPC_HANGUP 
SYS_IPC_REGISTER_IRQ 
SYS_IPC_UNREGISTER_IRQ 
SYS_CAP_GRANT 
SYS_CAP_REVOKE 
SYS_MAP_PHYSMEM 
SYS_IOSPACE_ENABLE 
SYS_PREEMPT_CONTROL 
SYS_SYSINFO_VALID 
SYS_SYSINFO_VALUE 
SYS_DEBUG_ENABLE_CONSOLE 
SYSCALL_END 

Definition at line 38 of file syscall.h.


Function Documentation

int __u16_cmp void *  a,
void *  b
 

Definition at line 192 of file sort.c.

static __u32 __u32_byteorder_swap __u32  n  )  [static]
 

Definition at line 50 of file byteorder.h.

int __u32_cmp void *  a,
void *  b
 

Definition at line 197 of file sort.c.

static __u64 __u64_byteorder_swap __u64  n  )  [static]
 

Definition at line 38 of file byteorder.h.

int __u8_cmp void *  a,
void *  b
 

Definition at line 187 of file sort.c.

void _bubblesort void *  data,
count_t  n,
size_t  e_size,
int(*)(void *a, void *b)  cmp,
void *  slot
 

Bubblesort

Apply generic bubblesort algorithm on supplied data, using pre-allocated buffer.

Parameters:
data Pointer to data to be sorted.
n Number of elements to be sorted.
e_size Size of one element.
cmp Comparator function.
slot Pointer to scratch memory buffer e_size bytes long.

Definition at line 160 of file sort.c.

References memcpy().

Referenced by _qsort(), and bubblesort().

Here is the call graph for this function:

void * _memcpy void *  dst,
const void *  src,
size_t  cnt
 

Copy block of memory

Copy cnt bytes from src address to dst address. The copying is done word-by-word and then byte-by-byte. The source and destination memory areas cannot overlap.

Parameters:
src Origin address to copy from.
dst Origin address to copy to.
cnt Number of bytes to copy.

Definition at line 60 of file memstr.c.

References ALIGN_UP.

void _memsetb __address  dst,
size_t  cnt,
__u8  x
 

Fill block of memory

Fill cnt bytes at dst address with the value x. The filling is done byte-by-byte.

Parameters:
dst Origin address to fill.
cnt Number of bytes to fill.
x Value to fill.

Definition at line 90 of file memstr.c.

void _memsetw __address  dst,
size_t  cnt,
__u16  x
 

Fill block of memory

Fill cnt words at dst address with the value x. The filling is done word-by-word.

Parameters:
dst Origin address to fill.
cnt Number of words to fill.
x Value to fill.

Definition at line 109 of file memstr.c.

void _qsort void *  data,
count_t  n,
size_t  e_size,
int(*)(void *a, void *b)  cmp,
void *  tmp,
void *  pivot
 

Quicksort

Apply generic quicksort algorithm on supplied data, using pre-allocated buffers.

Parameters:
data Pointer to data to be sorted.
n Number of elements to be sorted.
e_size Size of one element.
cmp Comparator function.
tmp Pointer to scratch memory buffer e_size bytes long.
pivot Pointer to scratch memory buffer e_size bytes long.

Definition at line 96 of file sort.c.

References _bubblesort(), and memcpy().

Referenced by qsort().

Here is the call graph for this function:

void arch_post_mm_init void   ) 
 

Definition at line 140 of file amd64.c.

References config, config_t::cpu_active, debugger_init(), syscall_setup_cpu(), vesa_init(), vesa_present(), and zone_merge_all().

Referenced by main_ap(), and main_bsp_separated_stack().

Here is the call graph for this function:

void arch_post_smp_init void   ) 
 

Definition at line 170 of file amd64.c.

References i8042_init().

Here is the call graph for this function:

void arch_pre_main void   ) 
 

void arch_pre_mm_init void   ) 
 

Definition at line 98 of file amd64.c.

References AMD_CPUID_EXTENDED, AMD_EXT_NOEXECUTE, AMD_NXE_FLAG, clean_AM_flag(), clean_IOPL_NT_flags(), config, config_t::cpu_active, cpu_setup_fpu(), cpuid(), cpu_info::cpuid_edx, exc_register(), INTEL_CPUID_STANDARD, INTEL_FXSAVE, INTEL_SSE2, panic, pm_init(), set_efer_flag(), tlb_shootdown_ipi(), and VECTOR_TLB_SHOOTDOWN_IPI.

Referenced by main_ap(), and main_bsp_separated_stack().

Here is the call graph for this function:

void arch_pre_smp_init void   ) 
 

Definition at line 159 of file amd64.c.

References acpi_init(), config, config_t::cpu_active, and memory_print_map().

Referenced by main_bsp_separated_stack().

Here is the call graph for this function:

__native atoi const char *  text  ) 
 

Convert ascii representation to __native

Supports 0x for hexa & 0 for octal notation. Does not check for overflows, does not support negative numbers

Parameters:
text Textual representation of number
Returns:
Converted number or 0 if no valid number ofund

Definition at line 159 of file func.c.

Referenced by cmd_set4(), and parse_int_arg().

static long atomic_get atomic_t val  )  [static]
 

Definition at line 49 of file atomic.h.

References atomic::count.

Referenced by _getc(), _slab_reclaim(), find_best_thread(), halt(), kcpulb(), phone_alloc(), sched_print_list(), scheduler(), scheduler_separated_stack(), slab_print_list(), spinlock_unlock(), task_print_list(), and thread_ready().

static void atomic_set atomic_t val,
long  i
[static]
 

Definition at line 44 of file atomic.h.

References atomic::count.

Referenced by halt(), handle_exception(), ipc_irq_register(), ipc_phone_init(), spinlock_initialize(), spinlock_unlock(), task_create(), and thread_init().

void bubblesort void *  data,
count_t  n,
size_t  e_size,
int(*)(void *a, void *b)  cmp
 

Bubblesort wrapper

This is only a wrapper that takes care of memory allocation for storing the slot element for generic bubblesort algorithm.

Parameters:
data Pointer to data to be sorted.
n Number of elements to be sorted.
e_size Size of one element.
cmp Comparator function.

Definition at line 133 of file sort.c.

References _bubblesort(), EBUFSIZE, free(), and malloc().

Here is the call graph for this function:

void calibrate_delay_loop void   ) 
 

Definition at line 175 of file amd64.c.

Referenced by main_ap(), and main_bsp_separated_stack().

cap_t cap_get task_t t  ) 
 

Get capabilities.

Parameters:
t Task whose capabilities are to be returned.
Returns:
Task's capabilities.

Definition at line 72 of file cap.c.

References task::capabilities, interrupts_disable(), interrupts_restore(), spinlock_lock, and spinlock_unlock().

Referenced by ddi_iospace_enable(), ddi_physmem_map(), sys_cap_grant(), sys_cap_revoke(), sys_ipc_register_irq(), sys_ipc_unregister_irq(), and sys_preempt_control().

Here is the call graph for this function:

void cap_set task_t t,
cap_t  caps
 

Set capabilities.

Parameters:
t Task whose capabilities are to be changed.
caps New set of capabilities.

Definition at line 54 of file cap.c.

References task::capabilities, interrupts_disable(), interrupts_restore(), spinlock_lock, and spinlock_unlock().

Referenced by sys_cap_grant(), and sys_cap_revoke().

Here is the call graph for this function:

static void context_restore context_t c  )  [static]
 

Restore register context.

Restore previously saved register context (including stack pointers) from context structure.

Note that this function does not normally return. Instead, it returns at the same address as the corresponding call to context_save(), the only difference being return value.

Note that content of any local variable defined by the caller of context_save() is undefined after context_restore().

Parameters:
c Context structure.

Definition at line 86 of file context.h.

References context_restore_arch().

Referenced by main_ap(), scheduler(), and scheduler_separated_stack().

Here is the call graph for this function:

void context_restore_arch context_t c  ) 
 

Referenced by context_restore().

int context_save_arch context_t c  ) 
 

int copy_from_uspace void *  dst,
const void *  uspace_src,
size_t  size
 

Copy data from userspace to kernel.

Provisions are made to return value even after page fault.

This function can be called only from syscall.

Parameters:
dst Destination kernel address.
uspace_src Source userspace address.
size Size of the data to be copied.
Returns:
0 on success or error code from errno.h.

Definition at line 61 of file copy.c.

References ASSERT, EPERM, interrupts_disable(), interrupts_restore(), memcpy_from_uspace(), overlaps(), and THREAD.

Referenced by code_from_uspace(), sys_cap_grant(), sys_cap_revoke(), sys_io(), sys_iospace_enable(), sys_ipc_answer(), sys_ipc_call_async(), sys_ipc_call_sync(), sys_sysinfo_valid(), sys_sysinfo_value(), and sys_thread_create().

Here is the call graph for this function:

int copy_to_uspace void *  uspace_dst,
const void *  src,
size_t  size
 

Copy data from kernel to userspace.

Provisions are made to return value even after page fault.

This function can be called only from syscall.

Parameters:
uspace_dst Destination userspace address.
src Source kernel address.
size Size of the data to be copied.
Returns:
0 on success or error code from errno.h.

Definition at line 102 of file copy.c.

References ASSERT, EPERM, interrupts_disable(), interrupts_restore(), memcpy_to_uspace(), overlaps(), and THREAD.

Referenced by sys_task_get_id().

Here is the call graph for this function:

void cpu_arch_init void   ) 
 

Definition at line 124 of file cpu.c.

References CPU, NULL, and tss_p.

void cpu_identify void   ) 
 

Definition at line 131 of file cpu.c.

References AMD_CPUID_EBX, AMD_CPUID_ECX, AMD_CPUID_EDX, CPU, cpuid(), has_cpuid(), info, INTEL_CPUID_EBX, INTEL_CPUID_ECX, INTEL_CPUID_EDX, VendorAMD, VendorIntel, and VendorUnknown.

Here is the call graph for this function:

void cpu_init void   ) 
 

Initialize CPUs

Initialize kernel CPUs support.

Definition at line 59 of file cpu.c.

References config, config_t::cpu_active, config_t::cpu_count, cpus, frame_alloc, FRAME_ATOMIC, FRAME_KA, FRAME_PANIC, list_initialize(), malloc(), memsetb(), panic, PFN2ADDR(), RQ_COUNT, spinlock_initialize(), and STACK_FRAMES.

Referenced by main_ap(), and main_bsp_separated_stack().

Here is the call graph for this function:

void cpu_list void   ) 
 

List all processors.

Definition at line 100 of file cpu.c.

References config, config_t::cpu_count, cpu_print_report(), cpus, and printf().

Referenced by cmd_cpus(), and kinit().

Here is the call graph for this function:

void cpu_print_report cpu_t m  ) 
 

Definition at line 160 of file cpu.c.

References cpu::arch, cpu_arch::family, cpu::frequency_mhz, cpu::id, cpu_arch::model, printf(), cpu_arch::stepping, cpu_arch::vendor, and vendor_str.

Referenced by cpu_list().

Here is the call graph for this function:

char * elf_error int  rc  ) 
 

Print error message according to error code.

Parameters:
rc Return code returned by elf_load().
Returns:
NULL terminated description of error.

Definition at line 120 of file elf.c.

References ASSERT, and error_codes.

int elf_load elf_header_t *  header,
as_t as
 

ELF loader

Parameters:
header Pointer to ELF header in memory
as Created and properly mapped address space
Returns:
EE_OK on success

Definition at line 70 of file elf.c.

References EE_INCOMPATIBLE, EE_INVALID, EE_OK, EE_UNSUPPORTED, EI_CLASS, EI_DATA, EI_MAG0, EI_MAG1, EI_MAG2, EI_MAG3, EI_VERSION, ELF_CLASS, ELF_DATA_ENCODING, ELF_MACHINE, ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, ET_EXEC, EV_CURRENT, and segment_header().

Referenced by task_run_program().

Here is the call graph for this function:

static int fnzb32 __u32  arg  )  [static]
 

Return position of first non-zero bit from left (i.e. [log_2(arg)]).

If number is zero, it returns 0

Definition at line 45 of file bitops.h.

Referenced by fnzb64().

static int fnzb64 __u64  arg  )  [static]
 

Definition at line 57 of file bitops.h.

References fnzb32().

Here is the call graph for this function:

void fpu_context_restore fpu_context_t fctx  ) 
 

Restore FPU (mmx,sse) context using fxrstor instruction

Definition at line 50 of file fpu_context.c.

Referenced by before_thread_runs().

void fpu_context_save fpu_context_t fctx  ) 
 

Save FPU (mmx, sse) context using fxsave instruction

Definition at line 41 of file fpu_context.c.

Referenced by scheduler().

void fpu_disable void   ) 
 

Set the TS flag to 1.

If a thread accesses coprocessor, exception is run, which does a lazy fpu context switch.

Definition at line 100 of file cpu.c.

Referenced by before_thread_runs().

void fpu_enable void   ) 
 

Definition at line 112 of file cpu.c.

Referenced by before_thread_runs().

void fpu_init void   ) 
 

Definition at line 58 of file fpu_context.c.

Referenced by before_thread_runs().

__address get_symbol_addr const char *  name  ) 
 

Return address that corresponds to the entry

Search symbol table, and if there is one match, return it

Parameters:
name Name of the symbol
Returns:
0 - Not found, -1 - Duplicate symbol, other - address of symbol

Definition at line 111 of file symtab.c.

References __u64_le2host, NULL, strlen(), symbol_table, and symtab_search_one().

Referenced by cmd_call0(), cmd_call1(), cmd_call2(), cmd_call3(), cmd_set4(), and parse_int_arg().

Here is the call graph for this function:

char* get_symtab_entry __native  addr  ) 
 

Return entry that seems most likely to correspond to argument.

Return entry that seems most likely to correspond to address passed in the argument.

Parameters:
addr Address.
Returns:
Pointer to respective symbol string on success, NULL otherwise.

Definition at line 53 of file symtab.c.

References __u64_le2host, symtab_entry::address_le, and symbol_table.

Referenced by cmd_call0(), cmd_call1(), cmd_call2(), cmd_call3(), cmd_print_breakpoints(), exc_print_cmd(), handle_exception(), and print_info_errcode().

void halt void   ) 
 

Halt wrapper

Set halt flag and halt the cpu.

Definition at line 54 of file func.c.

References atomic_get(), atomic_set(), CPU, cpu_halt(), haltstate, interrupts_disable(), kconsole(), and printf().

Referenced by cmd_halt(), and scheduler().

Here is the call graph for this function:

int int_cmp void *  a,
void *  b
 

Definition at line 182 of file sort.c.

ipl_t interrupts_disable void   ) 
 

Referenced by _getc(), _rwlock_read_lock_timeout(), _rwlock_write_lock_timeout(), _slab_cache_create(), _slab_free(), answer_preprocess(), as_area_create(), as_area_destroy(), as_area_resize(), as_area_share(), as_destroy(), as_get_size(), as_switch(), breakpoint_add(), breakpoint_del(), cap_get(), cap_set(), copy_from_uspace(), copy_to_uspace(), ddi_iospace_enable(), ddi_physmem_map(), delay(), find_best_thread(), frame_alloc_generic(), frame_free(), frame_reference_add(), halt(), ipc_irq_cleanup(), ipc_irq_register(), ipc_irq_unregister(), ipc_wait_for_call(), kcpulb(), kinit(), ktaskclnp(), ktaskgc(), printf_core(), ptl0_create(), rwlock_read_unlock(), rwlock_write_unlock(), sched_print_list(), scheduler(), semaphore_initialize(), slab_alloc(), slab_cache_destroy(), slab_print_list(), sys_cap_grant(), sys_cap_revoke(), sys_futex_sleep_timeout(), sys_futex_wakeup(), task_create(), task_kill(), task_print_list(), thread_create(), thread_detach(), thread_exit(), thread_join_timeout(), thread_print_list(), thread_ready(), thread_register_call_me(), timeout_register(), timeout_unregister(), userspace(), waitq_interrupt_sleep(), waitq_sleep_prepare(), waitq_wakeup(), zone_merge(), zone_print_list(), zone_print_one(), and zones_add_zone().

ipl_t interrupts_enable void   ) 
 

Referenced by cushion(), and find_best_thread().

ipl_t interrupts_read void   ) 
 

Referenced by thread_create().

void interrupts_restore ipl_t  ipl  ) 
 

Referenced by _getc(), _rwlock_read_lock_timeout(), _rwlock_write_lock_timeout(), _slab_cache_create(), _slab_free(), answer_preprocess(), as_area_create(), as_area_destroy(), as_area_resize(), as_area_share(), as_get_size(), as_switch(), breakpoint_add(), breakpoint_del(), cap_get(), cap_set(), copy_from_uspace(), copy_to_uspace(), ddi_iospace_enable(), ddi_physmem_map(), delay(), frame_alloc_generic(), frame_free(), frame_reference_add(), ipc_irq_cleanup(), ipc_irq_register(), ipc_irq_unregister(), ipc_wait_for_call(), kcpulb(), ktaskclnp(), ktaskgc(), ptl0_create(), rwlock_read_unlock(), rwlock_write_unlock(), scheduler(), semaphore_initialize(), slab_alloc(), slab_cache_destroy(), slab_print_list(), sys_cap_grant(), sys_cap_revoke(), sys_futex_sleep_timeout(), sys_futex_wakeup(), task_create(), task_kill(), thread_create(), thread_detach(), thread_exit(), thread_join_timeout(), thread_ready(), thread_register_call_me(), timeout_register(), timeout_unregister(), waitq_interrupt_sleep(), waitq_sleep_finish(), waitq_sleep_prepare(), waitq_wakeup(), and zone_merge().

void ipi_broadcast int  ipi  ) 
 

Broadcast IPI message

Broadcast IPI message to all CPUs.

Parameters:
ipi Message to broadcast.

Definition at line 55 of file ipi.c.

References config, config_t::cpu_active, config_t::cpu_count, and ipi_broadcast_arch().

Referenced by tlb_shootdown_ipi_send().

Here is the call graph for this function:

void ipi_broadcast_arch int  ipi  ) 
 

Referenced by ipi_broadcast().

static int isdigit int  c  )  [static]
 

Checks c for a digit.

Parameters:
c One character.
Returns:
nonzero if c is from interval '0 to '9'.

Definition at line 82 of file printf_core.c.

Referenced by printf_core().

int load_segment elf_segment_header_t *  entry,
elf_header_t *  elf,
as_t as
[static]
 

Load segment described by program header entry.

Parameters:
entry Program header entry describing segment to be loaded.
elf ELF header.
as Address space into wich the ELF is being loaded.
Returns:
EE_OK on success, error code otherwise.

Definition at line 165 of file elf.c.

References ALIGN_UP, AS_AREA_CACHEABLE, as_area_create(), AS_AREA_EXEC, AS_AREA_READ, AS_AREA_WRITE, EE_INVALID, EE_MEMORY, EE_OK, EE_UNSUPPORTED, elf_backend, PAGE_SIZE, PF_R, PF_W, and PF_X.

Referenced by segment_header().

Here is the call graph for this function:

int memcpy_from_uspace void *  dst,
const void *  uspace_src,
size_t  size
 

Referenced by copy_from_uspace().

int memcpy_to_uspace void *  uspace_dst,
const void *  src,
size_t  size
 

Referenced by copy_to_uspace().

static int overlaps __address  s1,
size_t  sz1,
__address  s2,
size_t  sz2
[static]
 

Return true if the interlvals overlap.

Definition at line 49 of file macros.h.

Referenced by _zone_merge(), as_area_resize(), check_area_conflicts(), copy_from_uspace(), copy_to_uspace(), used_space_insert(), zone_create(), and zones_add_zone().

void panic_printf char *  fmt,
  ...
 

void preemption_disable void   ) 
 

Increment preemption disabled counter.

Definition at line 45 of file preemption.c.

References THE.

Referenced by atomic_lock_arch(), spinlock_trylock(), and sys_preempt_control().

void preemption_enable void   ) 
 

Decrement preemption disabled counter.

Definition at line 52 of file preemption.c.

References ASSERT, and THE.

Referenced by spinlock_trylock(), spinlock_unlock(), and sys_preempt_control().

static int print_char char  c,
int  width,
__u64  flags,
struct printf_spec ps
[static]
 

Print one formatted character

Parameters:
c character to print
width 
flags 
Returns:
number of printed characters, negative value on fail

Definition at line 149 of file printf_core.c.

References __PRINTF_FLAG_LEFTALIGNED, and printf_putchar().

Referenced by printf_core().

Here is the call graph for this function:

static int print_number __u64  num,
int  width,
int  precision,
int  base,
__u64  flags,
struct printf_spec ps
[static]
 

Print number in given base

Print significant digits of a number in given base.

Parameters:
num Number to print.
width 
precision 
base Base to print the number in (should be in range 2 .. 16).
flags output modifiers
Returns:
number of written characters or EOF

Definition at line 239 of file printf_core.c.

References __PRINTF_FLAG_BIGCHARS, __PRINTF_FLAG_LEFTALIGNED, __PRINTF_FLAG_NEGATIVE, __PRINTF_FLAG_PREFIX, __PRINTF_FLAG_SHOWPLUS, __PRINTF_FLAG_SIGNED, __PRINTF_FLAG_SPACESIGN, __PRINTF_FLAG_ZEROPADDED, digits_big, digits_small, PRINT_NUMBER_BUFFER_SIZE, printf_putchar(), and printf_putstr().

Referenced by printf_core().

Here is the call graph for this function:

static int print_string char *  s,
int  width,
int  precision,
__u64  flags,
struct printf_spec ps
[static]
 

Print one string

Parameters:
s string
width 
precision 
flags 
Returns:
number of printed characters or negative value on fail

Definition at line 179 of file printf_core.c.

References __PRINTF_FLAG_LEFTALIGNED, NULL, printf_putchar(), printf_putnchars(), printf_putstr(), and strlen().

Referenced by printf_core().

Here is the call graph for this function:

int printf const char *  fmt,
  ...
 

Definition at line 37 of file printf.c.

References va_end, va_start, and vprintf().

Referenced by _getc(), acpi_madt_parse(), btree_print(), buddy_system_structure_print(), clever_readline(), cmd_add_breakpoint(), cmd_call0(), cmd_call1(), cmd_call2(), cmd_call3(), cmd_continue(), cmd_del_breakpoint(), cmd_desc(), cmd_help(), cmd_print_breakpoints(), cmd_set4(), cmdtab_compl(), configure_via_rsdt(), configure_via_xsdt(), cpu_list(), cpu_print_report(), desc_help(), exc_print_cmd(), fb_init(), halt(), handle_exception(), ipc_print_task(), kconsole(), kcpulb(), madt_intr_src_ovrd_entry(), main_bsp_separated_stack(), memory_print_map(), page_fault(), parse_cmdline(), parse_int_arg(), print_info_errcode(), sched_print_list(), scheduler_separated_stack(), slab_print_list(), symtab_compl(), symtab_print_search(), sysinfo_dump(), task_print_list(), thread_print_list(), version_print(), zone_buddy_print_id(), zone_print_list(), and zones_add_zone().

Here is the call graph for this function:

int printf_core const char *  fmt,
struct printf_spec ps,
va_list  ap
 

Print formatted string.

Print string formatted according to the fmt parameter and variadic arguments. Each formatting directive must have the following form:

% [ FLAGS ] [ WIDTH ] [ .PRECISION ] [ TYPE ] CONVERSION

FLAGS:

  • "#" Force to print prefix. For conversion %o the prefix is 0, for x and %X prefixes are 0x and 0X and for conversion %b the prefix is 0b.

  • "-" Align to left.

  • "+" Print positive sign just as negative.

  • " " If the printed number is positive and "+" flag is not set, print space in place of sign.

  • "0" Print 0 as padding instead of spaces. Zeroes are placed between sign and the rest of the number. This flag is ignored if "-" flag is specified.

WIDTH:

  • Specify minimal width of printed argument. If it is bigger, width is ignored. If width is specified with a "*" character instead of number, width is taken from parameter list. And integer parameter is expected before parameter for processed conversion specification. If this value is negative its absolute value is taken and the "-" flag is set.

PRECISION:

  • Value precision. For numbers it specifies minimum valid numbers. Smaller numbers are printed with leading zeroes. Bigger numbers are not affected. Strings with more than precision characters are cut off. Just as with width, an "*" can be used used instead of a number. An integer value is then expected in parameters. When both width and precision are specified using "*", the first parameter is used for width and the second one for precision.

TYPE:

  • "hh" Signed or unsigned char.
  • "h" Signed or usigned short.
  • "" Signed or usigned int (default value).
  • "l" Signed or usigned long int.
  • "ll" Signed or usigned long long int.
  • "z" __native (non-standard extension).

CONVERSION:

  • % Print percentile character itself.

  • c Print single character.

  • s Print zero terminated string. If a NULL value is passed as value, "(NULL)" is printed instead.

  • P, p Print value of a pointer. Void * value is expected and it is printed in hexadecimal notation with prefix (as with %X or %x for 32bit or %X / %x for 64bit long pointers).

  • b Print value as unsigned binary number. Prefix is not printed by default. (Nonstandard extension.)

  • o Print value as unsigned octal number. Prefix is not printed by default.

  • d,i Print signed decimal number. There is no difference between d and i conversion.

  • u Print unsigned decimal number.

  • X, x Print hexadecimal number with upper- or lower-case. Prefix is not printed by default.

All other characters from fmt except the formatting directives are printed in verbatim.

Parameters:
fmt Formatting NULL terminated string.
Returns:
Number of printed characters or negative value on failure.
< i is index of currently processed char from fmt, j is index to the first not printed nonformating character

< counter of printed characters

< used to store return values from called functions

< base in which will be parameter (numbers only) printed

< argument value

< byte size of integer parameter

TODO: unimplemented qualifiers: t ptrdiff_t - ISO C 99

Definition at line 459 of file printf_core.c.

References __PRINTF_FLAG_BIGCHARS, __PRINTF_FLAG_LEFTALIGNED, __PRINTF_FLAG_NEGATIVE, __PRINTF_FLAG_PREFIX, __PRINTF_FLAG_SHOWPLUS, __PRINTF_FLAG_SIGNED, __PRINTF_FLAG_SPACESIGN, __PRINTF_FLAG_ZEROPADDED, interrupts_disable(), isdigit(), print_char(), print_number(), print_string(), printf_putnchars(), printflock, PrintfQualifierByte, PrintfQualifierInt, PrintfQualifierLong, PrintfQualifierLongLong, PrintfQualifierNative, PrintfQualifierPointer, PrintfQualifierShort, spinlock_lock, and va_arg.

Referenced by vprintf(), and vsnprintf().

Here is the call graph for this function:

static int printf_putchar int  c,
struct printf_spec ps
[static]
 

Print one character to output

Parameters:
c one character
ps output method
Returns:
number of printed characters

Definition at line 136 of file printf_core.c.

References printf_spec::data, and printf_spec::write.

Referenced by print_char(), print_number(), and print_string().

static int printf_putnchars const char *  buf,
size_t  count,
struct printf_spec ps
[static]
 

Print count chars from buffer without adding newline

Parameters:
buf Buffer with size at least count bytes - NULL pointer NOT allowed!
count 
ps output method and its data
Returns:
number of printed characters

Definition at line 108 of file printf_core.c.

References printf_spec::data, and printf_spec::write.

Referenced by print_string(), printf_core(), and printf_putstr().

static int printf_putstr const char *  str,
struct printf_spec ps
[static]
 

Print string without added newline

Parameters:
str string to print
ps write function specification and support data
Returns:
number of printed characters

Definition at line 118 of file printf_core.c.

References count, printf_spec::data, NULL, printf_putnchars(), strlen(), and printf_spec::write.

Referenced by print_number(), and print_string().

Here is the call graph for this function:

void putchar const char  ch  ) 
 

void qsort void *  data,
count_t  n,
size_t  e_size,
int(*)(void *a, void *b)  cmp
 

Quicksort wrapper

This is only a wrapper that takes care of memory allocations for storing the pivot and temporary elements for generic quicksort algorithm.

This function _can_ sleep

Parameters:
data Pointer to data to be sorted.
n Number of elements to be sorted.
e_size Size of one element.
cmp Comparator function.

Definition at line 64 of file sort.c.

References _qsort(), EBUFSIZE, free(), and malloc().

Referenced by acpi_madt_parse().

Here is the call graph for this function:

static int section_header elf_section_header_t *  entry,
elf_header_t *  elf,
as_t as
[static]
 

Process section header.

Parameters:
entry Segment header.
elf ELF header.
as Address space into wich the ELF is being loaded.
Returns:
EE_OK on success, error code otherwise.

Definition at line 214 of file elf.c.

References EE_OK.

static int segment_header elf_segment_header_t *  entry,
elf_header_t *  elf,
as_t as
[static]
 

Process segment header.

Parameters:
entry Segment header.
elf ELF header.
as Address space into wich the ELF is being loaded.
Returns:
EE_OK on success, error code otherwise.

Definition at line 135 of file elf.c.

References EE_OK, EE_UNSUPPORTED, load_segment(), PT_DYNAMIC, PT_HIPROC, PT_INTERP, PT_LOAD, PT_LOPROC, PT_NOTE, PT_NULL, PT_PHDR, and PT_SHLIB.

Referenced by elf_load().

Here is the call graph for this function:

void smp_init void   ) 
 

Referenced by main_bsp_separated_stack().

int snprintf char *  str,
size_t  size,
const char *  fmt,
  ...
 

Definition at line 38 of file snprintf.c.

References va_end, va_start, and vsnprintf().

Here is the call graph for this function:

SPINLOCK_INITIALIZE printflock   ) 
 

printf spinlock

int sprintf char *  str,
const char *  fmt,
  ...
 

Definition at line 37 of file sprintf.c.

References va_end, va_start, and vsprintf().

Here is the call graph for this function:

static __native strlen const char *  str  ) 
 

Compute length of given zero terminated string.

Parameters:
str Pointer to valid string.
Returns:
string length without trailing zero.

Definition at line 89 of file func.c.

Referenced by clever_readline(), cmd_desc(), cmd_register(), cmdtab_compl(), cmdtab_search_one(), get_symbol_addr(), insert_char(), kconsole(), parse_cmdline(), print_string(), printf_putstr(), symtab_compl(), and symtab_search_one().

int strncmp const char *  src,
const char *  dst,
size_t  len
 

Compare two NULL terminated strings

Do a char-by-char comparison of two NULL terminated strings. The strings are considered equal iff they consist of the same characters on the minimum of their lengths and specified maximal length.

Parameters:
src First string to compare.
dst Second string to compare.
len Maximal length for comparison.
Returns:
0 if the strings are equal, -1 if first is smaller, 1 if second smaller.

Definition at line 113 of file func.c.

Referenced by cmd_desc(), cmd_register(), cmdtab_search_one(), kconsole(), and parse_cmdline().

void strncpy char *  dest,
const char *  src,
size_t  len
 

Copy NULL terminated string.

Copy at most 'len' characters from string 'src' to 'dest'. If 'src' is shorter than 'len', '' is inserted behind the last copied character.

Parameters:
src Source string.
dest Destination buffer.
len Size of destination buffer.

Definition at line 141 of file func.c.

Referenced by clever_readline(), cmdtab_compl(), parse_int_arg(), and symtab_compl().

int symtab_compl char *  input  ) 
 

Symtab completion

Parameters:
input - Search string, completes to symbol name
Returns:
- 0 - nothing found, 1 - success, >1 print duplicates

Definition at line 153 of file symtab.c.

References MAX_SYMBOL_NAME, name, printf(), strlen(), strncpy(), symbol_table, and symtab_search_one().

Referenced by clever_readline().

Here is the call graph for this function:

void symtab_print_search const char *  name  ) 
 

Find symbols that match parameter and prints them

Definition at line 132 of file symtab.c.

References __u64_le2host, printf(), symtab_entry::symbol_name, symbol_table, and symtab_search_one().

Referenced by cmd_call0(), cmd_call1(), cmd_call2(), cmd_call3(), cmd_set4(), cmd_symaddr(), and parse_int_arg().

Here is the call graph for this function:

__native sys_cap_grant sysarg64_t uspace_taskid_arg,
cap_t  caps
 

Grant capabilities to a task.

The calling task must have the CAP_CAP capability.

Parameters:
uspace_taskid_arg Userspace structure holding destination task ID.
caps Capabilities to grant.
Returns:
Zero on success or an error code from errno.h.

Definition at line 97 of file cap.c.

References CAP_CAP, cap_get(), cap_set(), copy_from_uspace(), ENOENT, EPERM, interrupts_disable(), interrupts_restore(), spinlock_lock, spinlock_unlock(), TASK, task_find_by_id(), tasks_lock, and sysarg64_t::value.

Here is the call graph for this function:

__native sys_cap_revoke sysarg64_t uspace_taskid_arg,
cap_t  caps
 

Revoke capabilities from a task.

The calling task must have the CAP_CAP capability or the caller must attempt to revoke capabilities from itself.

Parameters:
uspace_taskid_arg Userspace structure holding destination task ID.
caps Capabilities to revoke.
Returns:
Zero on success or an error code from errno.h.

Definition at line 142 of file cap.c.

References CAP_CAP, cap_get(), cap_set(), copy_from_uspace(), ENOENT, EPERM, interrupts_disable(), interrupts_restore(), spinlock_lock, spinlock_unlock(), TASK, task_find_by_id(), tasks_lock, and sysarg64_t::value.

Here is the call graph for this function:

static __native sys_debug_enable_console void   )  [static]
 

Tell kernel to get keyboard/console access again

Definition at line 88 of file syscall.c.

References arch_grab_console().

Here is the call graph for this function:

static __native sys_io int  fd,
const void *  buf,
size_t  count
[static]
 

Print using kernel facility

Some simulators can print only through kernel. Userspace can use this syscall to facilitate it.

Definition at line 61 of file syscall.c.

References copy_from_uspace(), printf_spec::data, ELIMIT, ENOMEM, free(), malloc(), PAGE_SIZE, and putchar().

Here is the call graph for this function:

__native sys_sysinfo_valid __native  ptr,
__native  len
 

Definition at line 281 of file sysinfo.c.

References ASSERT, copy_from_uspace(), free(), malloc(), NULL, sysinfo_get_val(), and sysinfo_rettype::valid.

Here is the call graph for this function:

__native sys_sysinfo_value __native  ptr,
__native  len
 

Definition at line 295 of file sysinfo.c.

References ASSERT, copy_from_uspace(), free(), malloc(), NULL, sysinfo_get_val(), and sysinfo_rettype::val.

Here is the call graph for this function:

__native syscall_handler __native  a1,
__native  a2,
__native  a3,
__native  a4,
__native  id
 

Dispatch system call

Definition at line 95 of file syscall.c.

References klog_printf(), SYSCALL_END, syscall_table, TASK, task_kill(), THREAD, and thread_exit().

Here is the call graph for this function:

static sysinfo_item_t* sysinfo_create_path const char *  name,
sysinfo_item_t **  psubtree
[static]
 

Definition at line 75 of file sysinfo.c.

References ASSERT, malloc(), sysinfo_item::name, sysinfo_item::next, NULL, sysinfo_item::subinfo, sysinfo_item::subinfo_type, SYSINFO_SUBINFO_NONE, SYSINFO_SUBINFO_TABLE, SYSINFO_VAL_UNDEFINED, sysinfo_item::table, and sysinfo_item::val_type.

Referenced by sysinfo_set_item_function(), sysinfo_set_item_undefined(), and sysinfo_set_item_val().

Here is the call graph for this function:

void sysinfo_dump sysinfo_item_t **  root,
int  depth
 

Definition at line 215 of file sysinfo.c.

References _root, sysinfo_item::name, sysinfo_item::next, NULL, printf(), sysinfo_item::subinfo_type, SYSINFO_SUBINFO_NONE, SYSINFO_SUBINFO_TABLE, SYSINFO_VAL_FUNCTION, SYSINFO_VAL_UNDEFINED, SYSINFO_VAL_VAL, sysinfo_item::table, sysinfo_item::val, and sysinfo_item::val_type.

Here is the call graph for this function:

static sysinfo_item_t* sysinfo_find_item const char *  name,
sysinfo_item_t subtree
[static]
 

Definition at line 43 of file sysinfo.c.

References sysinfo_item::name, sysinfo_item::next, NULL, sysinfo_item::subinfo, sysinfo_item::subinfo_type, SYSINFO_SUBINFO_TABLE, and sysinfo_item::table.

Referenced by sysinfo_get_val().

sysinfo_rettype_t sysinfo_get_val const char *  name,
sysinfo_item_t **  root
 

Definition at line 256 of file sysinfo.c.

References _root, NULL, sysinfo_find_item(), SYSINFO_VAL_UNDEFINED, SYSINFO_VAL_VAL, sysinfo_item::val, sysinfo_rettype::val, sysinfo_item::val_type, and sysinfo_rettype::valid.

Referenced by sys_sysinfo_valid(), and sys_sysinfo_value().

Here is the call graph for this function:

void sysinfo_set_item_function const char *  name,
sysinfo_item_t **  root,
sysinfo_val_fn_t  fn
 

Definition at line 185 of file sysinfo.c.

References _root, NULL, sysinfo_create_path(), SYSINFO_VAL_FUNCTION, sysinfo_item::val, and sysinfo_item::val_type.

Here is the call graph for this function:

void sysinfo_set_item_undefined const char *  name,
sysinfo_item_t **  root
 

Definition at line 201 of file sysinfo.c.

References _root, NULL, sysinfo_create_path(), SYSINFO_VAL_UNDEFINED, and sysinfo_item::val_type.

Here is the call graph for this function:

void sysinfo_set_item_val const char *  name,
sysinfo_item_t **  root,
__native  val
 

Definition at line 170 of file sysinfo.c.

References _root, NULL, sysinfo_create_path(), SYSINFO_VAL_VAL, sysinfo_item::val, and sysinfo_item::val_type.

Referenced by clock_counter_init(), fb_init(), and klog_init().

Here is the call graph for this function:

void test void   ) 
 

void the_copy the_t src,
the_t dst
 

Copy THE structure

Copy the source THE structure to the destination THE structure.

Parameters:
src The source THE structure.
dst The destination THE structure.

Definition at line 70 of file the.c.

Referenced by main_ap(), scheduler(), and scheduler_separated_stack().

void the_initialize the_t the  ) 
 

Initialize THE structure

Initialize THE structure passed as argument.

Parameters:
the THE structure to be initialized.

Definition at line 54 of file the.c.

References the::as, the::cpu, NULL, the::preemption_disabled, the::task, and the::thread.

Referenced by main_ap(), main_bsp_separated_stack(), and thread_create().

void userspace uspace_arg_t kernel_uarg  ) 
 

Enter userspace

Change CPU protection level to 3, enter userspace.

Definition at line 48 of file userspace.c.

References gdtselector, interrupts_disable(), PL_USER, THREAD_STACK_SIZE, UDATA_DES, uspace_arg::uspace_entry, uspace_arg::uspace_stack, uspace_arg::uspace_uarg, and UTEXT_DES.

Referenced by uinit().

Here is the call graph for this function:

int vprintf const char *  fmt,
va_list  ap
 

Definition at line 49 of file vprintf.c.

References NULL, printf_core(), and vprintf_write().

Referenced by printf().

Here is the call graph for this function:

int vprintf_write const char *  str,
size_t  count,
void *  unused
 

Definition at line 41 of file vprintf.c.

References putchar().

Referenced by vprintf().

Here is the call graph for this function:

int vsnprintf char *  str,
size_t  size,
const char *  fmt,
va_list  ap
 

Definition at line 90 of file vsnprintf.c.

References printf_spec::data, printf_core(), and vsnprintf_write().

Referenced by klog_vprintf(), snprintf(), and vsprintf().

Here is the call graph for this function:

int vsnprintf_write const char *  str,
size_t  count,
struct vsnprintf_data data
 

Write string to given buffer. Write at most data->size characters including trailing zero. According to C99, snprintf() has to return number of characters that would have been written if enough space had been available. Hence the return value is not number of really printed characters but size of the input string. Number of really used characters is stored in data->len.

Parameters:
str source string to print
count size of source string
data structure with destination string, counter of used space and total string size.
Returns:
number of characters to print (not characters really printed!)

Definition at line 57 of file vsnprintf.c.

References vsnprintf_data::len, memcpy(), vsnprintf_data::size, and vsnprintf_data::string.

Referenced by vsnprintf().

Here is the call graph for this function:

int vsprintf char *  str,
const char *  fmt,
va_list  ap
 

Definition at line 37 of file vsprintf.c.

References vsnprintf().

Referenced by sprintf().

Here is the call graph for this function:


Variable Documentation

sysinfo_item_t* _root = NULL
 

Definition at line 40 of file sysinfo.c.

Referenced by sysinfo_dump(), sysinfo_get_val(), sysinfo_set_item_function(), sysinfo_set_item_undefined(), and sysinfo_set_item_val().

config_t config
 

Global configuration structure.

Definition at line 90 of file main.c.

Referenced by _slab_reclaim(), arch_post_mm_init(), arch_pre_mm_init(), arch_pre_smp_init(), cpu_init(), cpu_list(), frame_init(), ipi_broadcast(), kcpulb(), kinit(), main_ap(), main_bsp(), main_bsp_separated_stack(), make_magcache(), page_arch_init(), pm_init(), sched_print_list(), thread_ready(), tlb_shootdown_start(), and zone_create().

cpu_t* cpus
 

Definition at line 52 of file cpu.c.

Referenced by cpu_init(), cpu_list(), kcpulb(), kinit(), sched_print_list(), and tlb_shootdown_start().

cpu_t* cpus
 

Definition at line 52 of file cpu.c.

Referenced by cpu_init(), cpu_list(), kcpulb(), kinit(), sched_print_list(), and tlb_shootdown_start().

char digits_big[] = "0123456789ABCDEF" [static]
 

Big hexadecimal characters

Definition at line 76 of file printf_core.c.

Referenced by print_number().

char digits_small[] = "0123456789abcdef" [static]
 

Small hexadecimal characters

Definition at line 75 of file printf_core.c.

Referenced by print_number().

char* error_codes[] [static]
 

Initial value:

 {
        "no error",
        "invalid image",
        "address space error",
        "incompatible image",
        "unsupported image type",
        "irrecoverable error"
}

Definition at line 51 of file elf.c.

Referenced by elf_error().

atomic_t haltstate = {0}
 

Halt flag

Definition at line 46 of file func.c.

Referenced by _getc(), halt(), handle_exception(), and scheduler().

atomic_t haltstate
 

Halt flag

Definition at line 46 of file func.c.

Referenced by _getc(), halt(), handle_exception(), and scheduler().

init_t init
 

Initial user-space tasks

Definition at line 95 of file main.c.

Referenced by frame_init(), main_bsp(), main_bsp_separated_stack(), and zone_create().

char memcpy_from_uspace_failover_address
 

Label within memcpy_from_uspace() that contains return -1.

char memcpy_to_uspace_failover_address
 

Label within memcpy_to_uspace() that contains return -1.

spinlock_t printflock
 

Referenced by printf_core().

struct symtab_entry symbol_table[]
 

Referenced by get_symbol_addr(), get_symtab_entry(), symtab_compl(), and symtab_print_search().

syshandler_t syscall_table[SYSCALL_END]
 

Definition at line 114 of file syscall.c.

Referenced by syscall_handler().


Generated on Sun Jun 18 16:37:44 2006 for HelenOS Kernel (amd64) by  doxygen 1.4.6