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C%H;XDj(B "a" $B!A(B
- # :
- $B%5%V%f%K%C%HHV9f(B "0" $B!A(B
hd* | $B%O!<%I%G%#%9%/(B($B%f%K%C%H(B) |
hd*# | $B%O!<%I%G%#%9%/(B($B%Q!<%F%#%7%g%s(B) |
fd* | $B%U%m%C%T!<%G%#%9%/(B |
rs* | RS-232C |
kbpd | $B%-!<%\!<%I(B / $B%]%$%s%F%#%s%0%G%P%$%9(B |
$B%G%P%$%9%I%i%$%P$O=i4|5/F0;~$K<+J,$G%5%]!<%H$9$k%G%P%$%9$r>e0L$N%G%P%$%94IM}$KBP$7$F%f%K%C%HKh$KEPO?$9$k!#(B
$BEPO?;~$K%G%P%$%9$r;XDj$9$k%G%P%$%9(B ID $B$,La$5$l$k!#(B
$B%G%P%$%9$NEPO?$O!"0J2<$N4X?t$G9T$&!#4X?tCM$O%G%P%$%9(B ID$B!#(B
ID DefDevice(DevDef *devdef, DiskInfo *info)
/* $B%G%P%$%9B0@-(B */
typedef struct {
UW devinfo:8; /* $B%G%P%$%9>\:Y>pJs(B */
UW devkind:8; /* $B%G%P%$%9(B/$B%a%G%#%"
devinfo :
- $B%G%P%$%9$N>\:Y>pJs$r<($9CM$G!"%G%P%$%9$K0MB8$9$k!#(B
$BDL>o$O%G%P%$%9$rJ*M}E*$K<1JL$9$k$?$a$N0LCV>pJs$,F~$k!#(B
devkind :
- $Be0L(B 4 $B%S%C%H$O4pK\\:Y
$B%G%#%9%/%?%$%W$N%G%P%$%9$KBP$7$F$O0J2<$,Dj5A$5$l$F$$$k!#(B
$B%G%#%9%/0J30$K4X$7$F$OL$Dj5A(B ( BTRON3 $B;EMM=q(B
$B!VBh(B2$BJT(B OS $B;EMM(B 1.8 $B%G%P%$%94IM}!W$r;2>H(B )$B!#(B
#define DK_UNDEF 0x00 /* $BL$Dj5A(B/$BITL@(B */
#define DK_DISK 0x10 /* $B%G%#%9%/%?%$%W(B */
#define DK_DISK_UNDEF 0x10 /* $B$=$NB>$N%G%#%9%/(B */
#define DK_DISK_RAM 0x11 /* RAM $B%G%#%9%/(B */
#define DK_DISK_ROM 0x12 /* ROM $B%G%#%9%/(B */
#define DK_DISK_FLA 0x13 /* FLASH ROM / SS $B%G%#%9%/(B*/
#define DK_DISK_FD 0x14 /* $B%U%m%C%T!<%G%#%9%/(B */
#define DK_DISK_HD 0x15 /* $B%O!<%I%G%#%9%/(B */
#define DK_DISK_CDROM 0x16 /* CD-ROM */
openreq :
- $BKh2s%*!<%W%s(B / $B%/%m!<%:MW5a$,I,MW$J>l9g$O(B 1$B!"$=$&$G$J$$$H$-$O(B 0
$BMW5a$4$H$K=hM}$,407k$7$J$$$?$a!"(B
$B%*!<%W%s(B / $B%/%m!<%:$5$l$?>pJs$rI,MW$H$9$k>l9g$K;XDj$9$k!#(B
lockreq :
- $B%"%I%l%96u4V$N%m%C%/(B ( $B>oCs2=(B ) $B$,I,MW$J>l9g$O(B 1$B!"$=$&$G$J$$$H$-$O(B 0
$B%m%C%/MW5a$H$7$?>l9g$O%G%P%$%94IM}B&$G%f!<%6%"%I%l%96u4V$N%m%C%/(B
/ $B%"%s%m%C%/=hM}$r9T$&$?$a!"(B
$B%I%i%$%PB&$O>o$K%m%C%/$5$l$F$$$k$3$H$rA0Ds$H$7$F=hM}$9$k$3$H$,$G$-$k!#(B
diskinfo :
DN_DISKINO
$B$r%5%]!<%H$7$F$$$k>l9g$O(B 1$B!"$=$&$G$J$$$H$-$O(B 0
$B%G%#%9%/%I%i%$%P0J30$OL$%5%]!<%H$H$9$k!#(B
1 $B$H$7$?>l9g$O!"(B
info
$B$K%G%#%9%/>pJs$r@_Dj$9$k!#(B0 $B$N>l9g$K$O(B info
$B$O(B NULL
$B$H$9$k(B
( DiskInfo
$B$N>\:Y$O8e=R(B ) $B!#(B
chardev :
- $BJ8;z7?%G%P%$%9$N>l9g$O(B 1$B!"$=$&$G$J$$$H$-$O(B 0
$B$3$N>pJs$O%G%P%$%94IM}B&$G%G%P%$%9$N>pJs$H$7$F(B
$B%"%W%j%1!<%7%g%sB&$KEO$9$?$a$K;HMQ$5$l!"F0:n$K$O1F6A$7$J$$!#(B
nowait :
-
NOWAIT $B%b!<%I$,E,MQ$5$l$k>l9g$O(B 1$B!"$=$&$G$J$$$H$-$O(B 0
NOWAIT $B%b!<%I$O!"HsF14|=hM}$r0UL#$9$k$N$G$O$J$/!"(B
$B%G%P%$%9$,%S%8!<>uBV$N;~$KBT$D$+!"(B
$BBT$?$J$$$+$r0UL#$9$k$b$N$G!"(B
$BBT$?$J$$>l9g$G$b=hM}<+BN$O40N;$9$k(B ( $B%]!<%j%s%0=hM}(B ) $B!#(B
$B30It>u67$K0MB8$7$?D9;~4V$N%S%8!<>uBV$,$"$kJ8;z7?%G%P%$%9$KBP$7$F$N$_E,MQ$5$l$k!#(B
eject :
- $B%$%8%'%/%H2DG=$J;~$O(B 1$B!"$=$&$G$J$$;~$O(B 0
/* $B%G%P%$%9EPO?(B */
#define L_DEVNM 8 /* $B%G%P%$%9L>$ND9$5(B */
typedef struct {
DevAttr attr; /* $B%G%P%$%9B0@-(B */
W subunits: /* $B%5%V%f%K%C%H?t(B */
TC name[L_DEVNM]; /* $BEPO?$9$k%G%P%$%9L>(B */
ID portid; /* $B
attr :
- $BEPO?$9$k%G%P%$%9$NB0@-!#(B
subunits :
- $BEPO?$9$k%5%V%f%K%C%H?t!#(B0 $B$O%5%V%f%K%C%H$,B8:_$7$J$$$3$H$r0UL#$9$k!#(B
name[] :
- $B%G%P%$%9L>(B ( $B%f%K%C%HL>(B ) $B!#(B
hda
$B!"(Bfda
$B$J$I!#(B
portid :
- $BMW5a
$B%5%V%f%K%C%H?t!"EPO?$5$l$k%G%P%$%9L>!"(B
$B%G%P%$%9(B ID $B$N4XO"$O0J2<$NDL$j!#(B
$B%5%V%f%K%C%H?t(B | $BEPO?$5$l$k%G%P%$%9L>(B | $B%G%P%$%9(BID |
0 | xxx | ID |
1 | xxx | ID |
| xxx0 | ID+1 |
N | xxx | ID |
| xxx0 | ID+1 |
| : : | |
| xxx(N-1) | ID+N |
xxx
$B$O(B name[]
$B$G;XDj$7$?%G%P%$%9(B($B%f%K%C%H(B)$BL>!#(B
- $B%5%V%f%K%C%H?t$,(B 0 $B$G$J$$$H$-$N(B
xxx
$B$O%f%K%C%HA4BN(B
( $BJ*M}%G%P%$%9(B ) $B$r0UL#$9$k!#(B
- ID $B$O4X?tCM$H$7$FLa$5$l$k%G%P%$%9(B ID $B!#(B
$B%G%P%$%9=hM}MW5a$O%i%s%G%V$K$h$j%I%i%$%P$KEO$5$l!"(B
$B%I%i%$%P$O=hM}$r9T$C$?8e%i%s%G%V1~Ez$rLa$9!#(B
/* $B%3%^%s%IoMW5a$N(B calptn */
#define D_NORM_PTN ( D_CALPTN(DC_OPEN) \
|D_CALPTN(DC_CLOSE) \
|D_CALPTN(DC_CLOSEALL) \
|D_CALPTN(DC_READ) \
|D_CALPTN(DC_WRITE) )
/* $BNc30MW5a$N(B calptn */
#define D_ABORT_PTN ( D_CALPTN(DC_ABORT) \
|D_CALPTN(DC_SUSPEND) \
|D_CALPTN(DC_RESUME) \
|D_CALPTN(DC_CARDEVENT) \
|D_CALPTN(DC_USBEVENT) )
- $BMW5a%3%^%s%I$Ncal_por $B$N(B
calptn
$B$r;XDj$9$k!#(B
/* $B%G%P%$%9MW5a%3%^%s%I(B */
typdef struct {
UW nowait:1; /* NOWAIT $B%b!<%I(B */
UW rsv0:14; /* $BM=Ls(B(0) */
UW adcnv:1; /* $B%"%I%l%9JQ49%b!<%I(B */
DevCmdKind cmd:16; /* $B%3%^%s%I(B */
} DevCmd;
/* $B%G%P%$%9=hM}MW5a%a%C%;!<%8(B */
typedef struct {
ID devid; /* $BBP>]$N%G%P%$%9(BID */
DevCmd cmd; /* $BMW5a%3%^%s%I(B */
W datano; /* $B%G!<%?HV9f(B */
W datacnt; /* $B%G!<%??t(B */
ID taskid; /* $BMW5a$7$?%?%9%/(BID */
VP memptr; /* $B%a%b%j!<%]%$%s%?(B */
} DevReq;
/* $B%G%P%$%9=hM}1~Ez%a%C%;!<%8(B */
typedef struct {
ID devid; /* $BBP>]$N%G%P%$%9(BID */
DevCmd cmd; /* $BMW5a%3%^%s%I(B */
W datano; /* $B%G!<%?HV9f(B */
W datacnt; /* $B%G!<%??t(B */
ErrCode error; /* $B%(%i!<%3!<%I(B */
} DevRsp;
- devid:
- $BA`:nBP>]%G%P%$%9$r<($9%G%P%$%9(BID$B!#1~Ez;~$K$OF1$8CM$rLa$9!#(B
- cmd:
- $BMW5a%3%^%s%I!#1~Ez;~$K$OF1$8CM$rLa$9!#(B
cmd.nowait :
NOWAIT
$B%b!<%I;XDj(B
NOWAIT
$B%b!<%I$r%5%]!<%H$7$F$$$J$$>l9g$OL5;k$9$k!#(B
cmd.adcnv :
- $B%"%I%l%9JQ49;XDj(B
cmd.cmd :
- $B%3%^%s%I
DC_OPEN :
- $B%G%P%$%9$N;HMQ$r2DG=$K$9$k!#(B
$B
$BB?=E$K%*!<%W%s$5$l$?>l9g!"(B
$B%G%P%$%9B0@-$N(B openreq = 0
$B$N;~$O!"(B
$B:G=i$N(B 1 $B2s$N$_H/9T$5$l$k!#(B
openreq = 1
$B$N;~$O!"Kh2sH/9T$5$l$k!#(B
taskid
$B$K$O%*!<%W%s$7$?%?%9%/(B ID$B!"(B
datano
$B$K$O%*!<%W%s$7$?%?%9%/$,B0$9$k%W%m%;%9(B ID $B$,F~$k(B
( $B%?%9%/(B ID$B!"%W%m%;%9(B ID $B$,ITL@(B / $BL$Dj5A$N;~$O!"$=$l$>$l(B 0 $B$,F~$k(B ) $B!#(B
datacnt
$B!"(Bmemptr
$B$OL$;HMQ!#(B
DC_CLOSE :
- $B%G%P%$%9$N;HMQ$r=*N;$9$k!#(B
$B
$BB?=E$K%*!<%W%s$5$l$?$N$A$K%/%m!<%:$5$l$?>l9g!"(B
$B%G%P%$%9B0@-$N(B openreq = 0
$B$N;~$O!"(B
$B:G8e$N(B 1 $B2s$N$_H/9T$5$l$k!#(B
openreq = 1
$B$N;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100 $B0J9_$rMxMQ$9$k!#(B
DN_EVENT :
- $B;v>]DLCNMQ%a%C%;!<%8%P%C%U%!(B ID RW
- data:
- ID
DN_DISKINFO :
- $B%G%#%9%/>pJs(B R
- data:
-
typedef struct {
DiskFormat format; /* $B%U%)!<%^%C%H7A<0(B */
Bool protect:1; /* $B%W%m%F%/%H>uBV(B */
Bool removable:1; /* $B
protect :
- $B%O!<%IE*$K=q$-9~$_$,6X;_$5$l$F$$$k;~(B True
removable :
- $B%a%G%#%"$Nl9g$K(B True
typedef enum {
DiskFmt_MEMINIT = -2, /* $B%a%b%j!<%G%#%9%/=i4|2=(B */
DiskFmt_MEM = -1, /* $B%a%b%j!<%G%#%9%/(B */
DiskFmt_STD = 0, /* $BI8=`(B (HD$BEy(B) */
DiskFmt_2DD = 1, /* 2DD 720KB */
DiskFmt_2HD = 2, /* 2HD 1.44MB */
DiskFmt_VHD = 3 /* $B%U%m%W%A%+%k(B 20MB */
DiskFmt_CDROM = 4, /* CD-ROM 640MB */
DiskFmt_2HD12 = 0x12 /* 2HD 1.2MB */
} DiskFormat;
$B%U%m%C%T!<%G%#%9%/$NMM$K(B1$BBf$N%I%i%$%V$GJ#?tl9g$r=|$-!"(B
$B%U%)!<%^%C%H7A<0$OI8=`(B ( DiskFmt_STD
) $B$r;HMQ$9$k!#(B
$B%a%b%j!<%G%#%9%/(B ( DiskFmt_MEM
) $B$O!"(B
RAM Disk $B$NMM$K%a%b%j!<$H$7$F%"%/%;%9$G$-$k>l9g$K;HMQ$9$k!#(B
DN_DISPSPEC :
- $BI=<(%G%P%$%9;EMM$N
- data:
-
typedef struct {
H attr; /* $B%G%P%$%9B0@-(B */
H planes; /* $B%W%l!<%s?t(B */
H pixbits; /* $B%T%/%;%k%S%C%H?t(B */
H hpixels; /* $B2#$N%T%/%;%k?t(B */
H vpixels; /* $B=D$N%T%/%;%k?t(B */
H hres; /* $B2#$N2rA|EY(B */
H vres; /* $B=D$N2rA|EY(B */
H color[4]; /* $B%+%i!<>pJs(B */
H resv[6];
} DEV_SPEC;
DP $B$N(B DEV_SPEC
$B$N;EMM$K=`$:$k(B
( BTRON3 $B;EMM=q!VBh(B2$BJT(B OS $B;EMM!W(B-$B!V(B2.3 $B4pK\4X?t!W$N(B gget_spc()
$B;2>H(B)$B!#(B
$B$3$NB0@-%G!<%?$,%5%]!<%H$5$l$F$$$k%G%P%$%9$O!"(B
$BI=<((B ( $B0u:~(B ) $B%G%P%$%9$G$"$k!#(B
$B$7$?$,$C$F!"(BDP $B$O(B gopn_dev
$B$G%G%P%$%9IA2h4D6-$r@8@.$9$k;~!"(B
$B$3$N%G!<%?$rFI$_=P$9$3$H$,$G$-$l$P!"(B
$BIA2h4D6-$r@[email protected]=$J%G%P%$%9$HH=Dj$9$k$3$H$,$G$-$k!#(B
DN_PCMCIAINFO :
- PC $B%+!<%I>pJs(B R
- data:
-
typedef struct {
UB major; /* $B;EMM%P!<%8%g%s(B($B>e0L(B) */
UB minor; /* $B;EMM%P!<%8%g%s(B($B2<0L(B) */
UB info[40]; /* $B@=IJ>pJs(B */
} PCMCIAInfo;
$B8=:_A^F~$5$l$F$$$k(B PC $B%+!<%I$+$i!"(B
$B%+!<%IB0@->pJs$N@=IJ>pJs$rFI$_=P$9!#(B
- major:
- minor:
- PCMCIA $B;EMM$N%P!<%8%g%s(B
- info:
- $B@=IJ>pJsJ8;zNs(B
- '\0' $B$G=*$o$k(B ASCII $BJ8;zNs$G$"$k!#(B
PC $B%+!<%I$,A^F~$5$l$F$$$J$$>l9g$K$O!"%(%i!<(B ( ER_NOMDA
) $B$H$J$k!#(B
$B%G%P%$%9$,(B PC $B%+!<%I$G$J$$>l9g$K$O$3$N>pJs$OFI$_=P$;$:!"(B
$B%(%i!<(B ( ER_PAR
) $B$H$J$k!#(B
$B;v>]DLCNMQB0@-%G!<%?(B ( DN_EVENT
) $B$K%a%C%;!<%8%P%C%U%!(B ID ( $B!b(B0 )
$B$,=q$-9~$^$l$k$H!"(B
$B$=$l0J9_$KH/@8$7$?;v>]$r%a%C%;!<%8%P%C%U%!$KAw?.$9$k!#(B
0 $B$,=q$-9~$^$l$k$H!"$=$l0J9_$N;v>]DLCN$O9T$o$J$$!#(B
$B%I%i%$%P$N=i4|2=$N;~E@$G$O!"(B
$B%G%P%$%9%I%i%$%P!<5/F0%Q%i%a!<%?(B ( DevDrvParam
)
$B$G;XDj$5$l$?%a%C%;!<%8%P%C%U%!(B ID $B$,%G%U%)%k%H$H$7$F@_Dj$5$l$k!#(B
/* $B;v>]o(B */
DE_REQEJECT = 0x08, /* $B%a%G%#%"GS=PMW5a(B */
DE_PDBUT = 0x11, /* PD$B%\%?%sJQ2=(B */
DE_PDMOVE = 0x12, /* PD$B0LCV0\F0(B */
DE_PDSTATE = 0x13, /* PD$B$N>uBVJQ2=(B */
DE_PDEXT = 0x14, /* PD$B3HD%;v>](B */
DE_KEYDOWN = 0x21, /* $B%-!<%@%&%s(B */
DE_KEYUP = 0x22, /* $B%-!<%"%C%W(B */
DE_KEYMETA = 0x23, /* $B%a%?%-!<>uBV$NJQ2=(B */
DE_POWEROFF = 0x31, /* $BEE8;%9%$%C%A%*%U(B */
DE_POWERLOW = 0x32, /* $BEE8;;DNL7Y9p(B */
DE_POWERFAIL = 0x33, /* $BEE8;0[>o(B */
DE_POWERSUS = 0x34, /* $B<+F0%5%9%Z%s%I(B */
DE_POWERUPTM = 0x35, /* $B;~7W99?7(B */
DE_CKPWON = 0x41 /* $B<+F0EE8;(B ON $BDLCN(B */
} DevEvtKind;
#define L_VD 0
typedef struct {
DevEvtKind kind; /* $B;v>]pJs(B */
} DevEvt;
kind :
- $B;v>]$N
info :
- $B;v>]$NpJs(B
$B%5%$%:$O;v>]
$B3F;v>]$N>\:Y$O!"BP>]$N%G%P%$%9%I%i%$%P!<;EMM$r;2>H$N$3$H!#(B
$B%a%C%;!<%8%P%C%U%!$,0lGU$G;v>]DLCN$r9T$($J$$>l9g$O!"(B
$B$=$N;v>]$,DLCN$5$l$J$$$3$H$G(B
$B;v>]$N]DLCN$r9T$C$F$b$h$$!#(B
$B$=$N>l9g$b86B'$H$7$F!"(B
$B;v>]DLCN0J30$N%G%P%$%9%I%i%$%P!<$N=hM}$,BZ$C$F$O$$$1$J$$!#(B
$B%G%P%$%9%I%i%$%P!<$G$O!"(B
ITRON $B%7%9%F%`%3!<%k$H$$$/$D$+$N%i%$%V%i%j4X?t$r;HMQ$9$k$3$H$,$G$-$k!#(B
$B%G%P%$%9%I%i%$%P!<$G$O!"(B
$B86B'$H$7$F(B BTRON $B%7%9%F%`%3!<%k$O;HMQ$G$-$J$$!#(B
ITRON $B%7%9%F%`%3!<%k(B
$B2<5-$r=|$/(B $B&L(BITRON 3.0 $B%7%9%F%`%3!<%k$,;HMQ$G$-$k!#(B
- $B2DJQD9%a%b%j!<%W!<%k(B
cre_mpl, vcre_mpl, del_mpl, get_blk, pget_blk, tget_blk, rel_blk,ref_mpl
- $B8GDjD9%a%b%j!<%W!<%k(B
cre_mpf, vcre_mpf, del_mpf, get_blf, pget_blf, tget_blf, rel_blf, ref_mpf
- $B3HD%(B SVC
def_svc
ITRON $B$N;q8;$r3MF@$9$k>l9g$O!"(B
$B%*%V%8%'%/%H(BID $B$d%O%s%I%iHV9f$N<+F03d$jEv$F5!G=$r;HMQ$9$k!#(B
$B%G%P%$%9%I%i%$%P!<$G8GDj$N%*%V%8%'%/%H(BID
$B$d%O%s%I%iHV9f$r;HMQ$7$F$O$$$1$J$$!#(B
$B
vcre_tsk, vcre_sem, vcre_flg, vcre_mbx, vcre_mbf, vcre_por, vdef_cyc, vdef_alm
ITRON $B$N>\:Y$K$D$$$F$O!"(BITRON $B$N;EMM=q(B$B$r;2>H$N$3$H(B
$B%G%P%$%9$NEPO?(B
ID DefDevice(DevDef *devdef, DiskInfo *info)
*devdef
$B$G;XDj$7$?%G%P%$%9$r%7%9%F%`$KEPO?$7!"(B
$BEPO?$7$?%G%P%$%9(B ID $B$r4X?tCM$H$7$FLa$9!#(B
devdef->attr.diskinf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: ITRON $B%(%i!<%3!<%I(B )
$BIT@5%"%I%l%9$N%A%'%C%/(B
ERR CheckSpaceR(VP address, W len) R $B%A%'%C%/(B
ERR CheckSpaceRW(VP address, W len) RW $B%A%'%C%/(B
ERR CheckSpaceRE(VP address, W len) RE $B%A%'%C%/(B
- R : $BFI$_9~$_(B
- W : $B=q$-9~$_(B
- E : $B
$B;XDj$7$?(B address
$B$+$i(B len
$B%P%$%H$N%a%b%j!pJs$G%"%/%;%9$,5v2D$5$l$F$$$J$$NN0h$,4^$^$l$F$$$l$P!"(B
$B%(%i!<(B ( ER_ADR
) $B$rJV$9!#(B
$B%a%b%j!<$N%"%/%;%98">pJs$O
- $B%?%9%/5/F0D>8e$O!"(B
$B$=$N%?%9%/$NOS $B%7%9%F%`%3!<%k(B ( $B3HD%(B SVC ) $B$r8F$S=P$9$H!"(B
$B8F$S=P$9D>A0$KOS $B%7%9%F%`%3!<%k(B ( $B3HD%(B SVC ) $B$+$iLa$k$H!"(B
$B8F$S=P$9D>A0$N%"%/%;%98"$KLa$k!#(B
SetTaskSpace()
$B$r9T$&$H!"(B
$B$=$N;~E@$NBP>]%?%9%/$N%"%/%;%98"$,<+%?%9%/$KJ#
$B$D$^$j!"%7%9%F%`%3!<%k$r8F=P$7$?B&$N%"%/%;%98"$,%"%/%;%98">pJs$H$7$F@_Dj$5$l$k!#(B
$BMW5a%3%^%s%I$N(B cmd.adcnv = 1
$B$N;~$O!"(B
memptr
$B$G;XDj$5$l$?%"%I%l%9$KBP$7$F%"%/%;%9$9$kA0$K!"(B
SetTaskSpace()
$B$r9T$$!"(B
$BIT@5%"%I%l%9$N%A%'%C%/$r9T$o$J$/$F$O$J$i$J$$!#(B
- $B4X?tCM(B = 0
- $B@5>o(B
- $B4X?tCM(B < 0
- $B%(%i!<(B (
ER_ADR
)
$BIT@5%"%I%l%9$N%A%'%C%/(B ( TC $BJ8;zNs(B )
WERR CheckStrSpaceR(TC *str, W max) R $B%A%'%C%/(B
WERR CheckStrSpaceRW(TC *str, W max) RW $B%A%'%C%/(B
str
$B$+$i(B TNULL
$B$KC#$9$k$+(B max
$BJ8;zL\$KC#$9$k$^$G$N%a%b%j!max = 0 $B$N>l9g$O!"J8;z?t(B ( max
) $B$OL5;k$9$k!#(B
$B@5Ev$J$i$=$NJ8;z?t!"$^$?$O(B max
$B$NCM(B
( max != 0
$B$G(B max
$BJ8;zL\$KC#$9$k$^$G$K(B TNULL
$B$,$J$$>l9g(B ) $B$rJV$7!"(B
$BITEv$J$i%(%i!<(B ( ER_ADR
) $B$rJV$9!#(B
str
$B$O6v?t%"%I%l%9$G$J$1$l$P$J$i$J$$!#(B
- $B4X?tCM(B $B!f(B 0
- $B@5>o(B($BJ8;z?t(B)
- $B4X?tCM(B < 0
- $B%(%i!<(B (
ER_ADR
)
$BIT@5%"%I%l%9$N%A%'%C%/(B ( B $BJ8;zNs(B )
WERR CheckBStrSpaceR(UB *str, W max) R $B%A%'%C%/(B
WERR CheckBStrSpaceRW(UB *str, W max) RW $B%A%'%C%/(B
str
$B$+$i(B '\0' $B$KC#$9$k$+(B max
$B%P%$%HL\$KC#$9$k$^$G$N%a%b%j!max = 0 $B$N>l9g$O!"%P%$%H?t(B ( max
) $B$OL5;k$9$k!#(B
$B@5Ev$J$i$=$N%P%$%H?t!"$^$?$O(B max
$B$NCM(B
( max != 0
$B$G(B max
$B%P%$%HL\$KC#$9$k$^$G$K(B '\0' $B$,$J$$>l9g(B )
$B$rJV$7!"ITEv$J$i%(%i!<(B ( ER_ADR
) $B$rJV$9!#(B
- $B4X?tCM(B $B!f(B 0
- $B@5>o(B($B%P%$%H?t(B)
- $B4X?tCM(B < 0
- $B%(%i!<(B(ER_ADR)
$BJ*M}%"%I%l%96u4V$N3MF@(B / $B%m%C%/(B
ERR LockSpace(VP address, W len, ID taskid)
taskid
$B$G;XDj$7$?%?%9%/$N%"%I%l%96u4V>e$N(B address
$B$+$i(B
len
$B%P%$%H$N%a%b%j!oCs2=(B ) $B$9$k!#(B
$B;HMQ$,=*$o$C$?$i!"(B
$BI,$:(B UnlockSapce()
$B$K$h$j%"%s%m%C%/(B ( $B>oCs2=2r=|(B ) $B$7$J$1$l$P$J$i$J$$!#(B
- $B4X?tCM(B = 0
- $B@5>o(B
- $B4X?tCM(B < 0
- $B%(%i!<(B
ERR UnlockSpace(VP address, W len, ID taskid)
LockSpace()
$B$G%m%C%/(B ( $B>oCs2=(B ) $B$7$?%a%b%j!oCs2=2r=|(B ) $B$9$k!#(B
- $B4X?tCM(B = 0
- $B@5>o(B
- $B4X?tCM(B < 0
- $B%(%i!<(B
WERR CnvPhysicalAddr(VP addr, W len, VP *physical_addr)
$B;XDj$7$?(B address
$B$+$i(B len
$B%P%$%H$N%a%b%j!*physical_address $B$KLa$7!"(B
$BJ*M}%"%I%l%9$NO"B3%P%$%HD9$5$r4X?tCM$KLa$9!#(B
$BO"B3$7$?O@M}%"%I%l%9$G$"$C$F$bJ*M}%"%I%l%9$OO"B3$7$F$$$k$H$O8B$i$J$$!#(B
$B4X?tCM(B < len
$B$N>l9g$O!"(B
$BJ*M}%"%I%l%9>e$G$O(B len $B%P%$%H$NNN0h$,O"B3$7$F$$$J$$$3$H$r0UL#$9$k$?$a!"(B
DMA $B%"%/%;%9$r9T$&>l9g$OJ,3d$7$FA`:n$9$kI,MW$,$"$k!#(B
$B;XDj$7$?%"%I%l%9$O%m%C%/(B ( $B>oCs2=(B ) $B$5$l$F$$$J$1$l$P$$$1$J$$!#(B
- $B4X?tCM(B $B!f(B 0
- $B@5>o(B ( $BCM$OJ*M}%"%I%l%9$NO"B3%P%$%HD9(B $B!e(B
len
)
- $B4X?tCM(B < 0
- $B%(%i!<(B
$BGSB>@)8fMQ9bB.%m%C%/(B
ERR CreateLock(FastLock *lock)
void DeleteLock(FastLock *lock)
void Lock(FastLock *lock)
void Unlock(FastLock *lock)
$BGSB>@)8f$r9T$&$?$a$N9bB.%m%C%/!#(B
$BFbIt$G(B ITRON $B$N%;%^%U%)$r;HMQ$7$F$$$k$,!"(B
ITRON $B$N%;%^%U%)$rD>@\;HMQ$9$k$h$j9bB.$G$"$k!#(B
CreateLock()
$B$K$h$j%m%C%/$r@8@.$7!"(B
Lock()
$B!"(BUnlock()
$B$K$h$jGSB>@)8f$r9T$&!#(B
/* $B9bB.%;%^%U%)(B */
typedef struct {
W cnt;
ID semid;
} FastLock;
- $B4X?tCM(B = 0
- $B@5>o(B
- $B4X?tCM(B < 0
- $B%(%i!<(B (
ER_INNER
: ITRON $B%(%i!<%3!<%I(B)
$B&LICC10L$NBT$A(B
void WaitUsec(UW usec)
usec
$B&LICBT$D!#BT$A;~4V$O$"$^$j@53N$G$O$J$$!#(B
$B$3$NBT$A$O!"(BITRON $B$NBT$A(B ( WAIT
) $B>uBV$G$O$J$$!#(B
$B@Q6KE*$KB>$N%?%9%/$X(B CPU $B$rL@$1EO$9$h$&$J$3$H$O$7$J$$!#(B
$B$7$?$,$C$F!"D9;~4V$NBT$A$K;HMQ$9$Y$-$G$O$J$$!#(B
I/O $B%]!<%H%"%/%;%9$N%?%$%_%s%0D4@0Ey$N6KC;;~4V$NBT$A$K;HMQ$9$k!#(B
I/O $B%]!<%H%"%/%;%9(B
void out_w(W port, UW data) W $B%5%$%:(B
void out_h(W port, UH data) H $B%5%$%:(B
void out_b(W port, UB data) B $B%5%$%:(B
I/O $B6u4V$N(B port
$BHVCO$X(B data
$B$r=q$-9~$`!#(B
UW in_w(W port) W $B%5%$%:(B
UH in_h(W port) H $B%5%$%:(B
UB in_b(W port) B $B%5%$%:(B
I/O $B6u4V$N(B port
$BHVCO$+$iFI$_=P$9!#(B
CPU $B3d9~%^%9%/@)8f(B
DI(UW imask) $B3d9~6X;_(B
EI(UW imask) $B3d9~5v2D(B(imask $B$N>uBV$XLa$9(B)
CPU $B$N3d9~6X;_>uBV$r@)8f$9$k!#(BDI
$B$K$h$j3d9~$r6X;_$7!"(B
EI
$B$K$h$j3d9~$r5v2D$9$k!#(B
DI(imask)
$B$O(B imask
$B$K8=:_$N3d9~6X;_>uBV$rJ]B8$7$?8e!"(B
$B3d9~$r6X;_$9$k!#(B
EI(imask)
$B$O(B imask
$B$KJ]B8$5$l$F$$$k3d9~6X;_>uBV$XI|5"$9$k!#(B
$B$D$^$j!"(BEI
$B$O(B DI
$B$ND>A0$N>uBV$KLa$9!#(B
$B$7$?$,$C$F!"(BDI
$B$N;~E@$G$9$G$K3d9~6X;_$H$J$C$F$$$?>l9g$K$O!"(B
EI
$B$G85$N>uBV$KLa$7$F$b3d9~6X;_$N$^$^$G$"$k!#(B
imask
$B$NFbMF$O5!
DI
$B!"(BEI
$B$O%^%/%m$G$"$k!#(B
$B3d9~%3%s%H%m!<%i@)8f(B
$B5!$r;HMQ$7$F$$$k!#(B
$B3d$j9~$_%Y%/%?!IntVector ) $B$NDj5A$b5!
B-right/V $B$G;HMQ$G$-$k4X?t(B
void EnableInt(IntVector vector)
void DisableInt(IntVector vector)
void ClearInt(IntVector vector)
void EndOfInt(IntVector vector)
W CheckInt(IntVector vector)
void EnableInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_$r5v2D$9$k!#(B
$B4{$K3d$j9~$_MW5a$,$"$C$?>l9g$O!"5v2D$7$?D>8e$K3d$j9~$_$,H/@8$9$k!#(B
void DisableInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_$r6X;_$9$k!#(B
$B3d$j9~$_6X;_Cf$KH/@8$7$?3d$j9~$_MW5a$O!"J];}$5$l$k!#(B
void ResetInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_MW5a$r%j%;%C%H$9$k!#(B
void ClearInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_MW5a$r%/%j%"$9$k!#(B
void EndOfInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_$N3d$j9~$_=hM}=*N;$rDLCN$9$k!#(B
$B8=:_=hM}$7$F$$$k3d$j9~$_%l%Y%k$r<($9(B vector
$B$r;XDj$7$J$1$l$P$J$i$J$$!#(B
void LevelInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_MW5a$r%l%Y%k%H%j%,$K@_Dj$9$k!#(B
void EdgeInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_MW5a$r%(%C%8%H%j%,$K@_Dj$9$k!#(B
W CheckInt(IntVector vector)
vector
$B$G;XDj$7$?3d$j9~$_$NMW5a$NM-L5$r%A%'%C%/$9$k!#(B
$BMW5a$,$"$k>l9g$O!"(B0 $B$G$J$$CM$,La$k!#(B
$B%G%P%$%9%3%s%U%#%0%l!<%7%g%s>pJs(B
$B%G%P%$%9%3%s%U%#%0%l!<%7%g%s>pJs(B ( DEVCONF
) $B$+$i!">pJs$r
W GetDevConf(B *name, W val[L_DEVCONF_VAL])
name :
- $B9`L\L>(B ( $B:GBg(B 16 $BJ8;z$N(B ASCII $BJ8;zNs(B )
val :
- $B
- $B4X?tCM(B
- $B$B4X?tCM(B = 0
- $B9`L\$OB8:_$7$J$$(B
W GetDevConfStr(B *name, B str[L_DEVCONF_STR])
name :
- $B9`L\L>(B ( $B:GBg(B 16 $BJ8;z$N(B ASCII $BJ8;zNs(B )
str :
- $B
- $B4X?tCM(B
- $B$B4X?tCM(B = 0
- $B9`L\$OB8:_$7$J$$(B
$B%G%P%$%9%3%s%U%#%0%l!<%7%g%s>pJs$O!"(B
/SYS/DEVCONF
$B$K%U%!%$%k$H$7$FB8:_$9$k!#(B
$B$3$N%U%!%$%k$O!"%7%9%F%`5/F0;~$K%a%b%j!<$KFI$_9~$^$l$k!#(B
$B>e5-4X?t$O$3$N%a%b%j!<>e$N>pJs$rDEVCONF $B%U%!%$%k$rJQ99$7$F$b!"(B
$B%7%9%F%`$r:F5/F0$7$J$1$l$P!"$=$NJQ99$OH?1G$5$l$J$$!#(B
DMA $B@lMQ%a%b%j!<(B
PC-AT $B$N>l9g!"2<0L(B 16MB $B$N%a%b%j!<6u4V$KBP$7$F$7$+(B
DMA $BE>Aw$r9T$&$3$H$,$G$-$:!"(B
$B$^$?(B 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