OpenCores
URL https://opencores.org/ocsvn/aemb/aemb/trunk

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [cc/] [aemb/] [heap.hh] - Blame information for rev 207

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 151 sybreon
/* $Id: heap.hh,v 1.6 2008-04-28 20:29:15 sybreon Exp $
2 107 sybreon
**
3
** AEMB2 HI-PERFORMANCE CPU
4
** Copyright (C) 2004-2007 Shawn Tan Ser Ngiap 
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9 145 sybreon
** under the terms of the GNU General Public License as published by
10
** the Free Software Foundation, either version 3 of the License, or
11
** (at your option) any later version.
12 107 sybreon
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 145 sybreon
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16
** License for more details.
17 107 sybreon
**
18 145 sybreon
** You should have received a copy of the GNU General Public License
19
** along with AEMB.  If not, see .
20 107 sybreon
*/
21
 
22
/**
23
   Basic heap related functions
24
   @file heap.hh
25
 */
26
 
27 151 sybreon
#ifndef _AEMB_HEAP_HH
28
#define _AEMB_HEAP_HH
29 107 sybreon
 
30 139 sybreon
#ifdef __cplusplus
31 151 sybreon
extern "C" {
32 139 sybreon
#endif
33 107 sybreon
 
34
  /**
35
  Extracts the heap size from the linker
36
  @return heap size
37
  */
38
 
39 151 sybreon
  inline int aembGetHeapSize()
40 107 sybreon
  {
41
    int tmp;
42
    asm ("la %0, r0, _HEAP_SIZE":"=r"(tmp));
43
    return tmp;
44
  }
45
 
46
  /**
47
  Extracts the heap end from the linker
48
  @return heap end
49
  */
50
 
51 151 sybreon
  inline int aembGetHeapEnd()
52 107 sybreon
  {
53
    int tmp;
54
    asm ("la %0, r0, _heap_end":"=r"(tmp));
55
    return tmp;
56
  }
57
 
58
  /**
59
  Extracts the heap top from the linker
60
  @return heap top
61
  */
62
 
63 151 sybreon
  inline int aembGetHeapTop()
64 107 sybreon
  {
65
    int tmp;
66
    asm ("la %0, r0, _heap":"=r"(tmp));
67
    return tmp;
68
  }
69 137 sybreon
 
70 139 sybreon
#ifdef __cplusplus
71 107 sybreon
}
72 139 sybreon
#endif
73 107 sybreon
 
74 121 sybreon
#endif
75
 
76 107 sybreon
/*
77
  $Log: not supported by cvs2svn $
78 151 sybreon
  Revision 1.5  2008/04/27 16:33:42  sybreon
79
  License change to GPL3.
80
 
81 145 sybreon
  Revision 1.4  2008/04/26 19:31:35  sybreon
82
  Made headers C compatible.
83
 
84 139 sybreon
  Revision 1.3  2008/04/26 18:05:22  sybreon
85
  Minor cosmetic changes.
86
 
87 137 sybreon
  Revision 1.2  2008/04/20 16:35:53  sybreon
88
  Added C/C++ compatible #ifdef statements
89
 
90 121 sybreon
  Revision 1.1  2008/04/09 19:48:37  sybreon
91
  Added new C++ files
92
 
93 107 sybreon
*/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.