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

Subversion Repositories aemb

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

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

Line No. Rev Author Line
1 107 sybreon
/* $Id: heap.hh,v 1.1 2008-04-09 19:48:37 sybreon Exp $
2
**
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
** under the terms of the GNU Lesser General Public License as
10
** published by the Free Software Foundation, either version 3 of the
11
** License, or (at your option) any later version.
12
**
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
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
16
** Public License for more details.
17
**
18
** You should have received a copy of the GNU Lesser General Public
19
** License along with AEMB. If not, see .
20
*/
21
 
22
/**
23
   Basic heap related functions
24
   @file heap.hh
25
 */
26
 
27
#ifndef AEMB_HEAP_HH
28
#define AEMB_HEAP_HH
29
 
30
namespace aemb {
31
 
32
  /**
33
  Extracts the heap size from the linker
34
  @return heap size
35
  */
36
 
37
  inline int getHeapSize()
38
  {
39
    int tmp;
40
    asm ("la %0, r0, _HEAP_SIZE":"=r"(tmp));
41
    return tmp;
42
  }
43
 
44
  /**
45
  Extracts the heap end from the linker
46
  @return heap end
47
  */
48
 
49
  inline int getHeapEnd()
50
  {
51
    int tmp;
52
    asm ("la %0, r0, _heap_end":"=r"(tmp));
53
    return tmp;
54
  }
55
 
56
  /**
57
  Extracts the heap top from the linker
58
  @return heap top
59
  */
60
 
61
  inline int getHeapTop()
62
  {
63
    int tmp;
64
    asm ("la %0, r0, _heap":"=r"(tmp));
65
    return tmp;
66
  }
67
}
68
#endif
69
 
70
/*
71
  $Log: not supported by cvs2svn $
72
*/

powered by: WebSVN 2.1.0

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