Mercurial > ecos
comparison packages/hal/synth/arch/current/include/hal_io.h @ 1862:d27de7fdbf21
* include/hal_io.h: Add cyg_hal_sys_shmget(), cyg_hal_sys_shmat()
and cyg_hal_sys_shmdt() system calls
* src/synth_syscalls.c: Implementations of cyg_hal_sys_shmget(),
cyg_hal_sys_shmat() and cyg_hal_sys_shmdt(). Moved
cyg_hal_sys_mmap() from the flash driver to here.
| author | asl |
|---|---|
| date | Wed, 15 Dec 2004 14:01:38 +0000 |
| parents | 9a9ce858560e |
| children | e24eba6542a3 |
comparison
equal
deleted
inserted
replaced
| 1861:4a42c095c4fa | 1862:d27de7fdbf21 |
|---|---|
| 475 externC int cyg_hal_sys_execve(const char*, const char* [], const char* []); | 475 externC int cyg_hal_sys_execve(const char*, const char* [], const char* []); |
| 476 externC int cyg_hal_sys_pipe(int []); | 476 externC int cyg_hal_sys_pipe(int []); |
| 477 externC int cyg_hal_sys_close(int); | 477 externC int cyg_hal_sys_close(int); |
| 478 externC int cyg_hal_sys_dup2(int, int); | 478 externC int cyg_hal_sys_dup2(int, int); |
| 479 | 479 |
| 480 #define CYG_HAL_SYS_IPCOP_semop 1 | |
| 481 #define CYG_HAL_SYS_IPCOP_semget 2 | |
| 482 #define CYG_HAL_SYS_IPCOP_semctl 3 | |
| 483 #define CYG_HAL_SYS_IPCOP_msgsnd 11 | |
| 484 #define CYG_HAL_SYS_IPCOP_msgrcv 12 | |
| 485 #define CYG_HAL_SYS_IPCOP_msgget 13 | |
| 486 #define CYG_HAL_SYS_IPCOP_msgctl 14 | |
| 487 #define CYG_HAL_SYS_IPCOP_shmat 21 | |
| 488 #define CYG_HAL_SYS_IPCOP_shmdt 22 | |
| 489 #define CYG_HAL_SYS_IPCOP_shmget 23 | |
| 490 #define CYG_HAL_SYS_IPCOP_shmctl 24 | |
| 491 | |
| 492 /*The ipc system call, which is used by the following shmem | |
| 493 functions. These may be unportable*/ | |
| 494 | |
| 495 // Generic system call. Depending on the value of call, it will | |
| 496 // perform the following functions. | |
| 497 externC int cyg_hal_sys_ipc(int call, int first, int second, | |
| 498 int third, void* ptr); | |
| 499 //get an identifier for a shared memory segment | |
| 500 externC int cyg_hal_sys_shmget (int key, int size, int shmflg); | |
| 501 //attach to an shared memory segment | |
| 502 externC void * cyg_hal_sys_shmat (int shmid, const void* shmaddr, | |
| 503 int shmflg); | |
| 504 //detach from it again | |
| 505 externC int cyg_hal_sys_shmdt (const void* shmaddr); | |
| 506 | |
| 480 // The actual implementation appears to return the new brk() value. | 507 // The actual implementation appears to return the new brk() value. |
| 481 externC void* cyg_hal_sys_brk(void*); | 508 externC void* cyg_hal_sys_brk(void*); |
| 482 | 509 |
| 483 // Returns the number of characters placed in the buffer or <0 for error, | 510 // Returns the number of characters placed in the buffer or <0 for error, |
| 484 // not a char*. | 511 // not a char*. |
| 485 externC int cyg_hal_sys_getcwd(char*, int); | 512 externC int cyg_hal_sys_getcwd(char*, int); |
| 486 | 513 |
| 487 // mmap on the "host" system - this may be unportable. | 514 // mmap on the "host" system - this may be unportable. This is the |
| 488 externC int cyg_hal_sys_mmap(struct cyg_hal_sys_mmap_args *); | 515 // really system call into the kernel which passes one structure |
| 516 // containing all the arguments. | |
| 517 externC int cyg_hal_sys_mmapx(struct cyg_hal_sys_mmap_args *); | |
| 518 | |
| 519 // This is the mmap call that users are used to. | |
| 520 externC int cyg_hal_sys_mmap(void *addr, | |
| 521 unsigned long length, | |
| 522 unsigned long prot, | |
| 523 unsigned long flags, | |
| 524 unsigned long fd, | |
| 525 unsigned long off); | |
| 489 | 526 |
| 490 externC int cyg_hal_sys_readdir(unsigned int fd, | 527 externC int cyg_hal_sys_readdir(unsigned int fd, |
| 491 struct cyg_hal_sys_dirent *dp, | 528 struct cyg_hal_sys_dirent *dp, |
| 492 unsigned int count); | 529 unsigned int count); |
| 493 externC int cyg_hal_sys_lstat(const char* name, struct cyg_hal_sys_stat *buf); | 530 externC int cyg_hal_sys_lstat(const char* name, struct cyg_hal_sys_stat *buf); |
