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

Go to the source code of this file.

Functions

syscall read (did32 descrp, char *buffer, uint32 count)
 

Function Documentation

◆ read()

syscall read ( did32  descrp,
char *  buffer,
uint32  count 
)

Definition at line 9 of file read.c.

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

Referenced by lfdballoc(), lfibget(), lfibput(), lfsckfmt(), lfsetup(), lfsopen(), netin(), shell(), xsh_ls(), and xsh_rdstest().

14 {
15  intmask mask; /* Saved interrupt mask */
16  struct dentry *devptr; /* Entry in device switch table */
17  int32 retval; /* Value to return to caller */
18 
19  mask = disable();
20  if (isbaddev(descrp)) {
21  restore(mask);
22  return SYSERR;
23  }
24  devptr = (struct dentry *) &devtab[descrp];
25  retval = (*devptr->dvread) (devptr, buffer, count);
26  restore(mask);
27  return retval;
28 }
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
devcall(* dvread)(struct dentry *, void *, uint32)
Definition: conf.h:13
intmask disable(void)
割り込み禁止(intr.Sに定義がある)
Here is the call graph for this function:
Here is the caller graph for this function: