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