ata_mem

Outline

Register memory object.

C format

 ER      ata_mem ( T_AMEM *pk_amem, ACVCT *p_acvct );
Parameter(s)

I/O

Parameter

Description

I

 T_AMEM  *pk_amemm;
Pointer to the packet containing the memory object registration information.

I

 ACVCT   *p_acvct;
Pointer to the packet containing the access permission vector.



[Memory object registration information packet : T_AMEM]

 typedef struct  t_amem {
     ATR     mematr;         /*Memory object attribute*/
     VP      base;           /*Memory object start address*/
     SIZE    size;           /Size of memory object (in bytes)*/
 } T_AMEM;


[Access permission vector : ACVCT]

 typedef struct  acvct {
     ACPTN   acptn1;         /*Access permission pattern for operand-read*/
     ACPTN   acptn2;         /*Access permission pattern for operand-write*/
     ACPTN   acptn3;         /*Access permission pattern for execution*/
 } ACVCT;


Explanation

This service call can be called from tasks that belong to Trusted Domain.

This service call registers the area started from the address specified by base with the size [bytes] as the memory object with the access permission vector specified by p_acvct.

The bit N-1 in the access permission pattern shows whether tasks belonging to the domain ID #N can access the memory object. The bit value 1 means "permitted" and 0 means "not permitted".

The specified memory object area must satisfy the following.

A ) The start address (base) must be 16-bytes boundary. If not, this service call returns E_PAR error.

B ) The size (size) must be multiple of 16. If not, this service call returns E_PAR error.

C ) The memory object area must not either with all user stacks and all other memory objects. If not, this service call does not detect an error, and correct system operation cannot be guaranteed.

Note 1 The following macros are prepared to specify access permission vector.

- TACT_SRW
Returns access permission vector that represents "all types of access (operand-read, operand-write, execution) are permitted for all domains". This macro can be describe only at the right of an initial assignment statement.

- TACT_SRO
Returns access permission vector that represents "operand-read access is permitted for all domains, and operand-write access and execution access are not permitted for all domains". This macro can be describe only at the right of an initial assignment statement.

- ACVCT TACT_PRW ( ID domid )
Returns access permission vector that represents "all types of access (operand-read, operand-write, execution) are permitted only for the domain indicated by domid". This macro can be describe only at the right of an initial assignment statement.

- ACVCT TACT_PRO ( ID domid )
Returns access permission vector that represents "operand-write access is not permitted for all domain, operand-read and execution access are permitted only for the domain indicated by domid". This macro can be describe only at the right of an initial assignment statement.

- ACVCT TACT_SRPW ( ID domid )
Returns access permission vector that represents "operand-read and execution access are permitted for all domain, operand-write access is permitted only for the domain indicated by domid". This macro can be describe only at the right of an initial assignment statement.

Note 2 The following macros are prepared to specify access permission pattern.

- TACP_SHARED
Returns access permission pattern that represents "all domain can access".

- ACPTN TACP ( ID domid )
Returns access permission pattern that represents "only the domain indicated by domid can access".

Note 3 The memory object attribute (mematr) is merely ignored.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

parameter error.

- pk_amem == NULL

- base is not 16-bytes boundary.

- size is not multiple of 16.

- p_acvct == NULL

- acptn1 == acptn2 == acptn3 == 0

- Either of bits corresponding to the domain ID that is larger than the maximum domain ID (VTMAX_DOMAIN) of either acptn1, acptn2 or acptn3 is 1.

- size == 0

- base + size > 0x100000000

E_CTX

-25

Context error.

- This service call was issued in the CPU locked state.

- This service call was issued from non-task.

- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".

E_MACV

-26

Memory access violation.

- Stack pointer points out of user stack for invoking task.

- The operand-read access to the area indicated by pk_amem has not been permitted to the invoking task.

- The operand-read access to the area indicated by p_acvct has not been permitted to the invoking task.

E_OACV

-27

Object access violation.

- The invoking task does not belong to trusted domain.

- The number of memory objects from which the access is permitted to one domain exceeds 7.

E_OBJ

-41

Object state error.

- The memory object started from the address specified by base has already been registered.