Deleted Added
sdiff udiff text old ( 8539:7d3ea3c65c66 ) new ( 8601:af28085882dc )
full compact
1/*
2 * Copyright (c) 2001-2005 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;

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

164 // mark remaining fds as free
165 for (int i = 3; i <= MAX_FD; ++i) {
166 Process::FdMap *fdo = &fd_map[i];
167 fdo->fd = -1;
168 }
169
170 mmap_start = mmap_end = 0;
171 nxm_start = nxm_end = 0;
172 pTable = new PageTable(this);
173 // other parameters will be initialized when the program is loaded
174}
175
176
177void
178Process::regStats()
179{
180 using namespace Stats;

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

323Process::sim_fd_obj(int tgt_fd)
324{
325 if (tgt_fd < 0 || tgt_fd > MAX_FD)
326 return NULL;
327
328 return &fd_map[tgt_fd];
329}
330
331bool
332Process::fixupStackFault(Addr vaddr)
333{
334 // Check if this is already on the stack and there's just no page there
335 // yet.
336 if (vaddr >= stack_min && vaddr < stack_base) {
337 pTable->allocate(roundDown(vaddr, VMPageSize), VMPageSize);
338 return true;
339 }
340
341 // We've accessed the next page of the stack, so extend it to include
342 // this address.
343 if (vaddr < stack_min && vaddr >= stack_base - max_stack_size) {
344 while (vaddr < stack_min) {
345 stack_min -= TheISA::PageBytes;
346 if (stack_base - stack_min > max_stack_size)
347 fatal("Maximum stack size exceeded\n");
348 if (stack_base - stack_min > 8 * 1024 * 1024)
349 fatal("Over max stack size for one thread\n");
350 pTable->allocate(stack_min, TheISA::PageBytes);
351 inform("Increasing stack size by one page.");
352 };
353 return true;
354 }
355 warn("Not extending stack: address %#x isn't at the end of the stack.",
356 vaddr);
357 return false;
358}

--- 377 unchanged lines hidden ---