process.cc (6234:17e7ab512377) | process.cc (6235:33adfb8af4c0) |
---|---|
1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * Copyright (c) 2007-2008 The Florida State University 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 468 unchanged lines hidden (view full) --- 477 }; 478 479 // Fill this page with swi -1 so we'll no if we land in it somewhere. 480 for (Addr addr = 0; addr < PageBytes; addr += sizeof(swiNeg1)) { 481 tc->getMemPort()->writeBlob(commPage + addr, 482 swiNeg1, sizeof(swiNeg1)); 483 } 484 | 1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * Copyright (c) 2007-2008 The Florida State University 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 468 unchanged lines hidden (view full) --- 477 }; 478 479 // Fill this page with swi -1 so we'll no if we land in it somewhere. 480 for (Addr addr = 0; addr < PageBytes; addr += sizeof(swiNeg1)) { 481 tc->getMemPort()->writeBlob(commPage + addr, 482 swiNeg1, sizeof(swiNeg1)); 483 } 484 |
485 // We don't have barriers, so just return. 486 uint8_t memory_barrier[] = 487 { 488 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr 489 }; 490 tc->getMemPort()->writeBlob(commPage + 0x0fa0, memory_barrier, 491 sizeof(memory_barrier)); 492 |
|
485 // This -should- be atomic, but I don't think all the support that we'd 486 // need is implemented. There should also be memory barriers around it. 487 uint8_t cmpxchg[] = 488 { 489 0x00, 0x30, 0x92, 0xe5, //ldr r3, [r2] 490 0x00, 0x30, 0x53, 0xe0, //subs r3, r3, r0 491 0x00, 0x10, 0x92, 0x05, //streq r1, [r2] 492 0x03, 0x00, 0xa0, 0xe1, //mov r0, r3 493 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr 494 }; 495 tc->getMemPort()->writeBlob(commPage + 0x0fc0, cmpxchg, sizeof(cmpxchg)); 496 497 uint8_t get_tls[] = 498 { 499 0x08, 0x00, 0x9f, 0xe5, //ldr r0, [pc, #(16 - 8)] 500 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr 501 }; 502 tc->getMemPort()->writeBlob(commPage + 0x0fe0, get_tls, sizeof(get_tls)); 503} | 493 // This -should- be atomic, but I don't think all the support that we'd 494 // need is implemented. There should also be memory barriers around it. 495 uint8_t cmpxchg[] = 496 { 497 0x00, 0x30, 0x92, 0xe5, //ldr r3, [r2] 498 0x00, 0x30, 0x53, 0xe0, //subs r3, r3, r0 499 0x00, 0x10, 0x92, 0x05, //streq r1, [r2] 500 0x03, 0x00, 0xa0, 0xe1, //mov r0, r3 501 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr 502 }; 503 tc->getMemPort()->writeBlob(commPage + 0x0fc0, cmpxchg, sizeof(cmpxchg)); 504 505 uint8_t get_tls[] = 506 { 507 0x08, 0x00, 0x9f, 0xe5, //ldr r0, [pc, #(16 - 8)] 508 0x0e, 0xf0, 0xa0, 0xe1 //usr_ret lr 509 }; 510 tc->getMemPort()->writeBlob(commPage + 0x0fe0, get_tls, sizeof(get_tls)); 511} |