XINU
device
tty
ttywrite.c
Go to the documentation of this file.
1
/* ttywrite.c - ttywrite */
2
3
#include <
xinu.h
>
4
5
/*------------------------------------------------------------------------
6
* ttywrite - Write character(s) to a tty device (interrupts disabled)
7
*------------------------------------------------------------------------
8
*/
9
devcall
ttywrite
(
10
struct
dentry
*devptr,
/* Entry in device switch table */
11
char
*buff,
/* Buffer of characters */
12
int32
count
/* Count of character to write */
13
)
14
{
15
/* Handle negative and zero counts */
16
17
if
(count < 0) {
18
return
SYSERR
;
19
}
else
if
(count == 0){
20
return
OK
;
21
}
22
23
/* Write count characters one at a time */
24
25
for
(; count>0 ; count--) {
26
ttyputc
(devptr, *buff++);
27
}
28
return
OK
;
29
}
xinu.h
全てのシステムヘッダファイルをインクルードする。
SYSERR
#define SYSERR
処理が失敗した場合
Definition:
kernel.h:79
OK
#define OK
処理が成功した場合
Definition:
kernel.h:77
dentry
Definition:
conf.h:6
ttyputc
devcall ttyputc(struct dentry *, char)
Definition:
ttyputc.c:9
int32
int int32
符号あり32ビット整数(int)
Definition:
kernel.h:11
devcall
int32 devcall
デバイスコール関数 返り値の型
Definition:
kernel.h:49
ttywrite
devcall ttywrite(struct dentry *devptr, char *buff, int32 count)
Definition:
ttywrite.c:9
Generated by
1.8.13