utility.cc (9880:3fda7e22041b) | utility.cc (9887:8c3a49bd7423) |
---|---|
1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * Copyright (c) 2011 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 37 unchanged lines hidden (view full) --- 46#include "cpu/base.hh" 47#include "sim/system.hh" 48 49namespace X86ISA { 50 51uint64_t 52getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) 53{ | 1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * Copyright (c) 2011 Advanced Micro Devices, Inc. 4 * All rights reserved. 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 37 unchanged lines hidden (view full) --- 46#include "cpu/base.hh" 47#include "sim/system.hh" 48 49namespace X86ISA { 50 51uint64_t 52getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp) 53{ |
54 panic("getArgument() not implemented for x86!\n"); 55 M5_DUMMY_RETURN | 54 if (!FullSystem) { 55 panic("getArgument() only implemented for full system mode.\n"); 56 } else if (fp) { 57 panic("getArgument(): Floating point arguments not implemented\n"); 58 } else if (size != 8) { 59 panic("getArgument(): Can only handle 64-bit arguments.\n"); 60 } 61 62 // The first 6 integer arguments are passed in registers, the rest 63 // are passed on the stack. 64 const int int_reg_map[] = { 65 INTREG_RDI, INTREG_RSI, INTREG_RDX, 66 INTREG_RCX, INTREG_R8, INTREG_R9 67 }; 68 if (number < sizeof(int_reg_map) / sizeof(*int_reg_map)) { 69 return tc->readIntReg(int_reg_map[number]); 70 } else { 71 panic("getArgument(): Don't know how to handle stack arguments.\n"); 72 } |
56} 57 58void initCPU(ThreadContext *tc, int cpuId) 59{ 60 // This function is essentially performing a reset. The actual INIT 61 // interrupt does a subset of this, so we'll piggyback on some of its 62 // functionality. 63 InitInterrupt init(0); --- 274 unchanged lines hidden --- | 73} 74 75void initCPU(ThreadContext *tc, int cpuId) 76{ 77 // This function is essentially performing a reset. The actual INIT 78 // interrupt does a subset of this, so we'll piggyback on some of its 79 // functionality. 80 InitInterrupt init(0); --- 274 unchanged lines hidden --- |