UbixOS  2.0
gen_calls.c
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #include <sys/gen_calls.h>
30 #include <sys/thread.h>
31 #include <sys/gdt.h>
32 #include <ubixos/sched.h>
33 #include <ubixos/endtask.h>
34 #include <lib/kprintf.h>
35 #include <lib/kmalloc.h>
36 #include <string.h>
37 #include <assert.h>
38 #include <sys/descrip.h>
39 #include <sys/video.h>
40 #include <sys/signal.h>
41 #include <ubixos/errno.h>
42 #include <vmm/vmm.h>
43 
44 /* Exit Syscall */
45 int sys_exit(struct thread *td, struct sys_exit_args *args) {
46  //kprintf("exit(%i)", args->status);
48  return (0x0);
49 }
50 
51 /* return the process id */
52 int getpid(struct thread *td, struct getpid_args *uap) {
53 #ifdef DEBUG
54  kprintf("[%s:%i]",__FILE__,__LINE__);
55 #endif
56  td->td_retval[0] = _current->id;
57  return (0);
58 }
59 
60 /* return the process user id */
61 int getuid(struct thread *td, struct getuid_args *uap) {
62 #ifdef DEBUG
63  kprintf("[%s:%i]",__FILE__,__LINE__);
64 #endif
65  td->td_retval[0] = _current->uid;
66  return (0);
67 }
68 
69 /* return the process group id */
70 int getgid(struct thread *td, struct getgid_args *uap) {
71 #ifdef DEBUG
72  kprintf("[%s:%i]",__FILE__,__LINE__);
73 #endif
74  td->td_retval[0] = _current->gid;
75  return (0);
76 }
77 
78 int sys_issetugid(register struct thread *td, struct sys_issetugid_args *uap) {
79  td->td_retval[0] = 0;
80  return (0);
81 }
82 
83 int readlink(struct thread *td, struct readlink_args *uap) {
84 #ifdef DEBUG
85  kprintf("[%s:%i]",__FILE__,__LINE__);
86 #endif
87  kprintf("readlink: [%s:%i]\n", uap->path, uap->count);
88  td->td_retval[0] = -1;
89  td->td_retval[1] = 0x0;
90  return (0x0);
91 }
92 
93 int gettimeofday_new(struct thread *td, struct gettimeofday_args *uap) {
94 #ifdef DEBUG
95  kprintf("[%s:%i]",__FILE__,__LINE__);
96 #endif
97  return (0x0);
98 }
99 
100 int read(struct thread *td, struct read_args *uap) {
101  int error = 0x0;
102  size_t count = 0x0;
103  struct file *fd = 0x0;
104 
105 #ifdef DEBUG
106  kprintf("[%s:%i]",__FILE__,__LINE__);
107 #endif
108 
109  error = getfd(td, &fd, uap->fd);
110 
111  if (error)
112  return (error);
113 
114  count = fread(uap->buf, uap->nbyte, 0x1, fd->fd);
115  kprintf("count: %i\n", count);
116  td->td_retval[0] = count;
117 
118  return (error);
119 }
120 
124 int setitimer(struct thread *td, struct setitimer_args *uap) {
125  int error = 0x0;
126 
127  return (error);
128 }
129 
130 int access(struct thread *td, struct access_args *uap) {
131  int error = 0x0;
132  kprintf("name: [%s]\n", uap->path);
133  return (error);
134 }
135 
136 int mprotect(struct thread *td, struct mprotect_args *uap) {
137  int error = 0x0;
138  return (error);
139 }
140 
141 int sys_invalid(struct thread *td, void *args) {
142  kprintf("ISC[%i:%i]", td->frame->tf_eax, _current->id);
143  td->td_retval[0] = -1;
144  return (0);
145 }
146 
147 int sys_wait4(struct thread *td, struct sys_wait4_args *args) {
148  int error = 0;
149 
150  if (args->pid == -1) {
151  if (_current->children <= 0) {
152  td->td_retval[0] = ECHILD;
153  return (-1);
154  }
155 
156  int children = _current->children;
157 
159  while (_current->children == children) {
160  sched_yield();
161  }
162 
163  td->td_retval[0] = _current->last_exit;
164  td->td_retval[1] = 0x8;
165  }
166  else {
167 
168  kTask_t *tmpTask = schedFindTask(args->pid);
169 
170  if (tmpTask != 0x0) {
172  while (tmpTask != 0x0) {
173  sched_yield();
174  tmpTask = schedFindTask(args->pid);
175  }
176  td->td_retval[0] = args->pid;
177  }
178  else {
179  td->td_retval[0] = -1;
180  error = -1;
181  }
182  }
183  return (error);
184 }
185 
186 int sys_sysarch(struct thread *td, struct sys_sysarch_args *args) {
187  void **segbase = 0x0;
188  uint32_t base_addr = 0x0;
189  if (args->op == 10) {
190  //kprintf("SETGSBASE: 0x%X:0x%X", args->parms, args->parms[0]);
191  segbase = args->parms;
192  //kprintf("SGS: [0x%X:0x%X]", segbase[0], segbase[1]);
193  base_addr = (uint32_t) segbase[0];
194  struct gdtDescriptor *tmpDesc = 0x0;
195 
196  tmpDesc = VMM_USER_LDT + sizeof(struct gdtDescriptor); //taskLDT[1];
197 
198  tmpDesc->limitLow = (0xFFFFF & 0xFFFF);
199  tmpDesc->baseLow = (base_addr & 0xFFFF);
200  tmpDesc->baseMed = ((base_addr >> 16) & 0xFF);
201  tmpDesc->access = ((dData + dWrite + dBig + dBiglim + dDpl3) + dPresent) >> 8;
202  tmpDesc->limitHigh = (0xFFFFF >> 16);
203  tmpDesc->granularity = ((dData + dWrite + dBig + dBiglim + dDpl3) & 0xFF) >> 4;
204  tmpDesc->baseHigh = base_addr >> 24;
205 
206  asm(
207  "push %eax\n"
208  "mov $0x18,%ax\n"
209  "lldt %ax\n" /* "lgdtl (loadGDT)\n" */
210  "mov $0xF,%eax\n"
211  "mov %eax,%gs\n"
212  "pop %eax\n"
213  );
214 
215  td->td_retval[0] = 0;
216  }
217  else {
218  kprintf("sysarch(%i,NULL)", args->op);
219  td->td_retval[0] = -1;
220  }
221  return (0);
222 }
223 
224 int sys_getpid(struct thread *td, struct sys_getpid_args *args) {
225  td->td_retval[0] = _current->id;
226  return (0);
227 }
228 int sys_geteuid(struct thread *td, struct sys_geteuid_args *args) {
229  td->td_retval[0] = _current->uid;
230  return (0);
231 }
232 
233 int sys_getegid(struct thread *td, struct sys_getegid_args *args) {
234  td->td_retval[0] = _current->gid;
235  return (0);
236 }
237 
238 int sys_getppid(struct thread *td, struct sys_getppid_args *args) {
239  td->td_retval[0] = _current->ppid;
240  return (0);
241 }
242 
243 int sys_sigprocmask(struct thread *td, struct sys_sigprocmask_args *args) {
244  td->td_retval[0] = -1;
245 
246  if (args->oset != 0x0) {
247  memcpy(args->oset, &td->sigmask, sizeof(sigset_t));
248  td->td_retval[0] = 0x0;
249  }
250 
251  if (args->set != 0x0) {
252  if (args->how == SIG_SETMASK) {
253  if (args->set != 0x0) {
254  memcpy(&td->sigmask, args->set, sizeof(sigset_t));
255  td->td_retval[0] = 0;
256  }
257  else {
258  td->td_retval[0] = -1;
259  }
260  }
261  else if (args->how == SIG_BLOCK) {
262  if (args->set != 0x0) {
263  td->sigmask.__bits[0] &= args->set->__bits[0];
264  td->sigmask.__bits[1] &= args->set->__bits[1];
265  td->sigmask.__bits[2] &= args->set->__bits[2];
266  td->sigmask.__bits[3] &= args->set->__bits[3];
267  td->td_retval[0] = 0;
268  }
269  else {
270  td->td_retval[0] = -1;
271  }
272  }
273  else if (args->how == SIG_UNBLOCK) {
274  if (args->set != 0x0) {
275  td->sigmask.__bits[0] |= args->set->__bits[0];
276  td->sigmask.__bits[1] |= args->set->__bits[1];
277  td->sigmask.__bits[2] |= args->set->__bits[2];
278  td->sigmask.__bits[3] |= args->set->__bits[3];
279  td->td_retval[0] = 0;
280  }
281  else {
282  td->td_retval[0] = -1;
283  }
284  }
285  else {
286  kprintf("SPM: 0x%X", args->how);
287  td->td_retval[0] = -1;
288  }
289  }
290 
291  return (0);
292 }
293 
294 int sys_sigaction(struct thread *td, struct sys_sigaction_args *args) {
295  td->td_retval[0] = -1;
296 
297  if (args->oact != 0x0) {
298  memcpy(args->oact, &td->sigact[args->sig], sizeof(struct sigaction));
299  td->td_retval[0] = 0;
300  }
301 
302  if (args->act != 0x0) {
303  //kprintf("SA: %i", args->sig);
304  memcpy(&td->sigact[args->sig], args->act, sizeof(struct sigaction));
305  td->td_retval[0] = 0;
306  }
307  return (0);
308 }
309 
310 int sys_getpgrp(struct thread *td, struct sys_getpgrp_args *args) {
311  td->td_retval[0] = _current->pgrp;
312  return (0);
313 }
314 
315 int sys_setpgid(struct thread *td, struct sys_setpgid_args *args) {
316  pidType pid = 0x0;
317  pidType pgrp = 0x0;
318 
319  if (args->pid == 0x0 || args->pid == _current->id) {
320  if (args->pgid == 0x0 || args->pgid == _current->id) {
321  td->td_retval[0] = 0x0;
322  _current->pgrp = _current->id;
323  }
324  else {
325  td->td_retval[0] = -1;
326  }
327  }
328  else {
329  kTask_t *tmpTask = schedFindTask(pid);
330 
331  if (tmpTask == 0x0) {
332  td->td_retval[0] = -1;
333  }
334  else {
335 
336  /* Get The PRGP We Want To Set */
337  pgrp = (args->pgid == 0) ? tmpTask->pgrp : args->pgid;
338 
339  if (pgrp != _current->pgrp || pgrp != tmpTask->id) {
340  td->td_retval[0] = -1;
341  }
342  else {
343  td->td_retval[0] = 0x0;
344  tmpTask->pgrp = pgrp;
345  }
346 
347  }
348 
349  }
350 
351  return (0);
352 }
353 
354 int sys_gettimeofday(struct thread *td, struct sys_gettimeofday_args *args) {
355  gettimeofday(args->tp, args->tzp);
356  td->td_retval[0] = 0;
357  return (0);
358 }
359 
360 int sys_getlogin(struct thread *thr, struct sys_getlogin_args *args) {
361  int error = 0;
362 
363  memcpy(args->namebuf, _current->username, args->namelen);
364 
365  return (error);
366 }
367 
368 int sys_setlogin(struct thread *thr, struct sys_setlogin_args *args) {
369  int error = 0;
370 
371  memcpy(_current->username, args->namebuf, 256);
372 
373  return (error);
374 }
375 
376 int sys_getrlimit(struct thread *thr, struct sys_getrlimit_args *args) {
377  int error = 0;
378 
379  struct rlimit *rlim = 0x0;
380 
381  switch (args->which) {
382  case 0:
383  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
384  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
385  break;
386  case 1:
387  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
388  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
389  break;
390  case 2:
391  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
392  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
393  break;
394  case 3:
395  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
396  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
397  break;
398  case 4:
399  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
400  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
401  break;
402  case 5:
403  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
404  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
405  break;
406  case 6:
407  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
408  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
409  break;
410  case 7:
411  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
412  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
413  break;
414  case 8:
415  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
416  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
417  break;
418  case 9:
419  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
420  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
421  break;
422  case 10:
423  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
424  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
425  break;
426  case 11:
427  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
428  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
429  break;
430  case 12:
431  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
432  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
433  break;
434  case 13:
435  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
436  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
437  break;
438  case 14:
439  args->rlp->rlim_cur = thr->rlim[args->which].rlim_cur;
440  args->rlp->rlim_max = thr->rlim[args->which].rlim_max;
441  break;
442  default:
443  error = -1;
444  kprintf("[getrlimit: %i]", args->which);
445  }
446 
447  return (error);
448 }
449 
450 int sys_setrlimit(struct thread *thr, struct sys_setrlimit_args *args) {
451  int error = 0;
452 
453  switch (args->which) {
454  case 0:
455  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
456  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
457  break;
458  case 1:
459  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
460  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
461  break;
462  case 2:
463  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
464  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
465  break;
466  case 3:
467  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
468  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
469  break;
470  case 4:
471  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
472  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
473  break;
474  case 5:
475  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
476  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
477  break;
478  case 6:
479  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
480  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
481  break;
482  case 7:
483  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
484  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
485  break;
486  case 8:
487  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
488  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
489  break;
490  case 9:
491  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
492  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
493  break;
494  case 10:
495  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
496  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
497  break;
498  case 11:
499  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
500  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
501  break;
502  case 12:
503  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
504  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
505  break;
506  case 13:
507  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
508  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
509  break;
510  case 14:
511  thr->rlim[args->which].rlim_cur = args->rlp->rlim_cur;
512  thr->rlim[args->which].rlim_max = args->rlp->rlim_max;
513  break;
514  default:
515  error = -1;
516  kprintf("[setrlimit: %i]", args->which);
517  }
518 
519  return (error);
520 }
read_args::fd
int fd
Definition: sysproto_posix.h:489
sys_setpgid_args::pgid
int pgid
Definition: sysproto_posix.h:583
taskStruct
Definition: sched.h:62
sys_getrlimit_args
Definition: sysproto_posix.h:787
sys_sigprocmask_args::oset
sigset_t * oset
Definition: sysproto_posix.h:559
sys_getpid_args
Definition: sysproto_posix.h:523
sys_gettimeofday_args::tp
struct timeval * tp
Definition: sysproto_posix.h:691
gettimeofday_new
int gettimeofday_new(struct thread *td, struct gettimeofday_args *uap)
Definition: gen_calls.c:93
gdt.h
rlimit::rlim_cur
rlim_t rlim_cur
Definition: resource.h:87
sys_wait4
int sys_wait4(struct thread *td, struct sys_wait4_args *args)
Definition: gen_calls.c:147
sys_sysarch_args
Definition: sysproto_posix.h:514
sys_sysarch_args::op
int op
Definition: sysproto_posix.h:516
sys_exit
int sys_exit(struct thread *td, struct sys_exit_args *args)
Definition: gen_calls.c:45
sys_wait4_args
Definition: sysproto_posix.h:108
sigaction
Definition: signal.h:93
access_args
Definition: sysproto_posix.h:278
dPresent
#define dPresent
Definition: gdt.h:54
sys_getpgrp_args
Definition: sysproto_posix.h:575
access_args::path
char * path
Definition: sysproto_posix.h:280
sys_sigaction_args
Definition: sysproto_posix.h:563
string.h
read_args::buf
void * buf
Definition: sysproto_posix.h:492
sys_getlogin
int sys_getlogin(struct thread *thr, struct sys_getlogin_args *args)
Definition: gen_calls.c:360
video.h
sys_setlogin
int sys_setlogin(struct thread *thr, struct sys_setlogin_args *args)
Definition: gen_calls.c:368
sys_getegid_args
Definition: sysproto_posix.h:547
fread
size_t fread(void *ptr, size_t size, size_t nmemb, fileDescriptor_t *fd)
Definition: file.c:297
SIG_SETMASK
#define SIG_SETMASK
Definition: signal.h:44
file
Definition: descrip.h:67
taskStruct::username
char username[256]
Definition: sched.h:91
thread
Definition: thread.h:40
SIG_BLOCK
#define SIG_BLOCK
Definition: signal.h:42
assert.h
VMM_USER_LDT
#define VMM_USER_LDT
Definition: vmm.h:56
sys_wait4_args::pid
int pid
Definition: sysproto_posix.h:110
vmm.h
thread::sigmask
sigset_t sigmask
Definition: thread.h:49
getgid
int getgid(struct thread *td, struct getgid_args *uap)
Definition: gen_calls.c:70
sys_setlogin_args
Definition: sysproto_posix.h:779
sys_setrlimit_args::rlp
struct rlimit * rlp
Definition: sysproto_posix.h:803
sys_geteuid_args
Definition: sysproto_posix.h:539
thread::sigact
struct sigaction sigact[128]
Definition: thread.h:50
endtask.h
sys_setpgid
int sys_setpgid(struct thread *td, struct sys_setpgid_args *args)
Definition: gen_calls.c:315
rlimit::rlim_max
rlim_t rlim_max
Definition: resource.h:88
taskStruct::ppid
pidType ppid
Definition: sched.h:86
__sigset::__bits
__uint32_t __bits[4]
Definition: _sigset.h:43
sys_getegid
int sys_getegid(struct thread *td, struct sys_getegid_args *args)
Definition: gen_calls.c:233
sys_geteuid
int sys_geteuid(struct thread *td, struct sys_geteuid_args *args)
Definition: gen_calls.c:228
sys_sigaction
int sys_sigaction(struct thread *td, struct sys_sigaction_args *args)
Definition: gen_calls.c:294
sched.h
rlimit
Definition: resource.h:86
sys_sigprocmask
int sys_sigprocmask(struct thread *td, struct sys_sigprocmask_args *args)
Definition: gen_calls.c:243
sys_setlogin_args::namebuf
char * namebuf
Definition: sysproto_posix.h:781
sys_setpgid_args::pid
int pid
Definition: sysproto_posix.h:580
mprotect_args
Definition: sysproto_posix.h:296
sys_gettimeofday
int sys_gettimeofday(struct thread *td, struct sys_gettimeofday_args *args)
Definition: gen_calls.c:354
gdtDescriptor::access
unsigned char access
Definition: gdt.h:70
memcpy
void * memcpy(const void *dst, const void *src, size_t length)
gdtDescriptor::granularity
unsigned int granularity
Definition: gdt.h:72
gen_calls.h
__sigset
Definition: _sigset.h:42
sys_getrlimit_args::rlp
struct rlimit * rlp
Definition: sysproto_posix.h:792
taskStruct::id
pidType id
Definition: sched.h:63
schedFindTask
kTask_t * schedFindTask(uInt32 id)
Definition: sched.c:207
SIG_UNBLOCK
#define SIG_UNBLOCK
Definition: signal.h:43
gdtDescriptor
Definition: gdt.h:66
file::fd
fileDescriptor_t * fd
Definition: descrip.h:71
gettimeofday
int gettimeofday(struct timeval *tp, struct timezone *tzp)
Definition: time.c:110
sys_sigprocmask_args
Definition: sysproto_posix.h:551
readlink
int readlink(struct thread *td, struct readlink_args *uap)
Definition: gen_calls.c:83
thread::td_retval
int td_retval[2]
Definition: thread.h:41
sys_sigaction_args::sig
int sig
Definition: sysproto_posix.h:565
sys_getlogin_args
Definition: sysproto_posix.h:768
trapframe::tf_eax
int tf_eax
Definition: trap.h:46
kprintf.h
dData
#define dData
Definition: gdt.h:42
sys_sigprocmask_args::how
int how
Definition: sysproto_posix.h:553
getfd
int getfd(struct thread *td, struct file **fp, int fd)
get pointer to file fd in specified thread
Definition: descrip.c:213
gettimeofday_args
Definition: sysproto_posix.h:459
uint32_t
__uint32_t uint32_t
Definition: types.h:46
ECHILD
#define ECHILD
Definition: errno.h:41
WAIT
Definition: sched.h:47
sys_sigaction_args::oact
struct sigaction * oact
Definition: sysproto_posix.h:571
mprotect
int mprotect(struct thread *td, struct mprotect_args *uap)
Definition: gen_calls.c:136
setitimer
int setitimer(struct thread *td, struct setitimer_args *uap)
place holder for now functionality to be added later
Definition: gen_calls.c:124
sys_getlogin_args::namebuf
char * namebuf
Definition: sysproto_posix.h:770
thread::rlim
struct rlimit rlim[RLIM_NLIMITS]
Definition: thread.h:51
sys_sigaction_args::act
const struct sigaction * act
Definition: sysproto_posix.h:568
sys_sigprocmask_args::set
const sigset_t * set
Definition: sysproto_posix.h:556
endTask
void endTask(pidType)
Definition: endtask.c:44
thread::frame
struct trapframe * frame
Definition: thread.h:47
_current
kTask_t * _current
Definition: sched.c:50
sched_setStatus
int sched_setStatus(pidType pid, tState state)
Definition: sched.c:265
getpid
int getpid(struct thread *td, struct getpid_args *uap)
Definition: gen_calls.c:52
pidType
int pidType
Definition: types.h:75
sys_sysarch
int sys_sysarch(struct thread *td, struct sys_sysarch_args *args)
Definition: gen_calls.c:186
sys_getppid_args
Definition: sysproto_posix.h:543
sys_sysarch_args::parms
char * parms
Definition: sysproto_posix.h:519
sys_getpgrp
int sys_getpgrp(struct thread *td, struct sys_getpgrp_args *args)
Definition: gen_calls.c:310
sys_gettimeofday_args::tzp
struct timezone * tzp
Definition: sysproto_posix.h:694
taskStruct::uid
uint32_t uid
Definition: sched.h:73
read_args
Definition: sysproto_posix.h:487
gdtDescriptor::baseLow
unsigned short baseLow
Definition: gdt.h:68
access
int access(struct thread *td, struct access_args *uap)
Definition: gen_calls.c:130
taskStruct::pgrp
uint32_t pgrp
Definition: sched.h:87
sys_setrlimit_args::which
u_int which
Definition: sysproto_posix.h:800
read_args::nbyte
size_t nbyte
Definition: sysproto_posix.h:495
sys_setpgid_args
Definition: sysproto_posix.h:578
descrip.h
taskStruct::last_exit
uint32_t last_exit
Definition: sched.h:89
sys_gettimeofday_args
Definition: sysproto_posix.h:689
sys_getrlimit_args::which
u_int which
Definition: sysproto_posix.h:789
gdtDescriptor::baseMed
unsigned char baseMed
Definition: gdt.h:69
sys_setrlimit
int sys_setrlimit(struct thread *thr, struct sys_setrlimit_args *args)
Definition: gen_calls.c:450
gdtDescriptor::baseHigh
unsigned char baseHigh
Definition: gdt.h:73
dBiglim
#define dBiglim
Definition: gdt.h:63
setitimer_args
Definition: sysproto_posix.h:266
sys_getppid
int sys_getppid(struct thread *td, struct sys_getppid_args *args)
Definition: gen_calls.c:238
dBig
#define dBig
Definition: gdt.h:62
taskStruct::children
uint32_t children
Definition: sched.h:88
read
int read(struct thread *td, struct read_args *uap)
Definition: gen_calls.c:100
sys_getlogin_args::namelen
u_int namelen
Definition: sysproto_posix.h:773
sys_getpid
int sys_getpid(struct thread *td, struct sys_getpid_args *args)
Definition: gen_calls.c:224
sys_invalid
int sys_invalid(struct thread *td, void *args)
Definition: gen_calls.c:141
signal.h
sys_issetugid_args
Definition: sysproto_posix.h:334
gdtDescriptor::limitLow
unsigned short limitLow
Definition: gdt.h:67
kprintf
int kprintf(const char *,...)
Definition: kprintf.c:259
errno.h
sys_getrlimit
int sys_getrlimit(struct thread *thr, struct sys_getrlimit_args *args)
Definition: gen_calls.c:376
thread.h
kmalloc.h
getpid_args
Definition: sysproto_posix.h:331
getuid_args
Definition: sysproto_posix.h:365
gdtDescriptor::limitHigh
unsigned int limitHigh
Definition: gdt.h:71
getuid
int getuid(struct thread *td, struct getuid_args *uap)
Definition: gen_calls.c:61
sys_exit_args
Definition: sysproto_posix.h:50
sched_yield
void sched_yield()
Definition: sched.c:244
getgid_args
Definition: sysproto_posix.h:369
sys_setrlimit_args
Definition: sysproto_posix.h:798
dDpl3
#define dDpl3
Definition: gdt.h:50
sys_issetugid
int sys_issetugid(register struct thread *td, struct sys_issetugid_args *uap)
Definition: gen_calls.c:78
taskStruct::gid
uint32_t gid
Definition: sched.h:73
dWrite
#define dWrite
Definition: gdt.h:57