uwx_scoreboard.h revision 115013
1115013Smarcel/*
2115013Smarcel * Copyright (c) 2002,2003 Hewlett-Packard Company
3115013Smarcel *
4115013Smarcel * Permission is hereby granted, free of charge, to any person obtaining a
5115013Smarcel * copy of this software and associated documentation files (the "Software"),
6115013Smarcel * to deal in the Software without restriction, including without limitation
7115013Smarcel * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8115013Smarcel * and/or sell copies of the Software, and to permit persons to whom the
9115013Smarcel * Software is furnished to do so, subject to the following conditions:
10115013Smarcel *
11115013Smarcel * The above copyright notice and this permission notice shall be included
12115013Smarcel * in all copies or substantial portions of the Software.
13115013Smarcel *
14115013Smarcel * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15115013Smarcel * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16115013Smarcel * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17115013Smarcel * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18115013Smarcel * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19115013Smarcel * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20115013Smarcel * DEALINGS IN THE SOFTWARE.
21115013Smarcel */
22115013Smarcel
23115013Smarcel#define NSB_SPECIAL	9
24115013Smarcel#define NSB_GR		4
25115013Smarcel#define NSB_BR		5
26115013Smarcel#define NSB_FR		20
27115013Smarcel
28115013Smarcel#define SBREG_RP	0
29115013Smarcel#define SBREG_PSP	1
30115013Smarcel#define SBREG_PFS	2
31115013Smarcel#define SBREG_PREDS	3
32115013Smarcel#define SBREG_UNAT	4
33115013Smarcel#define SBREG_PRIUNAT	5
34115013Smarcel#define SBREG_RNAT	6
35115013Smarcel#define SBREG_LC	7
36115013Smarcel#define SBREG_FPSR	8
37115013Smarcel#define SBREG_GR	(0 + NSB_SPECIAL)
38115013Smarcel#define SBREG_BR	(SBREG_GR + NSB_GR)
39115013Smarcel#define SBREG_FR	(SBREG_BR + NSB_BR)
40115013Smarcel
41115013Smarcel#define NSBREG_NOFR	(NSB_SPECIAL + NSB_GR + NSB_BR)
42115013Smarcel#define NSBREG		(NSB_SPECIAL + NSB_GR + NSB_BR + NSB_FR)
43115013Smarcel
44115013Smarcelstruct uwx_scoreboard {
45115013Smarcel    struct uwx_scoreboard *nextused;
46115013Smarcel    struct uwx_scoreboard *nextfree;
47115013Smarcel    struct uwx_scoreboard *nextstack;
48115013Smarcel    struct uwx_scoreboard *nextlabel;
49115013Smarcel    uint64_t rstate[NSBREG];
50115013Smarcel    int label;
51115013Smarcel    int id;
52115013Smarcel};
53115013Smarcel
54115013Smarcelextern struct uwx_scoreboard *uwx_alloc_scoreboard(struct uwx_env *env);
55115013Smarcel
56115013Smarcelextern struct uwx_scoreboard *uwx_init_scoreboards(struct uwx_env *env);
57115013Smarcel
58115013Smarcelextern struct uwx_scoreboard *uwx_new_scoreboard(
59115013Smarcel    struct uwx_env *env,
60115013Smarcel    struct uwx_scoreboard *prevsb);
61115013Smarcel
62115013Smarcelextern struct uwx_scoreboard *uwx_pop_scoreboards(
63115013Smarcel    struct uwx_env *env,
64115013Smarcel    struct uwx_scoreboard *sb,
65115013Smarcel    int ecount);
66115013Smarcel
67115013Smarcelextern int uwx_label_scoreboard(
68115013Smarcel    struct uwx_env *env,
69115013Smarcel    struct uwx_scoreboard *sb,
70115013Smarcel    int label);
71115013Smarcel
72115013Smarcelextern int uwx_copy_scoreboard(
73115013Smarcel    struct uwx_env *env,
74115013Smarcel    struct uwx_scoreboard *sb,
75115013Smarcel    int label);
76115013Smarcel
77115013Smarcelextern void uwx_free_scoreboards(struct uwx_env *env);
78