This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
developersguide:kernelapi [2015/01/08 02:06] lazarstricevic [SYS_PHYSCOPY] Corrected link |
developersguide:kernelapi [2016/07/08 13:13] antoineleca Enforce alphabetic order |
||
---|---|---|---|
Line 244: | Line 244: | ||
**library functions**\\ int sys_kill(endpoint_t proc_nr, int sig_nr); | **library functions**\\ int sys_kill(endpoint_t proc_nr, int sig_nr); | ||
+ | |||
+ | |||
+ | |||
+ | ==== SYS_MEMSET ==== | ||
+ | Fill a physical memory area with a constant pattern byte. | ||
+ | |||
+ | <code> | ||
+ | int sys_memset(endpoint_t who, unsigned long pattern, phys_bytes base, phys_bytes bytes); | ||
+ | </code> | ||
+ | |||
+ | The **sys_memset** function sets //length// bytes starting from physical address //base// to the low-order byte of //pattern//. | ||
+ | |||
+ | **Return values**:\\ | ||
+ | OK: Call always succeeds. | ||
+ | |||
+ | **Notes**: \\ | ||
+ | This function is used, for example, to zero the BSS segment on an exec() POSIX-call. The kernel is asked to do the work for performance reasons. | ||
Line 345: | Line 362: | ||
**library functions**\\ int sys_safecopyto(endpoint_t dest, cp_grant_id_t grant, vir_bytes grant_offset, vir_bytes my_address, size_t bytes); | **library functions**\\ int sys_safecopyto(endpoint_t dest, cp_grant_id_t grant, vir_bytes grant_offset, vir_bytes my_address, size_t bytes); | ||
+ | |||
+ | ==== SYS_SAFEMEMSET ==== | ||
+ | Fill a memory grant with a constant pattern byte. | ||
+ | |||
+ | <code> | ||
+ | int sys_safememset(endpoint_t endpt, cp_grant_id_t grant, vir_bytes grant_offset, int pattern, size_t bytes); | ||
+ | </code> | ||
+ | The **sys_safememset** function sets //bytes// bytes from offset //grant_offset// in memory grant //grant// to the low-order byte of //pattern//. | ||
+ | |||
+ | **Return values** (not complete):\\ | ||
+ | OK: //bytes// bytes filled with the pattern byte.\\ | ||
+ | EPERM: Caller has no write permissions (CPF_WRITE) for //grant//. \\ | ||
+ | EPERM: Permission checks for //grant// failed. \\ | ||
+ | |||
+ | **Notes:** \\ | ||
+ | The memory driver uses this function for reads of /dev/zero to set a requestor's buffer to all '\0'. | ||
==== SYS_SDEVIO ==== | ==== SYS_SDEVIO ==== | ||
Line 534: | Line 567: | ||
**library functions**\\ int sys_vtimer(endpoint_t proc_nr, int which, clock_t *newval, clock_t *oldval); | **library functions**\\ int sys_vtimer(endpoint_t proc_nr, int which, clock_t *newval, clock_t *oldval); | ||
- | |||
- | |||
- | |||
- | ==== SYS_MEMSET ==== | ||
- | Fill a physical memory area with a constant pattern byte. | ||
- | |||
- | <code> | ||
- | int sys_memset(endpoint_t who, unsigned long pattern, phys_bytes base, phys_bytes bytes); | ||
- | </code> | ||
- | |||
- | The **sys_memset** function sets //length// bytes starting from physical address //base// to the low-order byte of //pattern//. | ||
- | |||
- | **Return values**:\\ | ||
- | OK: Call always succeeds. | ||
- | |||
- | **Notes**: \\ | ||
- | This function is used, for example, to zero the BSS segment on an exec() POSIX-call. The kernel is asked to do the work for performance reasons. | ||
- | |||
- | |||
- | |||
- | ==== SYS_SAFEMEMSET ==== | ||
- | Fill a memory grant with a constant pattern byte. | ||
- | |||
- | <code> | ||
- | int sys_safememset(endpoint_t endpt, cp_grant_id_t grant, vir_bytes grant_offset, int pattern, size_t bytes); | ||
- | </code> | ||
- | The **sys_safememset** function sets //bytes// bytes from offset //grant_offset// in memory grant //grant// to the low-order byte of //pattern//. | ||
- | |||
- | **Return values** (not complete):\\ | ||
- | OK: //bytes// bytes filled with the pattern byte.\\ | ||
- | EPERM: Caller has no write permissions (CPF_WRITE) for //grant//. \\ | ||
- | EPERM: Permission checks for //grant// failed. \\ | ||
- | |||
- | **Notes:** \\ | ||
- | The memory driver uses this function for reads of /dev/zero to set a requestor's buffer to all '\0'. | ||