tailieunhanh - ARM PROGRAMMING

Task A executes and starts to write the string “Hello world” to the LCD. Task A is pre-empted by Task B after outputting just the beginning of the string – “Hello w”. Task B writes “Abort, Retry, Fail?” to the LCD before entering the Blocked state. Task A continues from the point at which it was preempted and completes outputting the remaining characters – “orld”. The LCD will now be displaying the corrupted string “Hello wAbort, Retry, Fail?orld”. Read, Modify, Write Operations /* The C code being compiled. */ 155: PORTA |= 0x01; /* The assembly code produced. */ LDR R0,[PC,#0x0070] ;. | ARM PROGRAMMING Bùi Quốc Bảo Resource management Nếu nhiều tác vụ cùng truy cập 1 tài nguyên VD UART sẽ dẫn đến đụng độ conflict . VD Accessing Peripherals Read Modify Write Operations Non-atomic Access to Variables Function Reentrancy BÙI QUOC BẢO 1 Accessing Peripherals Task A executes and starts to write the string Hello world to the LCD. Task A is pre-empted by Task B after outputting just the beginning of the string - Hello w . Task B writes Abort Retry Fail to the LCD before entering the Blocked state. Task A continues from the point at which it was preempted and completes outputting the remaining characters - orld . The LCD will now be displaying the corrupted string Hello wAbort Retry Fail orld . Read Modify Write Operations The C code being compiled. 155 PORTA 0x01 The assembly code produced. LDR R0 PC 0x0070 Obtain the address of PORTA LDR R1 R0 0x00 Read the value of PORTA into R1 MOV R2 0x01 Move the absolute constant 1 into R2 ORR R1 R2 OR R1 PORTA with R2 constant 1 STR R1 R0 0x00 Store the new value back to PoRtA Nếu trong quá trình này có 1 tác vụ khác có mức ưu tiên cao hơn nhảy vào ghi vào PORTA dữ liệu sẽ bị sai BÙI QUỐC BẢO 2 Non-atomic Access to Variables Khi truy cập vào các biến có độ rộng lớn hơn 32bit VD struct CPU cần nhiều hơn 1 lệnh. Quá trình này gọi là Non-atomic Access Nếu có 1 tác vụ khác cắt ngang quá trình này sẽ có thể dẫn đến sai trong dữ liệu. Function Reentrancy Một hàm gọi là reentrant nếu nó có thể được gọi cùng lúc trong nhiều tác vụ hoặc ngắt. Mỗi tác vụ đều có stack riêng. Nếu hàm chỉ truy cập vào các biến lưu trong stack của tác vụ hàm đó là reentrant BÙI QUỐC BẢO

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.