Changeset 433 for soft/giet_vm/giet_common/utils.c
- Timestamp:
- Oct 12, 2014, 6:53:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_common/utils.c
r430 r433 348 348 { 349 349 // check alignment constraints 350 if ( (paddr & 3) || (size & 3) )350 if ( (paddr & 3) || (size & 7) ) 351 351 { 352 352 _printf("\n[GIET ERROR] in _physical_memset() : buffer unaligned\n"); … … 360 360 _it_disable(&sr); 361 361 362 asm volatile( "move $4, %0 \n" /* $4 < lsb */ 363 "move $5, %1 \n" /* $5 < msb */ 364 "move $6, %2 \n" /* $6 < size */ 365 "move $7, %3 \n" /* $7 < data */ 366 367 "mfc2 $2, $1 \n" /* $2 <= current MMU_MODE */ 368 "andi $3, $2, 0xb \n" /* $3 <= new MMU_MODE */ 369 "mtc2 $3, $1 \n" /* DTLB off */ 370 "mtc2 $5, $24 \n" /* PADDR_EXT <= msb */ 371 372 "ph_memset_loop: \n" 373 "sw $7, 0($4) \n" /* data <= *src_paddr */ 374 "addi $4, $4, 4 \n" /* iter = iter - 1 */ 375 "bne $4, $6, ph_memcpy_loop \n" 376 "nop \n" 377 378 "mtc2 $0, $24 \n" /* PADDR_EXT <= 0 */ 379 "mtc2 $2, $1 \n" /* restore MMU_MODE */ 380 : "=r" (data) 381 : "r" (lsb), "r" (msb), "r" (size), "r"(data) 382 : "$2", "$3", "$4", "$5", "$6", "$7" ); 362 asm volatile( "mfc2 $8, $1 \n" /* $8 <= current MMU_MODE */ 363 "andi $9, $8, 0xb \n" /* $9 <= new MMU_MODE */ 364 "mtc2 $9, $1 \n" /* DTLB off */ 365 "mtc2 %3, $24 \n" /* PADDR_EXT <= msb */ 366 367 "1: \n" /* set 8 bytes per iter */ 368 "sw %2, 0(%0) \n" /* *src_paddr = data */ 369 "sw %2, 4(%0) \n" /* *(src_paddr+4) = data */ 370 "addi %1, %1, -8 \n" /* size -= 8 */ 371 "addi %0, %0, 8 \n" /* src_paddr += 8 */ 372 "bnez %1, 1b \n" /* loop while size != 0 */ 373 374 "mtc2 $0, $24 \n" /* PADDR_EXT <= 0 */ 375 "mtc2 $8, $1 \n" /* restore MMU_MODE */ 376 : "+r"(lsb), "+r"(size) 377 : "r"(data), "r" (msb) 378 : "$8", "$9", "memory" ); 383 379 384 380 _it_restore(&sr); 385 } // _p ysical_memset()381 } // _physical_memset() 386 382 387 383 ///////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.