| 35 | } |
| 36 | |
| 37 | void CodePage::writeb(MMU* mmu, U32 address, U8 value) { |
| 38 | if (!RWPage::canWriteRam(mmu)) { |
| 39 | KThread::currentThread()->seg_access(address, false, true); |
| 40 | } |
| 41 | if (value != this->readb(mmu, address)) { |
| 42 | KThread* thread = KThread::currentThread(); |
| 43 | KMemory* memory = thread->memory; |
| 44 | BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(memory->mutex); |
| 45 | U8 currentValue = this->readb(mmu, address); |
| 46 | if (currentValue == value) { |
| 47 | return; |
| 48 | } |
| 49 | onDemmand(mmu, address >> K_PAGE_SHIFT); |
| 50 | Page::getRWPage()->writeb(mmu, address, value); |
| 51 | memory->removeCode(thread, address, 1, true); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | void CodePage::writew(MMU* mmu, U32 address, U16 value) { |
| 56 | if (!RWPage::canWriteRam(mmu)) { |
nothing calls this directly
no test coverage detected