process.cc (7532:3f6413fc37a2) | process.cc (7720:65d338a8dba4) |
---|---|
1/* 2 * Copyright (c) 2003-2004 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 55 unchanged lines hidden (view full) --- 64 65 //Initialize these to 0s 66 fillStart = 0; 67 spillStart = 0; 68} 69 70void SparcLiveProcess::handleTrap(int trapNum, ThreadContext *tc) 71{ | 1/* 2 * Copyright (c) 2003-2004 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 55 unchanged lines hidden (view full) --- 64 65 //Initialize these to 0s 66 fillStart = 0; 67 spillStart = 0; 68} 69 70void SparcLiveProcess::handleTrap(int trapNum, ThreadContext *tc) 71{ |
72 PCState pc = tc->pcState(); |
|
72 switch(trapNum) 73 { 74 case 0x01: //Software breakpoint | 73 switch(trapNum) 74 { 75 case 0x01: //Software breakpoint |
75 warn("Software breakpoint encountered at pc %#x.\n", tc->readPC()); | 76 warn("Software breakpoint encountered at pc %#x.\n", pc.pc()); |
76 break; 77 case 0x02: //Division by zero | 77 break; 78 case 0x02: //Division by zero |
78 warn("Software signaled a division by zero at pc %#x.\n", 79 tc->readPC()); | 79 warn("Software signaled a division by zero at pc %#x.\n", pc.pc()); |
80 break; 81 case 0x03: //Flush window trap 82 flushWindows(tc); 83 break; 84 case 0x04: //Clean windows 85 warn("Ignoring process request for clean register " | 80 break; 81 case 0x03: //Flush window trap 82 flushWindows(tc); 83 break; 84 case 0x04: //Clean windows 85 warn("Ignoring process request for clean register " |
86 "windows at pc %#x.\n", tc->readPC()); | 86 "windows at pc %#x.\n", pc.pc()); |
87 break; 88 case 0x05: //Range check | 87 break; 88 case 0x05: //Range check |
89 warn("Software signaled a range check at pc %#x.\n", 90 tc->readPC()); | 89 warn("Software signaled a range check at pc %#x.\n", pc.pc()); |
91 break; 92 case 0x06: //Fix alignment 93 warn("Ignoring process request for os assisted unaligned accesses " | 90 break; 91 case 0x06: //Fix alignment 92 warn("Ignoring process request for os assisted unaligned accesses " |
94 "at pc %#x.\n", tc->readPC()); | 93 "at pc %#x.\n", pc.pc()); |
95 break; 96 case 0x07: //Integer overflow | 94 break; 95 case 0x07: //Integer overflow |
97 warn("Software signaled an integer overflow at pc %#x.\n", 98 tc->readPC()); | 96 warn("Software signaled an integer overflow at pc %#x.\n", pc.pc()); |
99 break; 100 case 0x32: //Get integer condition codes 101 warn("Ignoring process request to get the integer condition codes " | 97 break; 98 case 0x32: //Get integer condition codes 99 warn("Ignoring process request to get the integer condition codes " |
102 "at pc %#x.\n", tc->readPC()); | 100 "at pc %#x.\n", pc.pc()); |
103 break; 104 case 0x33: //Set integer condition codes 105 warn("Ignoring process request to set the integer condition codes " | 101 break; 102 case 0x33: //Set integer condition codes 103 warn("Ignoring process request to set the integer condition codes " |
106 "at pc %#x.\n", tc->readPC()); | 104 "at pc %#x.\n", pc.pc()); |
107 break; 108 default: 109 panic("Unimplemented trap to operating system: trap number %#x.\n", trapNum); 110 } 111} 112 113void 114SparcLiveProcess::initState() --- 282 unchanged lines hidden (view full) --- 397 //tc->setIntReg(ArgumentReg[0], argc); 398 //tc->setIntReg(ArgumentReg[1], argv_array_base); 399 tc->setIntReg(StackPointerReg, stack_min - StackBias); 400 401 // %g1 is a pointer to a function that should be run at exit. Since we 402 // don't have anything like that, it should be set to 0. 403 tc->setIntReg(1, 0); 404 | 105 break; 106 default: 107 panic("Unimplemented trap to operating system: trap number %#x.\n", trapNum); 108 } 109} 110 111void 112SparcLiveProcess::initState() --- 282 unchanged lines hidden (view full) --- 395 //tc->setIntReg(ArgumentReg[0], argc); 396 //tc->setIntReg(ArgumentReg[1], argv_array_base); 397 tc->setIntReg(StackPointerReg, stack_min - StackBias); 398 399 // %g1 is a pointer to a function that should be run at exit. Since we 400 // don't have anything like that, it should be set to 0. 401 tc->setIntReg(1, 0); 402 |
405 Addr prog_entry = objFile->entryPoint(); 406 tc->setPC(prog_entry); 407 tc->setNextPC(prog_entry + sizeof(MachInst)); 408 tc->setNextNPC(prog_entry + (2 * sizeof(MachInst))); | 403 tc->pcState(objFile->entryPoint()); |
409 410 //Align the "stack_min" to a page boundary. 411 stack_min = roundDown(stack_min, pageSize); 412 413// num_processes++; 414} 415 416void --- 152 unchanged lines hidden --- | 404 405 //Align the "stack_min" to a page boundary. 406 stack_min = roundDown(stack_min, pageSize); 407 408// num_processes++; 409} 410 411void --- 152 unchanged lines hidden --- |