process.cc revision 5154
12754Sksewell@umich.edu
22207SN/A/*
32207SN/A * Copyright (c) 2003-2004 The Regents of The University of Michigan
42207SN/A * All rights reserved.
52207SN/A *
62207SN/A * Redistribution and use in source and binary forms, with or without
72207SN/A * modification, are permitted provided that the following conditions are
82207SN/A * met: redistributions of source code must retain the above copyright
92207SN/A * notice, this list of conditions and the following disclaimer;
102207SN/A * redistributions in binary form must reproduce the above copyright
112207SN/A * notice, this list of conditions and the following disclaimer in the
122207SN/A * documentation and/or other materials provided with the distribution;
132207SN/A * neither the name of the copyright holders nor the names of its
142207SN/A * contributors may be used to endorse or promote products derived from
152207SN/A * this software without specific prior written permission.
162207SN/A *
172207SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
182207SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
192207SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
202207SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
212207SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
222207SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
232207SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
242207SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
252207SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262207SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
272207SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
282665Ssaidi@eecs.umich.edu *
292665Ssaidi@eecs.umich.edu * Authors: Gabe Black
302665Ssaidi@eecs.umich.edu *          Ali Saidi
312686Sksewell@umich.edu *          Korey Sewell
322207SN/A */
332207SN/A
342474SN/A#include "arch/mips/isa_traits.hh"
352207SN/A#include "arch/mips/process.hh"
362454SN/A#include "base/loader/object_file.hh"
372454SN/A#include "base/misc.hh"
382680Sktlim@umich.edu#include "cpu/thread_context.hh"
392474SN/A#include "sim/system.hh"
402207SN/A
412447SN/Ausing namespace std;
422474SN/Ausing namespace MipsISA;
432447SN/A
445154Sgblack@eecs.umich.eduMipsLiveProcess::MipsLiveProcess(LiveProcessParams * params,
455154Sgblack@eecs.umich.edu        ObjectFile *objFile)
465154Sgblack@eecs.umich.edu    : LiveProcess(params, objFile)
472474SN/A{
482686Sksewell@umich.edu    // Set up stack. On MIPS, stack starts at the top of kuseg
492686Sksewell@umich.edu    // user address space. MIPS stack grows down from here
502935Sksewell@umich.edu    stack_base = 0x7FFFFFFF;
512474SN/A
522474SN/A    // Set pointer for next thread stack.  Reserve 8M for main stack.
532474SN/A    next_thread_stack_base = stack_base - (8 * 1024 * 1024);
542474SN/A
552686Sksewell@umich.edu    // Set up break point (Top of Heap)
562686Sksewell@umich.edu    brk_point = objFile->dataBase() + objFile->dataSize() + objFile->bssSize();
572686Sksewell@umich.edu    brk_point = roundUp(brk_point, VMPageSize);
582686Sksewell@umich.edu
592686Sksewell@umich.edu    // Set up region for mmaps. For now, start at bottom of kuseg space.
602686Sksewell@umich.edu    mmap_start = mmap_end = 0x10000;
612474SN/A}
622474SN/A
632474SN/Avoid
642474SN/AMipsLiveProcess::startup()
652474SN/A{
662474SN/A    argsInit(MachineBytes, VMPageSize);
672474SN/A}
68