Deleted Added
sdiff udiff text old ( 3114:7a4771b9b720 ) new ( 3415:72c48f292f6a )
full compact
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;

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

61 stack_base = (Addr)0x80000000000ULL;
62
63 // Set up region for mmaps. Tru64 seems to start just above 0 and
64 // grow up from there.
65 mmap_start = mmap_end = 0xfffff80000000000ULL;
66
67 // Set pointer for next thread stack. Reserve 8M for main stack.
68 next_thread_stack_base = stack_base - (8 * 1024 * 1024);
69}
70
71void
72SparcLiveProcess::startup()
73{
74 argsInit(MachineBytes, VMPageSize);
75
76 //From the SPARC ABI

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

83
84 threadContexts[0]->setMiscReg(MISCREG_TICK, 0);
85 //
86 /*
87 * Register window management registers
88 */
89
90 //No windows contain info from other programs
91 threadContexts[0]->setMiscRegWithEffect(MISCREG_OTHERWIN, 0);
92 //There are no windows to pop
93 threadContexts[0]->setMiscRegWithEffect(MISCREG_CANRESTORE, 0);
94 //All windows are available to save into
95 threadContexts[0]->setMiscRegWithEffect(MISCREG_CANSAVE, NWindows - 2);
96 //All windows are "clean"
97 threadContexts[0]->setMiscRegWithEffect(MISCREG_CLEANWIN, NWindows);
98 //Start with register window 0
99 threadContexts[0]->setMiscRegWithEffect(MISCREG_CWP, 0);
100}
101
102m5_auxv_t buildAuxVect(int64_t type, int64_t val)
103{
104 m5_auxv_t result;
105 result.a_type = TheISA::htog(type);
106 result.a_val = TheISA::htog(val);
107 return result;
108}
109
110void
111SparcLiveProcess::argsInit(int intSize, int pageSize)
112{
113 Process::startup();
114
115 string filename;
116 if(argv.size() < 1)
117 filename = "";

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

312 initVirtMem->writeBlob(auxv_array_base + 2 * intSize * auxv.size(),
313 (uint8_t*)&zero, 2 * intSize);
314
315 copyStringArray(envp, envp_array_base, env_data_base, initVirtMem);
316 copyStringArray(argv, argv_array_base, arg_data_base, initVirtMem);
317
318 initVirtMem->writeBlob(argc_base, (uint8_t*)&guestArgc, intSize);
319
320 threadContexts[0]->setIntReg(ArgumentReg0, argc);
321 threadContexts[0]->setIntReg(ArgumentReg1, argv_array_base);
322 threadContexts[0]->setIntReg(StackPointerReg, stack_min - StackBias);
323
324 Addr prog_entry = objFile->entryPoint();
325 threadContexts[0]->setPC(prog_entry);
326 threadContexts[0]->setNextPC(prog_entry + sizeof(MachInst));
327 threadContexts[0]->setNextNPC(prog_entry + (2 * sizeof(MachInst)));
328
329// num_processes++;
330}