tk_swri_dev

Synchronous Write Device

[C Language Interface]




ER ercd = tk_swri_dev ( ID dd, W start, VP buf, W size, W* asize ) ;

[Parameters]

ID	dd	Device descriptor


W	start	Write start location (( 0: Device-specific data, < 0: Attribute data)


VP	buf	Buffer holding data to be written


W	size	Size of data to be written

[Return Parameters]

ER	ercd	Error code


W*	asize	Size of data being written

[Error Codes]

E_ID	dd is invalid or not open


	reqid is invalid or not a request for dd


E_OBJ	Another task is already waiting for request reqid


E_NOEXS	No requests are being processed (only when reqid = 0)


E_OACV	Open mode is invalid (write not permitted)


E_RONLY	Read-only device


E_LIMIT	Number of requests exceeds the limit


E_ABORT	Processing aborted


Other	Errors returned by device driver

[Description]

Synchronous write. This is equivalent to the following.


	ER tk_swri_dev( ID dd, W start, VP buf, W size, W *asize )
	{
		ER er, ioer;
		er = tk_wri_dev(dd, start, buf, size, TMO_FEVR);
		if ( er > 0 ) {
			er = tk_wai_dev(dd, er, asize, &ioer, TMO_FEVR);
			if ( er > 0 ) er = ioer;
		}
		return er;
	}
[Difference with T-Kernel 1.00.00]

The type of start and size is W instead of INT.

However, since these items are implementation-dependent, implementation for start and size may be in the INT data type. These arguments are target system-dependent. For example, upper bits may always be unused if the implementation in W type is specified for a 16-bit CPU. Only in such cases, implementation in INT type instead of W type is allowed for the purpose of speeding the execution and making the program smaller.

Comments

Click here to Post a Comment