uwx_scoreboard.h revision 160158
118334Speter/*
2110611SkanCopyright (c) 2003-2006 Hewlett-Packard Development Company, L.P.
390075SobrienPermission is hereby granted, free of charge, to any person
418334Speterobtaining a copy of this software and associated documentation
590075Sobrienfiles (the "Software"), to deal in the Software without
618334Speterrestriction, including without limitation the rights to use,
790075Sobriencopy, modify, merge, publish, distribute, sublicense, and/or sell
890075Sobriencopies of the Software, and to permit persons to whom the
990075SobrienSoftware is furnished to do so, subject to the following
1090075Sobrienconditions:
1118334Speter
1290075SobrienThe above copyright notice and this permission notice shall be
1390075Sobrienincluded in all copies or substantial portions of the Software.
1490075Sobrien
1590075SobrienTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1618334SpeterEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1718334SpeterOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1890075SobrienNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1990075SobrienHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2090075SobrienWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2118334SpeterFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2290075SobrienOTHER DEALINGS IN THE SOFTWARE.
2390075Sobrien*/
2418334Speter
2550397Sobrien#define NSB_SPECIAL	9
2652284Sobrien#define NSB_GR		4
2752284Sobrien#define NSB_BR		5
2890075Sobrien#define NSB_FR		20
29117395Skan
3018334Speter#define SBREG_RP	0
3190075Sobrien#define SBREG_PSP	1
3290075Sobrien#define SBREG_PFS	2
3390075Sobrien#define SBREG_PREDS	3
3490075Sobrien#define SBREG_UNAT	4
3518334Speter#define SBREG_PRIUNAT	5
3690075Sobrien#define SBREG_RNAT	6
37117395Skan#define SBREG_LC	7
3890075Sobrien#define SBREG_FPSR	8
3950397Sobrien#define SBREG_GR	(0 + NSB_SPECIAL)
4050397Sobrien#define SBREG_BR	(SBREG_GR + NSB_GR)
4118334Speter#define SBREG_FR	(SBREG_BR + NSB_BR)
4250397Sobrien
4350397Sobrien#define NSBREG_NOFR	(NSB_SPECIAL + NSB_GR + NSB_BR)
4418334Speter#define NSBREG		(NSB_SPECIAL + NSB_GR + NSB_BR + NSB_FR)
4590075Sobrien
4690075Sobrienstruct uwx_scoreboard {
4790075Sobrien    struct uwx_scoreboard *nextused;
4850397Sobrien    struct uwx_scoreboard *nextfree;
4950397Sobrien    struct uwx_scoreboard *nextstack;
5018334Speter    struct uwx_scoreboard *nextlabel;
5150397Sobrien    uint64_t rstate[NSBREG];
5250397Sobrien    int label;
5350397Sobrien    int id;
5418334Speter    int prealloc;
5550397Sobrien};
5650397Sobrien
5718334Speterextern void uwx_prealloc_scoreboard(
5890075Sobrien    struct uwx_env *env,
5990075Sobrien    struct uwx_scoreboard *sb);
6090075Sobrien
6150397Sobrienextern struct uwx_scoreboard *uwx_alloc_scoreboard(struct uwx_env *env);
6250397Sobrien
6350397Sobrienextern struct uwx_scoreboard *uwx_init_scoreboards(struct uwx_env *env);
6418334Speter
6550397Sobrienextern struct uwx_scoreboard *uwx_new_scoreboard(
6650397Sobrien    struct uwx_env *env,
6750397Sobrien    struct uwx_scoreboard *prevsb);
6850397Sobrien
6950397Sobrienextern struct uwx_scoreboard *uwx_pop_scoreboards(
7050397Sobrien    struct uwx_env *env,
7150397Sobrien    struct uwx_scoreboard *sb,
7250397Sobrien    int ecount);
7350397Sobrien
7450397Sobrienextern int uwx_label_scoreboard(
7590075Sobrien    struct uwx_env *env,
7650397Sobrien    struct uwx_scoreboard *sb,
7750397Sobrien    int label);
7850397Sobrien
7990075Sobrienextern int uwx_copy_scoreboard(
8050397Sobrien    struct uwx_env *env,
8150397Sobrien    struct uwx_scoreboard *sb,
8250397Sobrien    int label);
8390075Sobrien
8450397Sobrienextern void uwx_free_scoreboards(struct uwx_env *env);
8550397Sobrien