]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/contrib/ia64/libuwx/src/uwx_scoreboard.h
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / contrib / ia64 / libuwx / src / uwx_scoreboard.h
1 /*
2 Copyright (c) 2003-2006 Hewlett-Packard Development Company, L.P.
3 Permission is hereby granted, free of charge, to any person
4 obtaining a copy of this software and associated documentation
5 files (the "Software"), to deal in the Software without
6 restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the
9 Software is furnished to do so, subject to the following
10 conditions:
11
12 The above copyright notice and this permission notice shall be
13 included in all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 #define NSB_SPECIAL     9
26 #define NSB_GR          4
27 #define NSB_BR          5
28 #define NSB_FR          20
29
30 #define SBREG_RP        0
31 #define SBREG_PSP       1
32 #define SBREG_PFS       2
33 #define SBREG_PREDS     3
34 #define SBREG_UNAT      4
35 #define SBREG_PRIUNAT   5
36 #define SBREG_RNAT      6
37 #define SBREG_LC        7
38 #define SBREG_FPSR      8
39 #define SBREG_GR        (0 + NSB_SPECIAL)
40 #define SBREG_BR        (SBREG_GR + NSB_GR)
41 #define SBREG_FR        (SBREG_BR + NSB_BR)
42
43 #define NSBREG_NOFR     (NSB_SPECIAL + NSB_GR + NSB_BR)
44 #define NSBREG          (NSB_SPECIAL + NSB_GR + NSB_BR + NSB_FR)
45
46 struct uwx_scoreboard {
47     struct uwx_scoreboard *nextused;
48     struct uwx_scoreboard *nextfree;
49     struct uwx_scoreboard *nextstack;
50     struct uwx_scoreboard *nextlabel;
51     uint64_t rstate[NSBREG];
52     int label;
53     int id;
54     int prealloc;
55 };
56
57 extern void uwx_prealloc_scoreboard(
58     struct uwx_env *env,
59     struct uwx_scoreboard *sb);
60
61 extern struct uwx_scoreboard *uwx_alloc_scoreboard(struct uwx_env *env);
62
63 extern struct uwx_scoreboard *uwx_init_scoreboards(struct uwx_env *env);
64
65 extern struct uwx_scoreboard *uwx_new_scoreboard(
66     struct uwx_env *env,
67     struct uwx_scoreboard *prevsb);
68
69 extern struct uwx_scoreboard *uwx_pop_scoreboards(
70     struct uwx_env *env,
71     struct uwx_scoreboard *sb,
72     int ecount);
73
74 extern int uwx_label_scoreboard(
75     struct uwx_env *env,
76     struct uwx_scoreboard *sb,
77     int label);
78
79 extern int uwx_copy_scoreboard(
80     struct uwx_env *env,
81     struct uwx_scoreboard *sb,
82     int label);
83
84 extern void uwx_free_scoreboards(struct uwx_env *env);