arguments.hh (8706:b1838faf3bcc) arguments.hh (9034:8b9f227b64d8)
1/*
2 * Copyright (c) 2003-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;

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

132 assert(sizeof(T) <= sizeof(uint64_t));
133 T data = static_cast<T>(getArg(sizeof(T)));
134 return data;
135 }
136
137 template <class T>
138 operator T *() {
139 T *buf = (T *)data->alloc(sizeof(T));
1/*
2 * Copyright (c) 2003-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;

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

132 assert(sizeof(T) <= sizeof(uint64_t));
133 T data = static_cast<T>(getArg(sizeof(T)));
134 return data;
135 }
136
137 template <class T>
138 operator T *() {
139 T *buf = (T *)data->alloc(sizeof(T));
140 CopyData(tc, buf, getArg(sizeof(T)), sizeof(T));
140 CopyOut(tc, buf, getArg(sizeof(T)), sizeof(T));
141 return buf;
142 }
143
144 operator char *() {
145 char *buf = data->alloc(2048);
146 CopyStringOut(tc, buf, getArg(), 2048);
147 return buf;
148 }
149};
150
151#endif // __SIM_ARGUMENTS_HH__
141 return buf;
142 }
143
144 operator char *() {
145 char *buf = data->alloc(2048);
146 CopyStringOut(tc, buf, getArg(), 2048);
147 return buf;
148 }
149};
150
151#endif // __SIM_ARGUMENTS_HH__