xref: /netbsd-src/external/gpl3/binutils.old/dist/gprofng/src/SegMem.h (revision 4439cfd0acf9c7dc90625e5cd83b2317a9ab8967)
1 /* Copyright (C) 2021 Free Software Foundation, Inc.
2    Contributed by Oracle.
3 
4    This file is part of GNU Binutils.
5 
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3, or (at your option)
9    any later version.
10 
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, 51 Franklin Street - Fifth Floor, Boston,
19    MA 02110-1301, USA.  */
20 
21 #ifndef _SEGMEM_H
22 #define _SEGMEM_H
23 
24 #include "dbe_types.h"
25 class Histable;
26 
27 class SegMem
28 {
29 public:
30 
31   // The various segments types.
32   enum Seg_mode
33   {
34     READ,
35     WRITE,
36     EXEC,
37     UNKNOWN
38   };
39 
40   void
41   set_file_offset (uint64_t fo)
42   {
43     file_offset = fo;
44   }
45 
46   uint64_t
47   get_file_offset ()
48   {
49     return file_offset;
50   }
51 
52   void
53   set_mode (Seg_mode sm)
54   {
55     mode = sm;
56   }
57 
58   Seg_mode
59   get_mode ()
60   {
61     return mode;
62   }
63 
64   Size size;            // Size of this instance
65   Histable *obj;        // Pointer to Segment/Function object
66   Vaddr base;           // Base address
67   hrtime_t load_time;
68   hrtime_t unload_time;
69   Size page_size;
70 
71 private:
72   uint64_t file_offset;
73   Seg_mode mode;
74 };
75 
76 #endif /* _SEGMEM_H */
77