This page is available in: en

tk_srea_dev

Synchronous Read Device

[C Language Interface]

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

[Parameters]

ID	dd	Device descriptor


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


VP	buf	Buffer location for putting the read data


W	size	Read size

[Return Parameters]

ER	ercd	Error code


W*	asize	Size of data being read

[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 (read not permitted)


E_LIMIT	Number of requests exceeds the limit


E_ABORT	Processing aborted


Other	Errors returned by device driver

[Description]

Synchronous read. This is equivalent to the following.


	ER tk_srea_dev( ID dd, W start, VP buf, W size, W *asize )
	{
		ER er, ioer;
		er = tk_rea_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 as well as the type of the target pointed by asize are 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