Deleted Added
sdiff udiff text old ( 8568:83f728db3332 ) new ( 8570:ea93f18eead8 )
full compact
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
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

--- 299 unchanged lines hidden (view full) ---

308
309 bool misaligned = (req->getSize() - 1) & vaddr;
310
311 if (IsKSeg0(vaddr)) {
312 // Address will not be translated through TLB, set response, and go!
313 req->setPaddr(KSeg02Phys(vaddr));
314 if (getOperatingMode(tc->readMiscReg(MISCREG_STATUS)) != mode_kernel ||
315 misaligned) {
316 return new AddressErrorFault(vaddr);
317 }
318 } else if(IsKSeg1(vaddr)) {
319 // Address will not be translated through TLB, set response, and go!
320 req->setPaddr(KSeg02Phys(vaddr));
321 } else {
322 /*
323 * This is an optimization - smallPages is updated every time a TLB
324 * operation is performed. That way, we don't need to look at
325 * Config3 _ SP and PageGrain _ ESP every time we do a TLB lookup
326 */
327 Addr VPN;
328 if (smallPages == 1) {
329 VPN = (vaddr >> 11);
330 } else {
331 VPN = ((vaddr >> 11) & 0xFFFFFFFC);
332 }
333 uint8_t Asid = req->getAsid();
334 if (misaligned) {
335 // Unaligned address!
336 return new AddressErrorFault(vaddr);
337 }
338 PTE *pte = lookup(VPN,Asid);
339 if (pte != NULL) {
340 // Ok, found something
341 /* Check for valid bits */
342 int EvenOdd;
343 bool Valid;
344 if ((((vaddr) >> pte->AddrShiftAmount) & 1) == 0) {

--- 37 unchanged lines hidden (view full) ---

382 //@TODO: This should actually use TLB instead of going directly
383 // to the page table in syscall mode.
384 /**
385 * Check for alignment faults
386 */
387 if (req->getVaddr() & (req->getSize() - 1)) {
388 DPRINTF(TLB, "Alignment Fault on %#x, size = %d", req->getVaddr(),
389 req->getSize());
390 if (write)
391 return new StoreAddressErrorFault(req->getVaddr());
392 else
393 return new AddressErrorFault(req->getVaddr());
394 }
395
396
397 Process * p = tc->getProcessPtr();
398
399 Fault fault = p->pTable->translate(req);
400 if (fault != NoFault)
401 return fault;

--- 4 unchanged lines hidden (view full) ---

406
407 bool misaligned = (req->getSize() - 1) & vaddr;
408
409 if (IsKSeg0(vaddr)) {
410 // Address will not be translated through TLB, set response, and go!
411 req->setPaddr(KSeg02Phys(vaddr));
412 if (getOperatingMode(tc->readMiscReg(MISCREG_STATUS)) != mode_kernel ||
413 misaligned) {
414 return new StoreAddressErrorFault(vaddr);
415 }
416 } else if(IsKSeg1(vaddr)) {
417 // Address will not be translated through TLB, set response, and go!
418 req->setPaddr(KSeg02Phys(vaddr));
419 } else {
420 /*
421 * This is an optimization - smallPages is updated every time a TLB
422 * operation is performed. That way, we don't need to look at
423 * Config3 _ SP and PageGrain _ ESP every time we do a TLB lookup
424 */
425 Addr VPN = (vaddr >> 11) & 0xFFFFFFFC;
426 if (smallPages == 1) {
427 VPN = vaddr >> 11;
428 }
429 uint8_t Asid = req->getAsid();
430 PTE *pte = lookup(VPN, Asid);
431 if (misaligned) {
432 return new StoreAddressErrorFault(vaddr);
433 }
434 if (pte != NULL) {
435 // Ok, found something
436 /* Check for valid bits */
437 int EvenOdd;
438 bool Valid;
439 bool Dirty;
440 if ((((vaddr >> pte->AddrShiftAmount) & 1)) == 0) {

--- 72 unchanged lines hidden ---