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

Go to the source code of this file.

Functions

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

Function Documentation

◆ write()

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

Definition at line 9 of file write.c.

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

Referenced by arp_in(), arp_resolve(), ip_out(), lfdballoc(), lfdbfree(), lfflush(), lfiballoc(), lfibput(), lfscreate(), 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->dvwrite) (devptr, buffer, count);
26  restore(mask);
27  return retval;
28 }
void restore(intmask)
devcall(* dvwrite)(struct dentry *, void *, uint32)
Definition: conf.h:14
#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: