Pyro Kernel
|
Functions | |
area_id | sys_clone_area (const char *pzName, void **ppAddress, flags_t nProtection, flags_t nLockMode, area_id hSrcArea) |
Clones the specified area at a new address. More... | |
area_id | sys_create_area (const char *pzName, void **ppAddress, size_t nSize, flags_t nProtection, flags_t nLockMode) |
Creates a new memory area with the specified attributes. More... | |
status_t | sys_delete_area (area_id hArea) |
Deletes the specified area. More... | |
status_t | sys_get_area_info (area_id hArea, AreaInfo_s *psInfo) |
Returns an AreaInfo_s for the specified area. More... | |
status_t | sys_remap_area (area_id hArea, void *pPhysAddress) |
Remaps the specified area to use a different region of physical memory. More... | |
void * | sys_sbrk (int nDelta) |
Adjusts the upper bound of a user process's data segment. More... | |
int | alloc_tld (void) |
Allocates a TLD slot. More... | |
void * | get_tld_addr (int nHandle) |
Gives the address on the stack of the TLD. More... | |
int | free_tld (int nHandle) |
Releases a TLD slot previously allocated with alloc_tld(). More... | |
int | sys_get_raw_system_time (bigtime_t *pRes) |
Returns the time elapsed since last system boot, in microseconds. More... | |
int | sys_get_raw_real_time (bigtime_t *pRes) |
Returns the number of microseconds since 1970-01-01. More... | |
int | sys_get_raw_idle_time (bigtime_t *pRes, int nProcessor) |
Returns the total idle time for the given CPU, in microseconds. More... | |
int | sys_set_real_time (uint32 nTimeLow, uint32 nTimeHigh) |
Sets the system clock to a new time. More... | |
int | sys_aio_worker (void) |
Start the async I/O worker. More... | |
int | sys_aio_request (struct aiocb *psAiocb) |
Queue an async I/O request. More... | |
void | set_tld (int nHandle, int nValue) |
Assign a value to a TLD slot. More... | |
int | get_tld (int nHandle) |
Retrieve the value stored in a TLD. More... | |
int alloc_tld | ( | void | ) |
Allocates a TLD slot.
-1
is returned; "errno" will receive the error code. ENOMEM
All TLD slots are in use. int free_tld | ( | int | nHandle | ) |
Releases a TLD slot previously allocated with alloc_tld().
nHandle | The TLD slot to release. |
0
is returned. On error -1
is returned "errno" will receive the error code.EINVAL
Invalid TLD handle. int get_tld | ( | int | nHandle | ) |
Retrieve the value stored in a TLD.
nHandle | The TLD to examine. |
void* get_tld_addr | ( | int | nHandle | ) |
Gives the address on the stack of the TLD.
nHandle | The TLD to calculate the address for. Deprecated & marked for removal. |
void set_tld | ( | int | nHandle, |
int | nValue | ||
) |
Assign a value to a TLD slot.
nHandle | Handle to a TLD slot previously allocated by alloc_tld() |
nValue | The value to assign to the TLD. |
int sys_aio_request | ( | struct aiocb * | psAiocb | ) |
Queue an async I/O request.
psAiocb | - pointer to a struct aiocb structure. |
int sys_aio_worker | ( | void | ) |
Start the async I/O worker.
area_id sys_clone_area | ( | const char * | pzName, |
void ** | ppAddress, | ||
flags_t | nProtection, | ||
flags_t | nLockMode, | ||
area_id | hSrcArea | ||
) |
Clones the specified area at a new address.
pzName | a pointer to the string containing the name of the new area. |
ppAddress | a pointer to the variable where the start address of the new area will be stored, or NULL . If non- NULL , the previous value of the variable it points to will be used as the preferred start address of the new area. |
nProtection | a protection bitmask containing any combination of: AREA_READ , AREA_WRITE , AREA_EXEC , AREA_KERNEL , and AREA_WRCOMB . |
nLockMode | the locking mode to use: AREA_NO_LOCK , AREA_LAZY_LOCK , AREA_FULL_LOCK , or AREA_CONTIGUOUS . |
hSrcArea | the area_id of the area to clone. |
-EFAULT
if there is a memory access violation while copying pzName; -EINVAL
if the preferred starting address at *ppAddress is not a multiple of PAGE_SIZE
; the area_id
of the new area otherwise. area_id sys_create_area | ( | const char * | pzName, |
void ** | ppAddress, | ||
size_t | nSize, | ||
flags_t | nProtection, | ||
flags_t | nLockMode | ||
) |
Creates a new memory area with the specified attributes.
pzName | a pointer to the string containing the name for the new area. |
ppAddress | a pointer to the variable where the start address of the new area will be stored, or NULL . If non- NULL , the previous value of the variable it points to will be used as the preferred start address of the new area. |
nSize | the size in bytes of the requested area. |
nProtection | a protection bitmask containing any combination of AREA_READ , AREA_WRITE , AREA_EXEC , AREA_KERNEL , and AREA_WRCOMB . |
nLockMode | the locking mode to use: AREA_NO_LOCK , AREA_LAZY_LOCK , AREA_FULL_LOCK , or AREA_CONTIGUOUS . |
-EFAULT
if there is a memory access violation while copying pzName; -EINVAL
if the preferred start address at *ppAddress is not a multiple of PAGE_SIZE
; -ENOADDRSPC
if there isn't enough virtual address space, -ENOMEM
if there isn't enough physical memory; the area_id
of the new area otherwise. status_t sys_delete_area | ( | area_id | hArea | ) |
Deletes the specified area.
hArea | a handle to the area to delete. |
-EINVAL
if the area handle is invalid or if the area doesn't belong to this process; 0
otherwise. status_t sys_get_area_info | ( | area_id | hArea, |
AreaInfo_s * | psInfo | ||
) |
Returns an AreaInfo_s
for the specified area.
hArea | a handle to the area for which to return info. |
psInfo | a pointer to the AreaInfo_s in which to store the results. |
-EINVAL
if the area handle is invalid or the area doesn't belong to this process; -EFAULT
if there is a memory access violation while copying to psInfo; 0
otherwise. int sys_get_raw_idle_time | ( | bigtime_t * | pRes, |
int | nProcessor | ||
) |
Returns the total idle time for the given CPU, in microseconds.
pRes | a pointer to the bigtime_t in which to store the CPU idle time. |
nProcessor | the processor for which to return the idle time. |
int sys_get_raw_real_time | ( | bigtime_t * | pRes | ) |
Returns the number of microseconds since 1970-01-01.
pRes | a pointer to the bigtime_t in which to store the current time. |
int sys_get_raw_system_time | ( | bigtime_t * | pRes | ) |
Returns the time elapsed since last system boot, in microseconds.
pRes | a pointer to the bigtime_t in which to store the system time. |
status_t sys_remap_area | ( | area_id | hArea, |
void * | pPhysAddress | ||
) |
Remaps the specified area to use a different region of physical memory.
hArea | a handle to the area to remap. |
pPhysAddress | the new start address in physical memory for the region. |
-EINVAL
if the area handle is invalid or if nPhysAddress isn't a multiple of PAGE_SIZE
; 0
otherwise. void* sys_sbrk | ( | int | nDelta | ) |
Adjusts the upper bound of a user process's data segment.
nDelta | the number of bytes by which to increase or decrease the data segment. |
-1
if there was an error adjusting the data segment; otherwise, the old upper bound of the process's data segment. int sys_set_real_time | ( | uint32 | nTimeLow, |
uint32 | nTimeHigh | ||
) |
Sets the system clock to a new time.
Does not set the RTC.
nTimeLow | the low 32 bits of the new system time, in microseconds since 1970-01-01. |
nTimeHigh | the high 32 bits of the new system time |