Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
CS 220 / ARM / ARM1176JZ-S Technical Reference Mmanual.pdf
Источник:
Скачиваний:
45
Добавлен:
16.04.2015
Размер:
4.47 Mб
Скачать

Programmer’s Model

2.11Additional instructions

To support extensions to ARMv6, the ARM1176JZ-S processor includes these instructions in addition to those in the ARMv6 and TrustZone architectures:

Load Register Exclusive instructions, see LDREXB, LDREXH on page 2-31, and LDREXD on page 2-33

Store Register Exclusive instructions, see STREXB, STREXH on page 2-32, and STREXH on page 2-32

Clear Register Exclusive instruction, see CLREX on page 2-34

Yield instruction, see NOP-compatible hints on page 2-34.

2.11.1Load or Store Byte Exclusive

These instruction operate on unsigned data of size byte.

No alignment restrictions apply to the addresses of these instructions.

The LDREXB and STREXB instructions share the same data monitors as the LDREX and STREX instructions, a local and a global monitor for each processor, for shared memory support.

LDREXB

Figure 2-11 shows the format of the Load Register Byte Exclusive, LDREXB, instruction.

31

28 27

21 20 19

 

16 15

12 11

8

7

4

3

0

Cond

 

0 0 0 1

1 1 0

1

 

Rn

 

 

Rd

 

SBO

1

0 0 1

 

SBO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-11 LDREXB instruction

Syntax

LDREXB{<cond>} <Rxf>, [<Rbase>]

Operation

if ConditionPassed(cond) then processor_id = ExecutingProcessor() Rd = Memory[Rn,1]

if Shared(Rn) ==1 then physical_address=TLB(Rn)

MarkExclusiveGlobal(physical_address,processor_id,1) MarkExclusiveLocal(processor_id)

STREXB

Figure 2-12 shows the format of the Store Register Byte Exclusive, STREXB, instruction.

31

28 27

21 20 19

 

16 15

12 11

8

7

4

3

0

Cond

 

0 0 0 1

1 1 0

0

 

Rn

 

 

Rd

 

SBO

1

0 0 1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-12 STREXB instructions

 

Syntax

 

 

STREXB{<cond>} <Rd>, <Rm>, [<Rn>]]

 

 

 

 

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

2-30

ID012410

Non-Confidential, Unrestricted Access

 

Programmer’s Model

Operation

if ConditionPassed(cond) then processor_id = ExecutingProcessor() if IsExclusiveLocal(processor_id) then

if Shared(Rn)==1 then physical_address=TLB(Rn)

if IsExclusiveGlobal(physical_address,processor_id,1) then Memory[Rn,1] = Rm

Rd = 0 ClearByAddress(physical_address,1)

else

 

Rd =1

else

Memory[Rn,1] = Rm

 

Rd = 0

 

else

 

Rd = 1

ClearExclusiveLocal(processor_id)

2.11.2 Load or Store Halfword Exclusive

These instructions operate on naturally aligned, unsigned data of size halfword:

The address in memory must be 16-bit aligned, address[0] == b0

When (A,U) == (0,1), (1,0) or (1,1) in CP15 register 1, the instruction generates alignment faults if this condition is not met.

For more information, see Operation of unaligned accesses on page 4-13.

The transaction must be a single access or indivisible burst on bus widths < 16 bits

For AXI based systems, the exclusive access signal, AxPROT[4], must remain asserted throughout the burst where AxSIZE < 0x1.

The LDREXH and STREXH instructions share the same data monitors as the LDREX and STREX instructions, a local and a global monitor for each processor, for shared memory support.

LDREXH

Figure 2-13 shows the format of the Load Register Halfword Exclusive, LDREXH, instruction.

31

28 27

21 20 19

 

16 15

12 11

8

7

4

3

0

Cond

 

0 0 0 1

1 1 1

1

 

Rn

 

 

Rd

 

SBO

1

0 0 1

 

SBO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-13 LDREXH instruction

Syntax

LDREXH{<cond>} <Rd>, [<Rn>]

Operation

if ConditionPassed(cond) then processor_id = ExecutingProcessor() Rd = Memory[Rn,2]

if Shared(Rn) ==1 then physical_address=TLB(Rn)

