blob: babe916bc5fa235b3e79e2fa2afc107538375049 [file] [log] [blame]
njn5c004e42002-11-18 11:04:50 +00001
2/*--------------------------------------------------------------------*/
njn43c799e2003-04-08 00:08:52 +00003/*--- Declarations shared between MemCheck and AddrCheck. ---*/
4/*--- mac_shared.h ---*/
njn5c004e42002-11-18 11:04:50 +00005/*--------------------------------------------------------------------*/
6
7/*
8 This file is part of MemCheck, a heavyweight Valgrind skin for
9 detecting memory errors, and AddrCheck, a lightweight Valgrind skin
10 for detecting memory errors.
11
njn0e1b5142003-04-15 14:58:06 +000012 Copyright (C) 2000-2003 Julian Seward
njn5c004e42002-11-18 11:04:50 +000013 jseward@acm.org
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License as
17 published by the Free Software Foundation; either version 2 of the
18 License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 02111-1307, USA.
29
30 The GNU General Public License is contained in the file COPYING.
31*/
32
njn43c799e2003-04-08 00:08:52 +000033/* Note: This header contains the declarations shared between
34 Addrcheck and Memcheck, and is #included by both. */
35
36#ifndef __MAC_SHARED_H
37#define __MAC_SHARED_H
njn5c004e42002-11-18 11:04:50 +000038
39#include "vg_skin.h"
njn43c799e2003-04-08 00:08:52 +000040
41#define MAC_(str) VGAPPEND(vgMAC_,str)
njn5c004e42002-11-18 11:04:50 +000042
njn9b007f62003-04-07 14:40:25 +000043/*------------------------------------------------------------*/
44/*--- Errors and suppressions ---*/
45/*------------------------------------------------------------*/
46
njn5c004e42002-11-18 11:04:50 +000047/* The classification of a faulting address. */
48typedef
njn43c799e2003-04-08 00:08:52 +000049 enum {
50 Undescribed, /* as-yet unclassified */
51 Stack,
52 Unknown, /* classification yielded nothing useful */
53 Freed, Mallocd,
54 UserG /* in a user-defined block; Addrcheck & Memcheck only */
njn5c004e42002-11-18 11:04:50 +000055 }
56 AddrKind;
57
58/* Records info about a faulting address. */
59typedef
60 struct {
61 /* ALL */
62 AddrKind akind;
63 /* Freed, Mallocd */
64 Int blksize;
65 /* Freed, Mallocd */
66 Int rwoffset;
67 /* Freed, Mallocd */
68 ExeContext* lastchange;
69 /* Stack */
70 ThreadId stack_tid;
71 /* True if is just-below %esp -- could be a gcc bug. */
72 Bool maybe_gcc;
73 }
74 AddrInfo;
75
76typedef
77 enum {
78 /* Bad syscall params */
79 ParamSupp,
80 /* Memory errors in core (pthread ops, signal handling) */
81 CoreMemSupp,
82 /* Use of invalid values of given size (MemCheck only) */
83 Value0Supp, Value1Supp, Value2Supp, Value4Supp, Value8Supp,
84 /* Invalid read/write attempt at given size */
85 Addr1Supp, Addr2Supp, Addr4Supp, Addr8Supp,
86 /* Invalid or mismatching free */
sewardj99aac972002-12-26 01:53:45 +000087 FreeSupp,
88 /* Something to be suppressed in a leak check. */
89 LeakSupp
njn5c004e42002-11-18 11:04:50 +000090 }
njn43c799e2003-04-08 00:08:52 +000091 MAC_SuppKind;
njn5c004e42002-11-18 11:04:50 +000092
93/* What kind of error it is. */
94typedef
95 enum { ValueErr, /* Memcheck only */
96 CoreMemErr,
97 AddrErr,
98 ParamErr, UserErr, /* behaves like an anonymous ParamErr */
njn43c799e2003-04-08 00:08:52 +000099 FreeErr, FreeMismatchErr,
100 LeakErr
njn5c004e42002-11-18 11:04:50 +0000101 }
njn43c799e2003-04-08 00:08:52 +0000102 MAC_ErrorKind;
njn5c004e42002-11-18 11:04:50 +0000103
104/* What kind of memory access is involved in the error? */
105typedef
106 enum { ReadAxs, WriteAxs, ExecAxs }
107 AxsKind;
108
109/* Extra context for memory errors */
110typedef
111 struct {
112 /* AddrErr */
113 AxsKind axskind;
114 /* AddrErr, ValueErr */
115 Int size;
116 /* AddrErr, FreeErr, FreeMismatchErr, ParamErr, UserErr */
117 AddrInfo addrinfo;
118 /* ParamErr, UserErr, CoreMemErr */
119 Bool isWrite;
120 }
njn43c799e2003-04-08 00:08:52 +0000121 MAC_Error;
njn5c004e42002-11-18 11:04:50 +0000122
njn3e884182003-04-15 13:03:23 +0000123/* For malloc()/new/new[] vs. free()/delete/delete[] mismatch checking. */
124typedef
125 enum {
126 MAC_AllocMalloc = 0,
127 MAC_AllocNew = 1,
128 MAC_AllocNewVec = 2
129 }
130 MAC_AllocKind;
131
132/* Nb: first two fields must match core's VgHashNode. */
133typedef
134 struct _MAC_Chunk {
135 struct _MAC_Chunk* next;
136 Addr data; /* ptr to actual block */
137 UInt size : 30; /* size requested */
138 MAC_AllocKind allockind : 2; /* which wrapper did the allocation */
139 ExeContext* where; /* where it was allocated */
140 }
141 MAC_Chunk;
142
njn9b007f62003-04-07 14:40:25 +0000143/*------------------------------------------------------------*/
144/*--- Profiling of skins and memory events ---*/
145/*------------------------------------------------------------*/
146
147typedef
148 enum {
149 VgpCheckMem = VgpFini+1,
150 VgpSetMem,
151 VgpESPAdj
152 }
153 VgpSkinCC;
154
155/* Define to collect detailed performance info. */
njn43c799e2003-04-08 00:08:52 +0000156/* #define MAC_PROFILE_MEMORY */
njn5c004e42002-11-18 11:04:50 +0000157
njn43c799e2003-04-08 00:08:52 +0000158#ifdef MAC_PROFILE_MEMORY
njn9b007f62003-04-07 14:40:25 +0000159# define N_PROF_EVENTS 150
njn5c004e42002-11-18 11:04:50 +0000160
njn43c799e2003-04-08 00:08:52 +0000161extern UInt MAC_(event_ctr)[N_PROF_EVENTS];
njn9b007f62003-04-07 14:40:25 +0000162
njn43c799e2003-04-08 00:08:52 +0000163# define PROF_EVENT(ev) \
164 do { sk_assert((ev) >= 0 && (ev) < N_PROF_EVENTS); \
165 MAC_(event_ctr)[ev]++; \
njn5c004e42002-11-18 11:04:50 +0000166 } while (False);
167
168#else
169
njn9b007f62003-04-07 14:40:25 +0000170# define PROF_EVENT(ev) /* */
njn5c004e42002-11-18 11:04:50 +0000171
njn43c799e2003-04-08 00:08:52 +0000172#endif /* MAC_PROFILE_MEMORY */
njn5c004e42002-11-18 11:04:50 +0000173
njn9b007f62003-04-07 14:40:25 +0000174/*------------------------------------------------------------*/
175/*--- V and A bits ---*/
176/*------------------------------------------------------------*/
177
njn5c004e42002-11-18 11:04:50 +0000178#define IS_DISTINGUISHED_SM(smap) \
179 ((smap) == &distinguished_secondary_map)
180
njn43c799e2003-04-08 00:08:52 +0000181#define ENSURE_MAPPABLE(addr,caller) \
182 do { \
njn5c004e42002-11-18 11:04:50 +0000183 if (IS_DISTINGUISHED_SM(primary_map[(addr) >> 16])) { \
184 primary_map[(addr) >> 16] = alloc_secondary_map(caller); \
njn43c799e2003-04-08 00:08:52 +0000185 /* VG_(printf)("new 2map because of %p\n", addr); */ \
186 } \
njn5c004e42002-11-18 11:04:50 +0000187 } while(0)
188
189#define BITARR_SET(aaa_p,iii_p) \
190 do { \
191 UInt iii = (UInt)iii_p; \
192 UChar* aaa = (UChar*)aaa_p; \
193 aaa[iii >> 3] |= (1 << (iii & 7)); \
194 } while (0)
195
196#define BITARR_CLEAR(aaa_p,iii_p) \
197 do { \
198 UInt iii = (UInt)iii_p; \
199 UChar* aaa = (UChar*)aaa_p; \
200 aaa[iii >> 3] &= ~(1 << (iii & 7)); \
201 } while (0)
202
203#define BITARR_TEST(aaa_p,iii_p) \
204 (0 != (((UChar*)aaa_p)[ ((UInt)iii_p) >> 3 ] \
205 & (1 << (((UInt)iii_p) & 7)))) \
206
207
208#define VGM_BIT_VALID 0
209#define VGM_BIT_INVALID 1
210
211#define VGM_NIBBLE_VALID 0
212#define VGM_NIBBLE_INVALID 0xF
213
214#define VGM_BYTE_VALID 0
215#define VGM_BYTE_INVALID 0xFF
216
217#define VGM_WORD_VALID 0
218#define VGM_WORD_INVALID 0xFFFFFFFF
219
220#define VGM_EFLAGS_VALID 0xFFFFFFFE
221#define VGM_EFLAGS_INVALID 0xFFFFFFFF /* not used */
222
223/*------------------------------------------------------------*/
224/*--- Command line options + defaults ---*/
225/*------------------------------------------------------------*/
226
njn43c799e2003-04-08 00:08:52 +0000227/* Memcheck defines a couple more. */
njn5c004e42002-11-18 11:04:50 +0000228
229/* Allow loads from partially-valid addresses? default: YES */
njn43c799e2003-04-08 00:08:52 +0000230extern Bool MAC_(clo_partial_loads_ok);
njn5c004e42002-11-18 11:04:50 +0000231
232/* Max volume of the freed blocks queue. */
njn43c799e2003-04-08 00:08:52 +0000233extern Int MAC_(clo_freelist_vol);
njn5c004e42002-11-18 11:04:50 +0000234
235/* Do leak check at exit? default: NO */
njn43c799e2003-04-08 00:08:52 +0000236extern Bool MAC_(clo_leak_check);
njn5c004e42002-11-18 11:04:50 +0000237
238/* How closely should we compare ExeContexts in leak records? default: 2 */
njn43c799e2003-04-08 00:08:52 +0000239extern VgRes MAC_(clo_leak_resolution);
njn5c004e42002-11-18 11:04:50 +0000240
241/* In leak check, show reachable-but-not-freed blocks? default: NO */
njn43c799e2003-04-08 00:08:52 +0000242extern Bool MAC_(clo_show_reachable);
njn5c004e42002-11-18 11:04:50 +0000243
244/* Assume accesses immediately below %esp are due to gcc-2.96 bugs.
245 * default: NO*/
njn43c799e2003-04-08 00:08:52 +0000246extern Bool MAC_(clo_workaround_gcc296_bugs);
njn5c004e42002-11-18 11:04:50 +0000247
njn3e884182003-04-15 13:03:23 +0000248extern Bool MAC_(process_common_cmd_line_option) ( Char* arg );
249extern void MAC_(print_common_usage) ( void );
250extern void MAC_(print_common_debug_usage) ( void );
251
252
253/*------------------------------------------------------------*/
254/*--- Variables ---*/
255/*------------------------------------------------------------*/
256
257/* For tracking malloc'd blocks */
258extern VgHashTable MAC_(malloc_list);
259
260/* Function pointers for the two skins to track interesting events. */
261extern void (*MAC_(new_mem_heap)) ( Addr a, UInt len, Bool is_inited );
262extern void (*MAC_(ban_mem_heap)) ( Addr a, UInt len );
263extern void (*MAC_(die_mem_heap)) ( Addr a, UInt len );
264extern void (*MAC_(copy_mem_heap))( Addr from, Addr to, UInt len );
265
266/* Used in describe_addr() */
267extern Bool (*MAC_(describe_addr_supp)) ( Addr a, AddrInfo* ai );
njn5c004e42002-11-18 11:04:50 +0000268
sewardj99aac972002-12-26 01:53:45 +0000269
njn5c004e42002-11-18 11:04:50 +0000270/*------------------------------------------------------------*/
271/*--- Functions ---*/
272/*------------------------------------------------------------*/
273
njn43c799e2003-04-08 00:08:52 +0000274extern void MAC_(pp_AddrInfo) ( Addr a, AddrInfo* ai );
njn5c004e42002-11-18 11:04:50 +0000275
njn43c799e2003-04-08 00:08:52 +0000276extern void MAC_(clear_MAC_Error) ( MAC_Error* err_extra );
njn5c004e42002-11-18 11:04:50 +0000277
njn43c799e2003-04-08 00:08:52 +0000278extern Bool MAC_(shared_recognised_suppression) ( Char* name, Supp* su );
njn5c004e42002-11-18 11:04:50 +0000279
njn43c799e2003-04-08 00:08:52 +0000280extern void MAC_(record_address_error) ( Addr a, Int size, Bool isWrite );
281extern void MAC_(record_core_mem_error) ( ThreadState* tst, Bool isWrite,
282 Char* s );
283extern void MAC_(record_param_error) ( ThreadState* tst, Addr a,
284 Bool isWriteLack, Char* msg );
285extern void MAC_(record_jump_error) ( ThreadState* tst, Addr a );
286extern void MAC_(record_free_error) ( ThreadState* tst, Addr a );
287extern void MAC_(record_freemismatch_error)( ThreadState* tst, Addr a );
njn5c004e42002-11-18 11:04:50 +0000288
njn43c799e2003-04-08 00:08:52 +0000289extern void MAC_(pp_shared_SkinError) ( Error* err);
290
njn3e884182003-04-15 13:03:23 +0000291extern MAC_Chunk* MAC_(first_matching_freed_MAC_Chunk)( Bool (*p)(MAC_Chunk*) );
njn43c799e2003-04-08 00:08:52 +0000292
njn3e884182003-04-15 13:03:23 +0000293extern void MAC_(common_pre_clo_init) ( void );
294extern void MAC_(common_fini) ( void (*leak_check)(void) );
295
296extern void MAC_(print_malloc_stats) ( void );
njn43c799e2003-04-08 00:08:52 +0000297
298/* For leak checking */
299extern void MAC_(pp_LeakError)(void* vl, UInt n_this_record,
300 UInt n_total_records);
301
302extern void MAC_(do_detect_memory_leaks) (
303 Bool is_valid_64k_chunk ( UInt ),
304 Bool is_valid_address ( Addr )
305 );
306
307extern __attribute__((regparm(1))) void MAC_(new_mem_stack_4) ( Addr old_ESP );
308extern __attribute__((regparm(1))) void MAC_(die_mem_stack_4) ( Addr old_ESP );
309extern __attribute__((regparm(1))) void MAC_(new_mem_stack_8) ( Addr old_ESP );
310extern __attribute__((regparm(1))) void MAC_(die_mem_stack_8) ( Addr old_ESP );
311extern __attribute__((regparm(1))) void MAC_(new_mem_stack_12) ( Addr old_ESP );
312extern __attribute__((regparm(1))) void MAC_(die_mem_stack_12) ( Addr old_ESP );
313extern __attribute__((regparm(1))) void MAC_(new_mem_stack_16) ( Addr old_ESP );
314extern __attribute__((regparm(1))) void MAC_(die_mem_stack_16) ( Addr old_ESP );
315extern __attribute__((regparm(1))) void MAC_(new_mem_stack_32) ( Addr old_ESP );
316extern __attribute__((regparm(1))) void MAC_(die_mem_stack_32) ( Addr old_ESP );
njn3e884182003-04-15 13:03:23 +0000317extern void MAC_(die_mem_stack) ( Addr a, UInt len);
318extern void MAC_(new_mem_stack) ( Addr a, UInt len);
njn9b007f62003-04-07 14:40:25 +0000319
320
321/*------------------------------------------------------------*/
322/*--- Stack pointer adjustment ---*/
323/*------------------------------------------------------------*/
324
325/* Some noble preprocessor abuse, to enable Memcheck and Addrcheck to
njn3e884182003-04-15 13:03:23 +0000326 share this code, but call different functions.
njn9b007f62003-04-07 14:40:25 +0000327
328 Note that this code is executed very frequently and must be highly
329 optimised, which is why I resort to the preprocessor to achieve the
330 factoring, rather than eg. using function pointers.
331*/
332
333#define ESP_UPDATE_HANDLERS(ALIGNED4_NEW, ALIGNED4_DIE, \
334 ALIGNED8_NEW, ALIGNED8_DIE, \
335 UNALIGNED_NEW, UNALIGNED_DIE) \
336 \
njn43c799e2003-04-08 00:08:52 +0000337void __attribute__((regparm(1))) MAC_(new_mem_stack_4)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000338{ \
339 PROF_EVENT(110); \
340 if (IS_ALIGNED4_ADDR(new_ESP)) { \
341 ALIGNED4_NEW ( new_ESP ); \
342 } else { \
343 UNALIGNED_NEW ( new_ESP, 4 ); \
344 } \
345} \
346 \
njn43c799e2003-04-08 00:08:52 +0000347void __attribute__((regparm(1))) MAC_(die_mem_stack_4)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000348{ \
349 PROF_EVENT(120); \
350 if (IS_ALIGNED4_ADDR(new_ESP)) { \
351 ALIGNED4_DIE ( new_ESP-4 ); \
352 } else { \
353 UNALIGNED_DIE ( new_ESP-4, 4 ); \
354 } \
355} \
356 \
njn43c799e2003-04-08 00:08:52 +0000357void __attribute__((regparm(1))) MAC_(new_mem_stack_8)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000358{ \
359 PROF_EVENT(111); \
360 if (IS_ALIGNED8_ADDR(new_ESP)) { \
361 ALIGNED8_NEW ( new_ESP ); \
362 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
363 ALIGNED4_NEW ( new_ESP ); \
364 ALIGNED4_NEW ( new_ESP+4 ); \
365 } else { \
366 UNALIGNED_NEW ( new_ESP, 8 ); \
367 } \
368} \
369 \
njn43c799e2003-04-08 00:08:52 +0000370void __attribute__((regparm(1))) MAC_(die_mem_stack_8)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000371{ \
372 PROF_EVENT(121); \
373 if (IS_ALIGNED8_ADDR(new_ESP)) { \
374 ALIGNED8_DIE ( new_ESP-8 ); \
375 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
376 ALIGNED4_DIE ( new_ESP-8 ); \
377 ALIGNED4_DIE ( new_ESP-4 ); \
378 } else { \
379 UNALIGNED_DIE ( new_ESP-8, 8 ); \
380 } \
381} \
382 \
njn43c799e2003-04-08 00:08:52 +0000383void __attribute__((regparm(1))) MAC_(new_mem_stack_12)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000384{ \
385 PROF_EVENT(112); \
386 if (IS_ALIGNED8_ADDR(new_ESP)) { \
387 ALIGNED8_NEW ( new_ESP ); \
388 ALIGNED4_NEW ( new_ESP+8 ); \
389 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
390 ALIGNED4_NEW ( new_ESP ); \
391 ALIGNED8_NEW ( new_ESP+4 ); \
392 } else { \
393 UNALIGNED_NEW ( new_ESP, 12 ); \
394 } \
395} \
396 \
njn43c799e2003-04-08 00:08:52 +0000397void __attribute__((regparm(1))) MAC_(die_mem_stack_12)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000398{ \
399 PROF_EVENT(122); \
400 /* Note the -12 in the test */ \
401 if (IS_ALIGNED8_ADDR(new_ESP-12)) { \
402 ALIGNED8_DIE ( new_ESP-12 ); \
403 ALIGNED4_DIE ( new_ESP-4 ); \
404 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
405 ALIGNED4_DIE ( new_ESP-12 ); \
406 ALIGNED8_DIE ( new_ESP-8 ); \
407 } else { \
408 UNALIGNED_DIE ( new_ESP-12, 12 ); \
409 } \
410} \
411 \
njn43c799e2003-04-08 00:08:52 +0000412void __attribute__((regparm(1))) MAC_(new_mem_stack_16)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000413{ \
414 PROF_EVENT(113); \
415 if (IS_ALIGNED8_ADDR(new_ESP)) { \
416 ALIGNED8_NEW ( new_ESP ); \
417 ALIGNED8_NEW ( new_ESP+8 ); \
418 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
419 ALIGNED4_NEW ( new_ESP ); \
420 ALIGNED8_NEW ( new_ESP+4 ); \
421 ALIGNED4_NEW ( new_ESP+12 ); \
422 } else { \
423 UNALIGNED_NEW ( new_ESP, 16 ); \
424 } \
425} \
426 \
njn43c799e2003-04-08 00:08:52 +0000427void __attribute__((regparm(1))) MAC_(die_mem_stack_16)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000428{ \
429 PROF_EVENT(123); \
430 if (IS_ALIGNED8_ADDR(new_ESP)) { \
431 ALIGNED8_DIE ( new_ESP-16 ); \
432 ALIGNED8_DIE ( new_ESP-8 ); \
433 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
434 ALIGNED4_DIE ( new_ESP-16 ); \
435 ALIGNED8_DIE ( new_ESP-12 ); \
436 ALIGNED4_DIE ( new_ESP-4 ); \
437 } else { \
438 UNALIGNED_DIE ( new_ESP-16, 16 ); \
439 } \
440} \
441 \
njn43c799e2003-04-08 00:08:52 +0000442void __attribute__((regparm(1))) MAC_(new_mem_stack_32)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000443{ \
444 PROF_EVENT(114); \
445 if (IS_ALIGNED8_ADDR(new_ESP)) { \
446 ALIGNED8_NEW ( new_ESP ); \
447 ALIGNED8_NEW ( new_ESP+8 ); \
448 ALIGNED8_NEW ( new_ESP+16 ); \
449 ALIGNED8_NEW ( new_ESP+24 ); \
450 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
451 ALIGNED4_NEW ( new_ESP ); \
452 ALIGNED8_NEW ( new_ESP+4 ); \
453 ALIGNED8_NEW ( new_ESP+12 ); \
454 ALIGNED8_NEW ( new_ESP+20 ); \
455 ALIGNED4_NEW ( new_ESP+28 ); \
456 } else { \
457 UNALIGNED_NEW ( new_ESP, 32 ); \
458 } \
459} \
460 \
njn43c799e2003-04-08 00:08:52 +0000461void __attribute__((regparm(1))) MAC_(die_mem_stack_32)(Addr new_ESP) \
njn9b007f62003-04-07 14:40:25 +0000462{ \
463 PROF_EVENT(124); \
464 if (IS_ALIGNED8_ADDR(new_ESP)) { \
465 ALIGNED8_DIE ( new_ESP-32 ); \
466 ALIGNED8_DIE ( new_ESP-24 ); \
467 ALIGNED8_DIE ( new_ESP-16 ); \
468 ALIGNED8_DIE ( new_ESP- 8 ); \
469 } else if (IS_ALIGNED4_ADDR(new_ESP)) { \
470 ALIGNED4_DIE ( new_ESP-32 ); \
471 ALIGNED8_DIE ( new_ESP-28 ); \
472 ALIGNED8_DIE ( new_ESP-20 ); \
473 ALIGNED8_DIE ( new_ESP-12 ); \
474 ALIGNED4_DIE ( new_ESP-4 ); \
475 } else { \
476 UNALIGNED_DIE ( new_ESP-32, 32 ); \
477 } \
478} \
479 \
njn43c799e2003-04-08 00:08:52 +0000480void MAC_(new_mem_stack) ( Addr a, UInt len ) \
njn9b007f62003-04-07 14:40:25 +0000481{ \
482 PROF_EVENT(115); \
483 UNALIGNED_NEW ( a, len ); \
484} \
485 \
njn43c799e2003-04-08 00:08:52 +0000486void MAC_(die_mem_stack) ( Addr a, UInt len ) \
njn9b007f62003-04-07 14:40:25 +0000487{ \
488 PROF_EVENT(125); \
489 UNALIGNED_DIE ( a, len ); \
490}
491
njn43c799e2003-04-08 00:08:52 +0000492#endif /* __MAC_SHARED_H */
njn5c004e42002-11-18 11:04:50 +0000493
494/*--------------------------------------------------------------------*/
njn43c799e2003-04-08 00:08:52 +0000495/*--- end mac_shared.h ---*/
njn5c004e42002-11-18 11:04:50 +0000496/*--------------------------------------------------------------------*/