XINU
putc.c
Go to the documentation of this file.
1 
5 #include <xinu.h>
6 
18 syscall putc(did32 descrp, char ch)
19 {
20  intmask mask; /* Saved interrupt mask */
21  struct dentry *devptr; /* Entry in device switch table */
22  int32 retval; /* Value to return to caller */
23 
24  mask = disable();
25  if (isbaddev(descrp))
26  {
27  restore(mask);
28  return SYSERR;
29  }
30  devptr = (struct dentry *)&devtab[descrp];
31  retval = (*devptr->dvputc)(devptr, ch);
32  restore(mask);
33  return retval;
34 }
void restore(intmask)
全てのシステムヘッダファイルをインクルードする。
#define SYSERR
処理が失敗した場合
Definition: kernel.h:79
devcall(* dvputc)(struct dentry *, char)
Definition: conf.h:17
Definition: conf.h:6
struct dentry devtab[]
Definition: conf.c:11
uint32 intmask
保存された割り込みマスク
Definition: kernel.h:38
syscall putc(did32 descrp, char ch)
デバイスへ文字1Byteを送信する。
Definition: putc.c:18
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
#define isbaddev(f)
デバイスIDを検証するマクロ。
Definition: device.h:15
int32 did32
デバイスID
Definition: kernel.h:28
int32 syscall
システムコール関数 返り値の型
Definition: kernel.h:47
intmask disable(void)
割り込み禁止(intr.Sに定義がある)