MarkExclusiveGlobal(physical_address,processor_id,2) MarkExclusiveLocal(processor_id)

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

2-31

ID012410

Non-Confidential, Unrestricted Access

 

Programmer’s Model

STREXH

Figure 2-14 shows the format of the Store Register Halfword Exclusive, STREXH, instruction.

31

28 27

21 20 19

 

16 15

12 11

8

7

4

3

0

Cond

 

0 0 0 1

1 1 1

0

 

Rn

 

 

Rd

 

SBO

1

0 0 1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-14 STREXH instruction

Syntax

STREXH{<cond>} <Rd>, <Rm>, [<Rn>]

Operation

if ConditionPassed(cond) then processor_id = ExecutingProcessor() if IsExclusiveLocal(processor_id) then

if Shared(Rn)==1 then physical_address=TLB(Rn)

if IsExclusiveGlobal(physical_address,processor_id,2) then Memory[Rn,2] = Rm

Rd = 0 ClearByAddress(physical_address,2)

else

Rd =1

else

Memory[Rn,2] = Rm Rd = 0

else

Rd = 1 ClearExclusiveLocal(processor_id)

2.11.3Load or Store Doubleword

The LDREXD and STREXD instructions behave as follows:

The operands are considered as two words, that load or store to consecutive word-addressed locations in memory.

Register restrictions are the same as LDRD and STRD. For STRD in ARM state, the registers Rm and R(m+1) provide the value that is stored, where m is an even number.

The address in memory must be 64-bit aligned, address[2:0] == b000

When (A,U) == (0,1), (1,0) or (1,1) in CP15 register 1, the instruction generates alignment faults if this condition is not met.

For more information, see Operation of unaligned accesses on page 4-13.

The transaction must be a single access or indivisible burst on bus widths < 64 bits

For AXI based systems, the exclusive access signal, AxPROT[4], must remain asserted throughout the burst where AxSIZE < 0x3.

The LDREXD and STREXD instructions share the same data monitors as the LDREX and STREX instructions, a local and a global monitor for each processor, for shared memory support.

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

2-32

ID012410

Non-Confidential, Unrestricted Access

 

Programmer’s Model

LDREXD

Figure 2-15 shows the format of the Load Register Doubleword Exclusive, LDREXD, instruction.

31

28 27

21 20 19

 

16 15

12 11

8

7

4

3

0

Cond

 

0 0 0 1

1 0 1

1

 

Rn

 

 

Rd

 

SBO

1

0 0 1

 

SBO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-15 LDREXD instruction

Syntax

LDREXD{<cond>} <Rd>, [<Rn>]

Operation

if ConditionPassed(cond) then processor_id = ExecutingProcessor() Rd = Memory[Rn,4]

R(d+1) = Memory[Rn+4,4] if Shared(Rn) ==1 then

physical_address=TLB(Rn) MarkExclusiveGlobal(physical_address,processor_id,8)

MarkExclusiveLocal(processor_id)

STREXD

Figure 2-16 shows the format of the Store Register Doubleword Exclusive, STREXD, instruction.

31

28 27

21 20 19

 

16 15

12 11

8

7

4

3

0

Cond

 

0 0 0 1

1 0 1

0

 

Rn

 

 

Rd

 

SBO

1

0 0 1

 

Rm

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 2-16 STREXD instruction

Syntax

STREXD{<cond>} <Rd>, <Rm>, [<Rn>]

Operation

if ConditionPassed(cond) then processor_id = ExecutingProcessor() if IsExclusiveLocal(processor_id) then

if Shared(Rn)==1 then physical_address=TLB(Rn)

if IsExclusiveGlobal(physical_address,processor_id,8) then Memory[Rn,4] = Rm

Memory[Rn+4,4] = R(m+1) Rd = 0

ClearByAddress(physical_address,8)

else

Rd =1

else

Memory[Rn,4] = Rm Memory[Rn+4,4] = R(m+1) Rd = 0

else

Rd = 1

ARM DDI 0333H

Copyright © 2004-2009 ARM Limited. All rights reserved.

2-33

ID012410

Non-Confidential, Unrestricted Access

 

Соседние файлы в папке ARM