Skip to main content
summaryrefslogtreecommitdiffstats
blob: 34d74b613d414087c17fb25dc0ed712b06e34413 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*******************************************************************************
 * Copyright (c) 2009, 2010 Wind River Systems, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v1.0 which accompany this distribution.
 * The Eclipse Public License is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 * You may elect to redistribute this code under either of these licenses.
 *
 * Contributors:
 *     Wind River Systems - initial API and implementation
 *******************************************************************************/

/*
 * This module holds execution context memory maps.
 */
#ifndef D_memorymap
#define D_memorymap

#include <config.h>
#include <framework/context.h>
#include <framework/protocol.h>

#if SERVICE_MemoryMap

/*
 * Get memory maps for given context.
 * 'client_map' returns map entries that are created by the agent clients.
 * 'target_map' returns map entries that the agent has found on a target.
 * Return -1 and set errno if the context memory map cannot be retrieved.
 * Return 0 on success.
 */
extern int memory_map_get(Context * ctx, MemoryMap ** client_map, MemoryMap ** target_map);

/*
 * Functions that are used by context implementation to notify memory map services about map changes.
 */
extern void memory_map_event_module_loaded(Context * ctx);
extern void memory_map_event_code_section_ummapped(Context * ctx, ContextAddress addr, ContextAddress size);
extern void memory_map_event_module_unloaded(Context * ctx);
extern void memory_map_event_mapping_changed(Context * ctx);

/*
 * Memory map listener.
 */
typedef struct MemoryMapEventListener {
    void (*module_loaded)(Context * ctx, void * client_data);
    void (*code_section_ummapped)(Context * ctx, ContextAddress addr, ContextAddress size, void * client_data);
    void (*module_unloaded)(Context * ctx, void * client_data);
    void (*mapping_changed)(Context * ctx, void * client_data);
} MemoryMapEventListener;

/*
 * Add memory map listener.
 */
extern void add_memory_map_event_listener(MemoryMapEventListener * listener, void * client_data);

extern void ini_memory_map_service(Protocol * proto, TCFBroadcastGroup * bcg);

#else

#define memory_map_event_module_loaded(ctx)
#define memory_map_event_code_section_ummapped(ctx, addr, size)
#define memory_map_event_module_unloaded(ctx)
#define memory_map_event_mapping_changed(ctx)

#endif /* SERVICE_MemoryMap */
#endif /* D_memorymap */

Back to the top