1 /* $NetBSD: stireg.h,v 1.5 2010/11/09 12:24:48 skrll Exp $ */ 2 3 /* $OpenBSD: stireg.h,v 1.13 2009/01/28 17:37:40 miod Exp $ */ 4 5 /* 6 * Copyright (c) 2000 Michael Shalayeff 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions 11 * are met: 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, 22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 #ifndef _IC_STIREG_H_ 32 #define _IC_STIREG_H_ 33 34 /* #define STIDEBUG */ 35 36 #define STI_REGION_MAX 8 37 #define STI_MONITOR_MAX 256 38 #define STI_DEVNAME_LEN 32 39 #define STI_NCMAP 256 40 41 /* code ROM definitions */ 42 #define STI_BEGIN 0 43 #define STI_INIT_GRAPH 0 44 #define STI_STATE_MGMT 1 45 #define STI_FONT_UNPMV 2 46 #define STI_BLOCK_MOVE 3 47 #define STI_SELF_TEST 4 48 #define STI_EXCEP_HDLR 5 49 #define STI_INQ_CONF 6 50 #define STI_SCM_ENT 7 51 #define STI_DMA_CTRL 8 52 #define STI_FLOW_CTRL 9 53 #define STI_UTIMING 10 54 #define STI_PROC_MGR 11 55 #define STI_UTIL 12 56 #define STI_END 13 57 #define STI_CODECNT 16 58 59 #define STI_CODEBASE_MAIN 0x40 60 #define STI_CODEBASE_ALT 0x80 61 62 #define STI_CODEBASE_PA STI_CODEBASE_MAIN 63 #define STI_CODEBASE_M68K STI_CODEBASE_ALT 64 #define STI_CODEBASE_PA64 STI_CODEBASE_ALT 65 66 /* sti returns */ 67 #define STI_OK 0 68 #define STI_FAIL -1 69 #define STI_NRDY 1 70 71 /* sti errno */ 72 #define STI_NOERRNO 0 /* no error */ 73 #define STI_BADREENTLVL 1 /* bad reentry level */ 74 #define STI_NOREGIONSDEF 2 /* region table is not setup */ 75 #define STI_ILLNPLANES 3 /* invalid num of text planes */ 76 #define STI_ILLINDEX 4 /* invalid font index */ 77 #define STI_ILLLOC 5 /* invalid font location */ 78 #define STI_ILLCOLOUR 6 /* invalid colour */ 79 #define STI_ILLBLKMVFROM 7 /* invalid from in blkmv */ 80 #define STI_ILLBLKMVTO 8 /* invalid to in blkmv */ 81 #define STI_ILLBLKMVSIZE 9 /* invalid size in blkmv */ 82 #define STI_BEIUNSUPP 10 /* bus error ints unsupported */ 83 #define STI_UNXPBE 11 /* unexpected bus error */ 84 #define STI_UNXHWF 12 /* unexpected hardware failure */ 85 #define STI_NEGCFG 13 /* no ext global config struct */ 86 #define STI_NEIG 14 /* no ext init struct */ 87 #define STI_ILLSCME 15 /* invalid set cmap entry */ 88 #define STI_ILLCMVAL 16 /* invalid cmap value */ 89 #define STI_NORESMEM 17 /* no requested global memory */ 90 #define STI_RESMEMCORR 18 /* reserved memory corrupted */ 91 #define STI_ILLNTBLKMV 19 /* invalid non-text blkmv */ 92 #define STI_ILLMONITOR 20 /* monitor selection is out of range */ 93 #define STI_ILLEXCADDR 21 /* invalid excpt handler addr */ 94 #define STI_ILLEXCFLAGS 22 /* invalid excpt handler flags */ 95 #define STI_NOEHE 23 /* no ext exhdl struct */ 96 #define STI_NOINQCE 24 /* no ext inq cfg struct */ 97 #define STI_ILLRGNPTR 25 /* invalid region pointer */ 98 #define STI_ILLUTLOP 26 /* invalid util opcode */ 99 #define STI_UNKNOWN 250 /* unknown error */ 100 #define STI_NOCFGPTR 251 /* no config ptr defined */ 101 #define STI_NOFLPTR 252 /* no flag ptr defined */ 102 #define STI_NOINPTR 253 /* no in ptr defined */ 103 #define STI_NOOUTPTR 254 /* no way you can get it */ 104 #define STI_NOLOCK 255 /* kernel dishonour graphics lock */ 105 106 /* colours */ 107 #define STI_COLOUR_BLACK 0 108 #define STI_COLOUR_WHITE 1 109 #define STI_COLOUR_RED 2 110 #define STI_COLOUR_YELLOW 3 111 #define STI_COLOUR_GREEN 4 112 #define STI_COLOUR_CYAN 5 113 #define STI_COLOUR_BLUE 6 114 #define STI_COLOUR_MAGENTA 7 115 116 /* LSB high */ 117 struct sti_dd { 118 uint32_t dd_type; /* 0x00 device type */ 119 #define STI_DEVTYPE1 1 120 #define STI_DEVTYPE4 3 121 uint8_t dd_unused; 122 uint8_t dd_nmon; /* 0x05 number monitor rates */ 123 uint8_t dd_grrev; /* 0x06 global rom revision */ 124 uint8_t dd_lrrev; /* 0x07 local rom revision */ 125 uint32_t dd_grid[2]; /* 0x08 graphics id */ 126 #define STI_DEV4_DD_GRID 0x08 /* offset for STI_DEVTYPE4 */ 127 #define STI_DEV1_DD_GRID 0x10 /* offset for STI_DEVTYPE1 */ 128 uint32_t dd_fntaddr; /* 0x10 font start address */ 129 uint32_t dd_maxst; /* 0x14 max state storage */ 130 uint32_t dd_romend; /* 0x18 rom last address */ 131 #define STI_DEV4_DD_ROMEND 0x18 /* offset for STI_DEVTYPE4 */ 132 #define STI_DEV1_DD_ROMEND 0x50 /* offset for STI_DEVTYPE1 */ 133 uint32_t dd_reglst; /* 0x1c device region list */ 134 uint16_t dd_maxreent; /* 0x20 max reent storage */ 135 uint16_t dd_maxtimo; /* 0x22 max execution timeout .1 sec */ 136 uint32_t dd_montbl; /* 0x24 mon table address, array of 137 names num of dd_nmon */ 138 uint32_t dd_udaddr; /* 0x28 user data address */ 139 uint32_t dd_stimemreq; /* 0x2c sti memory request */ 140 uint32_t dd_udsize; /* 0x30 user data size */ 141 uint16_t dd_pwruse; /* 0x34 power usage */ 142 uint8_t dd_bussup; /* 0x36 bus support */ 143 #define STI_BUSSUPPORT_GSCINTL 0x01 /* supports pulling INTL for int */ 144 #define STI_BUSSUPPORT_GSC15X 0x02 /* supports GSC 1.5X */ 145 #define STI_BUSSUPPORT_GSC2X 0x04 /* supports GSC 2.X */ 146 #define STI_BUSSUPPORT_PCIIOEIM 0x08 /* will use directed int */ 147 #define STI_BUSSUPPORT_PCISTD 0x10 /* will use std PCI int */ 148 #define STI_BUSSUPPORT_ILOCK 0x20 /* supports implicit locking */ 149 #define STI_BUSSUPPORT_ROMMAP 0x40 /* rom is only in pci erom space */ 150 #define STI_BUSSUPPORT_2DECODE 0x80 /* single address decoder */ 151 uint8_t dd_ebussup; /* 0x37 extended bus support */ 152 #define STI_EBUSSUPPORT_DMA 0x01 /* supports dma */ 153 #define STI_EBUSSUPPORT_PIOLOCK 0x02 /* no implicit locking for dma */ 154 uint8_t dd_altcodet; /* 0x38 alternate code type */ 155 #define STI_ALTCODE_UNKNOWN 0x00 156 #define STI_ALTCODE_PA64 0x01 /* alt code is in pa64 */ 157 uint8_t dd_eddst[3]; /* 0x39 extended DD struct */ 158 uint32_t dd_cfbaddr; /* 0x3c CFB address, location of 159 X11 driver to be used for 160 servers w/o accel */ 161 uint32_t dd_pacode[16]; /* 0x40 routines for pa-risc */ 162 uint32_t dd_altcode[16]; /* 0x80 routines for m68k/i386 */ 163 } __packed; 164 165 #define STI_REVISION(maj, min) (((maj) << 4) | ((min) & 0x0f)) 166 167 /* after the last region there is one indirect list ptr */ 168 struct sti_region { 169 u_int offset :14; /* page offset dev io space relative */ 170 u_int sys_only: 1; /* whether allow user access */ 171 u_int cache : 1; /* map in cache */ 172 u_int btlb : 1; /* should use BTLB if available */ 173 u_int last : 1; /* last region in the list */ 174 u_int length :14; /* size in pages */ 175 } __packed; 176 177 struct sti_font { 178 uint16_t first; 179 uint16_t last; 180 uint8_t width; 181 uint8_t height; 182 uint8_t type; 183 #define STI_FONT_HPROMAN8 1 184 #define STI_FONT_KANA8 2 185 uint8_t bpc; 186 uint32_t next; 187 uint8_t uheight; 188 uint8_t uoffset; 189 uint8_t unused[2]; 190 } __packed; 191 192 struct sti_fontcfg { 193 uint16_t first; 194 uint16_t last; 195 uint8_t width; 196 uint8_t height; 197 uint8_t type; 198 uint8_t bpc; 199 uint8_t uheight; 200 uint8_t uoffset; 201 } __packed; 202 203 typedef struct sti_mon { 204 uint32_t width: 12; 205 uint32_t height: 12; 206 uint32_t hz: 7; /* low 7 bits of refresh rate */ 207 uint32_t flat: 1; /* flatpanel */ 208 uint32_t vesa: 1; /* vesa mode */ 209 uint32_t grey: 1; /* greyscale */ 210 uint32_t dblbuf: 1; /* double buffered */ 211 uint32_t user: 1; /* user-defined mode */ 212 uint32_t stereo: 1; /* stereo display */ 213 uint32_t sam: 1; /* ? */ 214 uint32_t : 15; 215 uint32_t hz_upper: 3; /* upper 3 bits of refresh rate */ 216 uint32_t font: 8; /* rom font index */ 217 } __packed *sti_mon_t; 218 219 typedef struct sti_ecfg { 220 uint8_t current_monitor; 221 uint8_t uf_boot; 222 uint16_t power; /* power dissipation Watts */ 223 uint32_t freq_ref; 224 uint32_t *addr; /* memory block of size dd_stimemreq */ 225 void *future; 226 } __packed *sti_ecfg_t; 227 228 typedef struct sti_cfg { 229 uint32_t text_planes; 230 uint16_t scr_width; 231 uint16_t scr_height; 232 uint16_t oscr_width; 233 uint16_t oscr_height; 234 uint16_t fb_width; 235 uint16_t fb_height; 236 uint32_t regions[STI_REGION_MAX]; 237 uint32_t reent_level; 238 uint32_t *save_addr; 239 sti_ecfg_t ext_cfg; 240 } __packed *sti_cfg_t; 241 242 243 /* routine types */ 244 #define STI_DEP(n) \ 245 typedef int (*sti_##n##_t)( \ 246 sti_##n##flags_t, sti_##n##in_t, sti_##n##out_t, sti_cfg_t); 247 248 typedef struct sti_initflags { 249 uint32_t flags; 250 #define STI_INITF_WAIT 0x80000000 251 #define STI_INITF_RESET 0x40000000 252 #define STI_INITF_TEXT 0x20000000 253 #define STI_INITF_NTEXT 0x10000000 254 #define STI_INITF_CLEAR 0x08000000 255 #define STI_INITF_CMB 0x04000000 /* non-text planes cmap black */ 256 #define STI_INITF_EBET 0x02000000 /* enable bus error timer */ 257 #define STI_INITF_EBETI 0x01000000 /* enable bus error timer interrupt */ 258 #define STI_INITF_PTS 0x00800000 /* preserve text settings */ 259 #define STI_INITF_PNTS 0x00400000 /* preserve non-text settings */ 260 #define STI_INITF_PBET 0x00200000 /* preserve BET settings */ 261 #define STI_INITF_PBETI 0x00100000 /* preserve BETI settings */ 262 #define STI_INITF_ICMT 0x00080000 /* init cmap for text planes */ 263 #define STI_INITF_SCMT 0x00040000 /* change current monitor type */ 264 #define STI_INITF_RIE 0x00020000 /* retain int enables */ 265 void *future; 266 } __packed *sti_initflags_t; 267 268 typedef struct sti_einitin { 269 uint8_t mon_type; 270 uint8_t pad; 271 uint16_t inflight; /* possible on pci */ 272 void *future; 273 } __packed *sti_einitin_t; 274 275 typedef struct sti_initin { 276 uint32_t text_planes; /* number of planes for text */ 277 sti_einitin_t ext_in; 278 } __packed *sti_initin_t; 279 280 typedef struct sti_initout { 281 int32_t errno; 282 uint32_t text_planes; /* number of planes used for text */ 283 void *future; 284 } __packed *sti_initout_t; 285 286 STI_DEP(init); 287 288 typedef struct sti_mgmtflags { 289 uint32_t flags; 290 #define STI_MGMTF_WAIT 0x80000000 291 #define STI_MGMTF_SAVE 0x40000000 292 #define STI_MGMTF_RALL 0x20000000 /* restore all display planes */ 293 void *future; 294 } __packed *sti_mgmtflags_t; 295 296 typedef struct sti_mgmtin { 297 void *addr; 298 void *future; 299 } __packed *sti_mgmtin_t; 300 301 typedef struct sti_mgmtout { 302 int32_t errno; 303 void *future; 304 } __packed *sti_mgmtout_t; 305 306 STI_DEP(mgmt); 307 308 typedef struct sti_unpmvflags { 309 uint32_t flags; 310 #define STI_UNPMVF_WAIT 0x80000000 311 #define STI_UNPMVF_NTXT 0x40000000 /* intp non-text planes */ 312 void *future; 313 } __packed *sti_unpmvflags_t; 314 315 typedef struct sti_unpmvin { 316 uint32_t *font_addr; /* font */ 317 uint16_t index; /* character index in the font */ 318 uint8_t fg_colour; 319 uint8_t bg_colour; 320 uint16_t x, y; 321 void *future; 322 } __packed *sti_unpmvin_t; 323 324 typedef struct sti_unpmvout { 325 uint32_t errno; 326 void *future; 327 } __packed *sti_unpmvout_t; 328 329 STI_DEP(unpmv); 330 331 typedef struct sti_blkmvflags { 332 uint32_t flags; 333 #define STI_BLKMVF_WAIT 0x80000000 334 #define STI_BLKMVF_COLR 0x40000000 /* change colour on move */ 335 #define STI_BLKMVF_CLR 0x20000000 /* clear on move */ 336 #define STI_BLKMVF_NTXT 0x10000000 /* move in non-text planes */ 337 void *future; 338 } __packed *sti_blkmvflags_t; 339 340 typedef struct sti_blkmvin { 341 uint8_t fg_colour; 342 uint8_t bg_colour; 343 uint16_t srcx, srcy, dstx, dsty; 344 uint16_t width, height; 345 uint16_t pad; 346 void *future; 347 } __packed *sti_blkmvin_t; 348 349 typedef struct sti_blkmvout { 350 uint32_t errno; 351 void *future; 352 } __packed *sti_blkmvout_t; 353 354 STI_DEP(blkmv); 355 356 typedef struct sti_testflags { 357 uint32_t flags; 358 #define STI_TESTF_WAIT 0x80000000 359 #define STI_TESTF_ETST 0x40000000 360 void *future; 361 } __packed *sti_testflags_t; 362 363 typedef struct sti_testin { 364 void *future; 365 } __packed *sti_testin_t; 366 367 typedef struct sti_testout { 368 uint32_t errno; 369 uint32_t result; 370 void *future; 371 } __packed *sti_testout_t; 372 373 STI_DEP(test); 374 375 typedef struct sti_exhdlflags { 376 uint32_t flags; 377 #define STI_EXHDLF_WAIT 0x80000000 378 #define STI_EXHDLF_CINT 0x40000000 /* clear int */ 379 #define STI_EXHDLF_CBE 0x20000000 /* clear BE */ 380 #define STI_EXHDLF_PINT 0x10000000 /* preserve int */ 381 #define STI_EXHDLF_RINT 0x08000000 /* restore int */ 382 #define STI_EXHDLF_WEIM 0x04000000 /* write eim w/ sti_eexhdlin */ 383 #define STI_EXHDLF_REIM 0x02000000 /* read eim to sti_eexhdlout */ 384 #define STI_EXHDLF_GIE 0x01000000 /* global int enable */ 385 #define STI_EXHDLF_PGIE 0x00800000 386 #define STI_EXHDLF_WIEM 0x00400000 387 #define STI_EXHDLF_EIEM 0x00200000 388 #define STI_EXHDLF_BIC 0x00100000 /* begin int cycle */ 389 #define STI_EXHDLF_EIC 0x00080000 /* end int cycle */ 390 #define STI_EXHDLF_RIE 0x00040000 /* reset do not clear int enables */ 391 void *future; 392 } __packed *sti_exhdlflags_t; 393 394 typedef struct sti_eexhdlin { 395 uint32_t eim_addr; 396 uint32_t eim_data; 397 uint32_t iem; /* enable mask */ 398 uint32_t icm; /* clear mask */ 399 void *future; 400 } __packed *sti_eexhdlin_t; 401 402 typedef struct sti_exhdlint { 403 uint32_t flags; 404 #define STI_EXHDLINT_BET 0x80000000 /* bus error timer */ 405 #define STI_EXHDLINT_HW 0x40000000 /* high water */ 406 #define STI_EXHDLINT_LW 0x20000000 /* low water */ 407 #define STI_EXHDLINT_TM 0x10000000 /* texture map */ 408 #define STI_EXHDLINT_VB 0x08000000 /* vertical blank */ 409 #define STI_EXHDLINT_UDC 0x04000000 /* unbuffered dma complete */ 410 #define STI_EXHDLINT_BDC 0x02000000 /* buffered dma complete */ 411 #define STI_EXHDLINT_UDPC 0x01000000 /* unbuf priv dma complete */ 412 #define STI_EXHDLINT_BDPC 0x00800000 /* buffered priv dma complete */ 413 } __packed *sti_exhdlint_t; 414 415 typedef struct sti_exhdlin { 416 sti_exhdlint_t addr; 417 sti_eexhdlin_t ext; 418 } __packed *sti_exhdlin_t; 419 420 typedef struct sti_eexhdlout { 421 uint32_t eim_addr; 422 uint32_t eim_data; 423 uint32_t iem; /* enable mask */ 424 uint32_t icm; /* clear mask */ 425 void *future; 426 } __packed *sti_eexhdlout_t; 427 428 typedef struct sti_exhdlout { 429 uint32_t errno; 430 uint32_t flags; 431 #define STI_EXHDLO_BE 0x80000000 /* BE was intercepted */ 432 #define STI_EXHDLO_IP 0x40000000 /* there is int pending */ 433 #define STI_EXHDLO_IE 0x20000000 /* global enable set */ 434 sti_eexhdlout_t ext; 435 } __packed *sti_exhdlout_t; 436 437 STI_DEP(exhdl); 438 439 typedef struct sti_inqconfflags { 440 uint32_t flags; 441 #define STI_INQCONFF_WAIT 0x80000000 442 void *future; 443 } __packed *sti_inqconfflags_t; 444 445 typedef struct sti_inqconfin { 446 void *future; 447 } __packed *sti_inqconfin_t; 448 449 typedef struct sti_einqconfout { 450 uint32_t crt_config[3]; 451 uint32_t crt_hw[3]; 452 void *future; 453 } __packed *sti_einqconfout_t; 454 455 typedef struct sti_inqconfout { 456 uint32_t errno; 457 uint16_t width, height, owidth, oheight, fbwidth, fbheight; 458 uint32_t bpp; /* bits per pixel */ 459 uint32_t bppu; /* accessible bpp */ 460 uint32_t planes; 461 uint8_t name[STI_DEVNAME_LEN]; 462 uint32_t attributes; 463 #define STI_INQCONF_Y2X 0x0001 /* pixel is higher than wider */ 464 #define STI_INQCONF_HWBLKMV 0x0002 /* hw blkmv is present */ 465 #define STI_INQCONF_AHW 0x0004 /* adv hw accel */ 466 #define STI_INQCONF_INT 0x0008 /* can interrupt */ 467 #define STI_INQCONF_GONOFF 0x0010 /* supports on/off */ 468 #define STI_INQCONF_AONOFF 0x0020 /* supports alpha on/off */ 469 #define STI_INQCONF_VARY 0x0040 /* variable fb height */ 470 #define STI_INQCONF_ODDBYTES 0x0080 /* use only odd fb bytes */ 471 #define STI_INQCONF_FLUSH 0x0100 /* fb cache requires flushing */ 472 #define STI_INQCONF_DMA 0x0200 /* supports dma */ 473 #define STI_INQCONF_VDMA 0x0400 /* supports vdma */ 474 #define STI_INQCONF_YUV1 0x2000 /* supports YUV type 1 */ 475 #define STI_INQCONF_YUV2 0x4000 /* supports YUV type 2 */ 476 #define STI_INQCONF_BITS \ 477 "\020\001y2x\002hwblkmv\003ahw\004int\005gonoff\006aonoff\007vary"\ 478 "\010oddb\011flush\012dma\013vdma\016yuv1\017yuv2" 479 sti_einqconfout_t ext; 480 } __packed *sti_inqconfout_t; 481 482 STI_DEP(inqconf); 483 484 typedef struct sti_scmentflags { 485 uint32_t flags; 486 #define STI_SCMENTF_WAIT 0x80000000 487 void *future; 488 } __packed *sti_scmentflags_t; 489 490 typedef struct sti_scmentin { 491 uint32_t entry; 492 uint32_t value; 493 void *future; 494 } __packed *sti_scmentin_t; 495 496 typedef struct sti_scmentout { 497 uint32_t errno; 498 void *future; 499 } __packed *sti_scmentout_t; 500 501 STI_DEP(scment); 502 503 typedef struct sti_dmacflags { 504 uint32_t flags; 505 #define STI_DMACF_WAIT 0x80000000 506 #define STI_DMACF_PRIV 0x40000000 /* priv dma */ 507 #define STI_DMACF_DIS 0x20000000 /* disable */ 508 #define STI_DMACF_BUF 0x10000000 /* buffered */ 509 #define STI_DMACF_MRK 0x08000000 /* write a marker */ 510 #define STI_DMACF_ABRT 0x04000000 /* abort dma xfer */ 511 void *future; 512 } __packed *sti_dmacflags_t; 513 514 typedef struct sti_dmacin { 515 uint32_t pa_upper; 516 uint32_t pa_lower; 517 uint32_t len; 518 uint32_t mrk_data; 519 uint32_t mrk_off; 520 void *future; 521 } __packed *sti_dmacin_t; 522 523 typedef struct sti_dmacout { 524 uint32_t errno; 525 void *future; 526 } __packed *sti_dmacout_t; 527 528 STI_DEP(dmac); 529 530 typedef struct sti_flowcflags { 531 uint32_t flags; 532 #define STI_FLOWCF_WAIT 0x80000000 533 #define STI_FLOWCF_CHW 0x40000000 /* check high water */ 534 #define STI_FLOWCF_WHW 0x20000000 /* write high water */ 535 #define STI_FLOWCF_WLW 0x10000000 /* write low water */ 536 #define STI_FLOWCF_PCSE 0x08000000 /* preserve cse */ 537 #define STI_FLOWCF_CSE 0x04000000 538 #define STI_FLOWCF_CSWF 0x02000000 /* cs write fine */ 539 #define STI_FLOWCF_CSWC 0x01000000 /* cs write coarse */ 540 #define STI_FLOWCF_CSWQ 0x00800000 /* cs write fifo */ 541 void *future; 542 } __packed *sti_flowcflags_t; 543 544 typedef struct sti_flowcin { 545 uint32_t retry; 546 uint32_t bufz; 547 uint32_t hwcnt; 548 uint32_t lwcnt; 549 uint32_t csfv; /* cs fine value */ 550 uint32_t cscv; /* cs coarse value */ 551 uint32_t csqc; /* cs fifo count */ 552 void *future; 553 } __packed *sti_flowcin_t; 554 555 typedef struct sti_flowcout { 556 uint32_t errno; 557 uint32_t retry_result; 558 uint32_t fifo_size; 559 void *future; 560 } __packed *sti_flowcout_t; 561 562 STI_DEP(flowc); 563 564 typedef struct sti_utimingflags { 565 uint32_t flags; 566 #define STI_UTIMF_WAIT 0x80000000 567 #define STI_UTIMF_HKS 0x40000000 /* has kbuf_size */ 568 void *future; 569 } __packed *sti_utimingflags_t; 570 571 typedef struct sti_utimingin { 572 void *data; 573 void *kbuf; 574 void *future; 575 } __packed *sti_utimingin_t; 576 577 typedef struct sti_utimingout { 578 uint32_t errno; 579 uint32_t kbuf_size; /* buffer required size */ 580 void *future; 581 } __packed *sti_utimingout_t; 582 583 STI_DEP(utiming); 584 585 typedef struct sti_pmgrflags { 586 uint32_t flags; 587 #define STI_UTIMF_WAIT 0x80000000 588 #define STI_UTIMOP_CLEANUP 0x00000000 589 #define STI_UTIMOP_BAC 0x10000000 590 #define STI_UTIMF_CRIT 0x04000000 591 #define STI_UTIMF_BUFF 0x02000000 592 #define STI_UTIMF_IBUFF 0x01000000 593 void *future; 594 } __packed *sti_pmgrflags_t; 595 596 typedef struct sti_pmgrin { 597 uint32_t reserved[4]; 598 void *future; 599 } __packed *sti_pmgrin_t; 600 601 typedef struct sti_pmgrout { 602 int32_t errno; 603 void *future; 604 } __packed *sti_pmgrout_t; 605 606 STI_DEP(pmgr); 607 608 typedef struct sti_utilflags { 609 uint32_t flags; 610 #define STI_UTILF_ROOT 0x80000000 /* was called as root */ 611 void *future; 612 } __packed *sti_utilflags_t; 613 614 typedef struct sti_utilin { 615 uint32_t in_size; 616 uint32_t out_size; 617 uint8_t *buf; 618 } __packed *sti_utilin_t; 619 620 typedef struct sti_utilout { 621 int32_t errno; 622 void *future; 623 } __packed *sti_utilout_t; 624 625 STI_DEP(util); 626 627 #endif /* _IC_STIREG_H_ */ 628