XINU
Functions
control.c File Reference
#include <xinu.h>
Include dependency graph for control.c:

Go to the source code of this file.

Functions

syscall control (did32 descrp, int32 func, int32 arg1, int32 arg2)
 

Function Documentation

◆ control()

syscall control ( did32  descrp,
int32  func,
int32  arg1,
int32  arg2 
)

Definition at line 9 of file control.c.

References devtab, disable(), dentry::dvcntl, isbaddev, restore(), and SYSERR.

Referenced by net_init(), and shell().

15 {
16  intmask mask; /* Saved interrupt mask */
17  struct dentry *devptr; /* Entry in device switch table */
18  int32 retval; /* Value to return to caller */
19 
20  mask = disable();
21  if (isbaddev(descrp)) {
22  restore(mask);
23  return SYSERR;
24  }
25  devptr = (struct dentry *) &devtab[descrp];
26  retval = (*devptr->dvcntl) (devptr, func, arg1, arg2);
27  restore(mask);
28  return retval;
29 }
devcall(* dvcntl)(struct dentry *, int32, int32, int32)
Definition: conf.h:18
void restore(intmask)
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
Definition: conf.h:6
struct dentry devtab[]
Definition: conf.c:11
uint32 intmask
保存された割り込みマスク
Definition: kernel.h:38
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
#define isbaddev(f)
デバイスIDを検証するマクロ。
Definition: device.h:15
intmask disable(void)
割り込み禁止(intr.Sに定義がある)
Here is the call graph for this function:
Here is the caller graph for this function: