Annotation of qemu/roms/openbios/arch/ppc/osi_calls.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  *   Creation Date: <2002/06/16 01:40:57 samuel>
                      3:  *   Time-stamp: <2003/12/26 17:02:09 samuel>
                      4:  *
                      5:  *     <osi_calls.h>
                      6:  *
                      7:  *     OSI call inlines
                      8:  *
                      9:  *   Copyright (C) 2002, 2003 Samuel Rydh ([email protected])
                     10:  *
                     11:  *   This program is free software; you can redistribute it and/or
                     12:  *   modify it under the terms of the GNU General Public License
                     13:  *   as published by the Free Software Foundation
                     14:  *
                     15:  */
                     16: 
                     17: #ifndef _H_OSI_CALLS
                     18: #define _H_OSI_CALLS
                     19: 
                     20: #include "osi.h"
                     21: 
                     22: /* Old gcc versions have a limit on the number of registers used.
                     23:  * Newer gcc versions (gcc 3.3) require that the clobber list does
                     24:  * not overlap declared registers.
                     25:  */
                     26: #if __GNUC__ == 2 || ( __GNUC__ == 3 && __GNUC_MINOR__ < 3 )
                     27: #define SHORT_REGLIST
                     28: #endif
                     29: 
                     30: 
                     31: /************************************************************************/
                     32: /*     OSI call instantiation macros                                   */
                     33: /************************************************************************/
                     34: 
                     35: #define dreg(n)                        __oc_##n __asm__ (#n)
                     36: #define ir(n)                  "r" (__oc_##n)
                     37: #define rr(n)                  "=r" (__oc_##n)
                     38: 
                     39: #define _oc_head( input_regs... )                              \
                     40: {                                                              \
                     41:        int _ret=0;                                             \
                     42:        {                                                       \
                     43:                register unsigned long dreg(r3);                \
                     44:                register unsigned long dreg(r4);                \
                     45:                register unsigned long dreg(r5)                 \
                     46:                        ,##input_regs ;
                     47: 
                     48: #define _oc_syscall( number, extra_ret_regs... )               \
                     49:                __oc_r3 = OSI_SC_MAGIC_R3;                      \
                     50:                __oc_r4 = OSI_SC_MAGIC_R4;                      \
                     51:                __oc_r5 = number;                               \
                     52:                __asm__ __volatile__ (                          \
                     53:                  "sc   " : rr(r3) ,## extra_ret_regs
                     54: 
                     55: #define _oc_input( regs... )                                   \
                     56:                : ir(r3), ir(r4), ir(r5)                        \
                     57:                , ## regs                                       \
                     58:                : "memory" );
                     59: 
                     60: /* the tail memory clobber is necessary since we violate the strict
                     61:  * aliasing rules when we return structs through the registers.
                     62:  */
                     63: #define _oc_tail                                               \
                     64:                asm volatile ( "" : : : "memory" );             \
                     65:                _ret = __oc_r3;                                 \
                     66:        }                                                       \
                     67:        return _ret;                                            \
                     68: }
                     69: 
                     70: 
                     71: /************************************************************************/
                     72: /*     Alternatives                                                    */
                     73: /************************************************************************/
                     74: 
                     75: #ifdef SHORT_REGLIST
                     76: #define _oc_syscall_r10w6( number, inputregs... )              \
                     77:                __oc_r3 = OSI_SC_MAGIC_R3;                      \
                     78:                __oc_r4 = OSI_SC_MAGIC_R4;                      \
                     79:                __oc_r5 = number;                               \
                     80:                __asm__ __volatile__ (                          \
                     81:                  "sc                   \n"                     \
                     82:                  "stw  4,0(10)         \n"                     \
                     83:                  "stw  5,4(10)         \n"                     \
                     84:                  "stw  6,8(10)         \n"                     \
                     85:                  "stw  7,12(10)        \n"                     \
                     86:                  "stw  8,16(10)        \n"                     \
                     87:                  "stw  9,20(10)        \n"                     \
                     88:                : rr(r3)                                        \
                     89:                : ir(r3), ir(r4), ir(r5), ir(r10)               \
                     90:                  ,## inputregs                                 \
                     91:                : "memory",                                     \
                     92:                   "r4", "r5", "r6", "r7", "r8", "r9" );
                     93: #endif
                     94: 
                     95: 
                     96: /************************************************************************/
                     97: /*     Common helper functions                                         */
                     98: /************************************************************************/
                     99: 
                    100: #define _osi_call0( type, name, number )                       \
                    101: type name( void )                                              \
                    102:        _oc_head()                                              \
                    103:        _oc_syscall( number )                                   \
                    104:        _oc_input()                                             \
                    105:        _oc_tail
                    106: 
                    107: #define _osi_call1( type, name, number, type1, arg1 )          \
                    108: type name( type1 arg1 )                                        \
                    109:        _oc_head( dreg(r6) )                                    \
                    110:        __oc_r6 = (unsigned long)arg1;                          \
                    111:        _oc_syscall( number )                                   \
                    112:        _oc_input( ir(r6) )                                     \
                    113:        _oc_tail
                    114: 
                    115: #define _osi_call2( type, name, number, t1, a1, t2, a2 )       \
                    116: type name( t1 a1, t2 a2 )                                      \
                    117:        _oc_head( dreg(r6), dreg(r7) )                          \
                    118:        __oc_r6 = (unsigned long)a1;                            \
                    119:        __oc_r7 = (unsigned long)a2;                            \
                    120:        _oc_syscall( number )                                   \
                    121:        _oc_input( ir(r6), ir(r7) )                             \
                    122:        _oc_tail
                    123: 
                    124: #define _osi_call3( type, name, number, t1, a1, t2, a2, t3, a3 ) \
                    125: type name( t1 a1, t2 a2, t3 a3 )                               \
                    126:        _oc_head( dreg(r6), dreg(r7), dreg(r8) )                \
                    127:        __oc_r6 = (unsigned long)a1;                            \
                    128:        __oc_r7 = (unsigned long)a2;                            \
                    129:        __oc_r8 = (unsigned long)a3;                            \
                    130:        _oc_syscall( number )                                   \
                    131:        _oc_input( ir(r6), ir(r7), ir(r8) )                     \
                    132:        _oc_tail
                    133: 
                    134: #define _osi_call4( type, name, number, t1, a1, t2, a2, t3, a3, t4, a4 ) \
                    135: type name( t1 a1, t2 a2, t3 a3, t4 a4 )                        \
                    136:        _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9) )      \
                    137:        __oc_r6 = (unsigned long)a1;                            \
                    138:        __oc_r7 = (unsigned long)a2;                            \
                    139:        __oc_r8 = (unsigned long)a3;                            \
                    140:        __oc_r9 = (unsigned long)a4;                            \
                    141:        _oc_syscall( number )                                   \
                    142:        _oc_input( ir(r6), ir(r7), ir(r8), ir(r9) )             \
                    143:        _oc_tail
                    144: 
                    145: #define _osi_call5( type, name, number, t1, a1, t2, a2, t3, a3, t4, a4, t5, a5 ) \
                    146: type name( t1 a1, t2 a2, t3 a3, t4 a4, t5 a5 )                                 \
                    147:        _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9), dreg(r10) )   \
                    148:        __oc_r6 = (unsigned long)a1;                                    \
                    149:        __oc_r7 = (unsigned long)a2;                                    \
                    150:        __oc_r8 = (unsigned long)a3;                                    \
                    151:        __oc_r9 = (unsigned long)a4;                                    \
                    152:        __oc_r10 = (unsigned long)a5;                                   \
                    153:        _oc_syscall( number )                                           \
                    154:        _oc_input( ir(r6), ir(r7), ir(r8), ir(r9), ir(r10) )            \
                    155:        _oc_tail
                    156: 
                    157: #define _osi_call6( type, name, number, t1, a1, t2, a2, t3, a3, t4, a4, t5, a5, t6, a6 ) \
                    158: type name( t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6 )                          \
                    159:        _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9), dreg(r10), dreg(r11) )\
                    160:        __oc_r6 = (unsigned long)a1;                                    \
                    161:        __oc_r7 = (unsigned long)a2;                                    \
                    162:        __oc_r8 = (unsigned long)a3;                                    \
                    163:        __oc_r9 = (unsigned long)a4;                                    \
                    164:        __oc_r10 = (unsigned long)a5;                                   \
                    165:        __oc_r11 = (unsigned long)a6;                                   \
                    166:        _oc_syscall( number )                                           \
                    167:        _oc_input( ir(r6), ir(r7), ir(r8), ir(r9), ir(r10), ir(r11) )   \
                    168:        _oc_tail
                    169: 
                    170: 
                    171: /************************************************************************/
                    172: /*     Special                                                         */
                    173: /************************************************************************/
                    174: 
                    175: /* r4 returned in retarg1 pointer */
                    176: #define _osi_call0_w1( type, name, number, type1, retarg1 )    \
                    177: type name( type1 retarg1 )                                     \
                    178:        _oc_head()                                              \
                    179:        _oc_syscall( number, rr(r4) )                           \
                    180:        _oc_input()                                             \
                    181:        *retarg1 = __oc_r4;                                     \
                    182:        _oc_tail
                    183: 
                    184: #define _osi_call0_w2( type, name, number, type1, retarg1 )    \
                    185: type name( type1 retarg1 )                                     \
                    186:        _oc_head()                                              \
                    187:        _oc_syscall( number, rr(r4), rr(r5) )                   \
                    188:        _oc_input()                                             \
                    189:        ((unsigned long*)retarg1)[0] = __oc_r4;                 \
                    190:        ((unsigned long*)retarg1)[1] = __oc_r5;                 \
                    191:        _oc_tail
                    192: 
                    193: /* r4-r8 returned in retarg1 pointer */
                    194: #define _osi_call0_w5( type, name, number, type1, retarg1 )    \
                    195: type name( type1 retarg1 )                                     \
                    196:        _oc_head( dreg(r6), dreg(r7), dreg(r8) )                \
                    197:        _oc_syscall( number,                                    \
                    198:                rr(r4), rr(r5), rr(r6), rr(r7), rr(r8) )        \
                    199:        _oc_input()                                             \
                    200:        ((unsigned long*)retarg1)[0] = __oc_r4;                 \
                    201:        ((unsigned long*)retarg1)[1] = __oc_r5;                 \
                    202:        ((unsigned long*)retarg1)[2] = __oc_r6;                 \
                    203:        ((unsigned long*)retarg1)[3] = __oc_r7;                 \
                    204:        ((unsigned long*)retarg1)[4] = __oc_r8;                 \
                    205:        _oc_tail
                    206: 
                    207: /* r4 returned in retarg pointer */
                    208: #define _osi_call1_w1( type, name, number, t1, a1, t2, retarg ) \
                    209: type name( t1 a1, t2 retarg )                                  \
                    210:        _oc_head( dreg(r6) )                                    \
                    211:        __oc_r6 = (unsigned long)a1;                            \
                    212:        _oc_syscall( number, rr(r4) )                           \
                    213:        _oc_input( ir(r6) )                                     \
                    214:        ((unsigned long*)retarg)[0] = __oc_r4;                  \
                    215:        _oc_tail
                    216: 
                    217: /* r4,r5 returned in retarg1, retarg2 */
                    218: #define _osi_call1_w1w1( type, name, number, t1, a1, t2, retarg1, t3, retarg2 ) \
                    219: type name( t1 a1, t2 retarg1, t3 retarg2 )                     \
                    220:        _oc_head( dreg(r6) )                                    \
                    221:        __oc_r6 = (unsigned long)a1;                            \
                    222:        _oc_syscall( number, rr(r4), rr(r5) )                   \
                    223:        _oc_input( ir(r6) )                                     \
                    224:        ((unsigned long*)retarg1)[0] = __oc_r4;                 \
                    225:        ((unsigned long*)retarg2)[0] = __oc_r5;                 \
                    226:        _oc_tail
                    227: 
                    228: /* r4,r5 returned in retarg1, retarg2, retarg3 */
                    229: #define _osi_call1_w1w1w1( type, name, number, t1, a1, t2, retarg1, t3, retarg2, t4, retarg3 ) \
                    230: type name( t1 a1, t2 retarg1, t3 retarg2, t4 retarg3 )         \
                    231:        _oc_head( dreg(r6) )                                    \
                    232:        __oc_r6 = (unsigned long)a1;                            \
                    233:        _oc_syscall( number, rr(r4), rr(r5), rr(r6) )           \
                    234:        _oc_input( ir(r6) )                                     \
                    235:        ((unsigned long*)retarg1)[0] = __oc_r4;                 \
                    236:        ((unsigned long*)retarg2)[0] = __oc_r5;                 \
                    237:        ((unsigned long*)retarg3)[0] = __oc_r6;                 \
                    238:        _oc_tail
                    239: 
                    240: /* r4,r5 returned in retarg pointer */
                    241: #define _osi_call1_w2( type, name, number, t1, a1, t2, retarg ) \
                    242: type name( t1 a1, t2 retarg )                                  \
                    243:        _oc_head( dreg(r6) )                                    \
                    244:        __oc_r6 = (unsigned long)a1;                            \
                    245:        _oc_syscall( number, rr(r4), rr(r5) )                   \
                    246:        _oc_input( ir(r6) )                                     \
                    247:        ((unsigned long*)retarg)[0] = __oc_r4;                  \
                    248:        ((unsigned long*)retarg)[1] = __oc_r5;                  \
                    249:        _oc_tail
                    250: 
                    251: /* r4-r7 returned in retarg pointer */
                    252: #define _osi_call1_w4( type, name, number, t1, a1, t2, retarg ) \
                    253: type name( t1 a1, t2 retarg )                                  \
                    254:        _oc_head( dreg(r6), dreg(r7) )                          \
                    255:        __oc_r6 = (unsigned long)a1;                            \
                    256:        _oc_syscall( number, rr(r4), rr(r5), rr(r6), rr(r7) )   \
                    257:        _oc_input( ir(r6) )                                     \
                    258:        ((unsigned long*)retarg)[0] = __oc_r4;                  \
                    259:        ((unsigned long*)retarg)[1] = __oc_r5;                  \
                    260:        ((unsigned long*)retarg)[2] = __oc_r6;                  \
                    261:        ((unsigned long*)retarg)[3] = __oc_r7;                  \
                    262:        _oc_tail
                    263: 
                    264: 
                    265: /* r4-r5 returned in retarg pointer */
                    266: #define _osi_call2_w2( type, name, number, t1, a1, t2, a2, t3, retarg ) \
                    267: type name( t1 a1, t2 a2, t3 retarg )                           \
                    268:        _oc_head( dreg(r6), dreg(r7) )                          \
                    269:        __oc_r6 = (unsigned long)a1;                            \
                    270:        __oc_r7 = (unsigned long)a2;                            \
                    271:        _oc_syscall( number, rr(r4), rr(r5) )                   \
                    272:        _oc_input( ir(r6), ir(r7) )                             \
                    273:        ((unsigned long*)retarg)[0] = __oc_r4;                  \
                    274:        ((unsigned long*)retarg)[1] = __oc_r5;                  \
                    275:        _oc_tail
                    276: 
                    277: /* r4-r7 returned in retarg pointer */
                    278: #define _osi_call2_w4( type, name, number, t1, a1, t2, a2, t3, retarg ) \
                    279: type name( t1 a1, t2 a2, t3 retarg )                           \
                    280:        _oc_head( dreg(r6), dreg(r7) )                          \
                    281:        __oc_r6 = (unsigned long)a1;                            \
                    282:        __oc_r7 = (unsigned long)a2;                            \
                    283:        _oc_syscall( number, rr(r4), rr(r5), rr(r6), rr(r7) )   \
                    284:        _oc_input( ir(r6), ir(r7) )                             \
                    285:        ((unsigned long*)retarg)[0] = __oc_r4;                  \
                    286:        ((unsigned long*)retarg)[1] = __oc_r5;                  \
                    287:        ((unsigned long*)retarg)[2] = __oc_r6;                  \
                    288:        ((unsigned long*)retarg)[3] = __oc_r7;                  \
                    289:        _oc_tail
                    290: 
                    291: #ifdef SHORT_REGLIST
                    292: /* r4-r9 returned in retarg pointer */
                    293: #define _osi_call2_w6( type, name, number, t1, a1, t2, a2, t3, retarg ) \
                    294: type name( t1 a1, t2 a2, t3 retarg )                           \
                    295:        _oc_head( dreg(r6), dreg(r7), dreg(r10) )               \
                    296:         __oc_r6 = (unsigned long)a1;                           \
                    297:         __oc_r7 = (unsigned long)a2;                           \
                    298:        __oc_r10 = (unsigned long)retarg;                       \
                    299:        _oc_syscall_r10w6( number, ir(r6), ir(r7) )             \
                    300:        _oc_tail
                    301: 
                    302: #else /* SHORT_REGLIST */
                    303: 
                    304: /* r4-r9 returned in retarg pointer */
                    305: #define _osi_call2_w6( type, name, number, t1, a1, t2, a2, t3, retarg ) \
                    306: type name( t1 a1, t2 a2, t3 retarg )                           \
                    307:        _oc_head( dreg(r6), dreg(r7), dreg(r8), dreg(r9) )      \
                    308:        __oc_r6 = (unsigned long)a1;                            \
                    309:        __oc_r7 = (unsigned long)a2;                            \
                    310:        _oc_syscall( number, rr(r4), rr(r5), rr(r6), rr(r7), rr(r8), rr(r9) )   \
                    311:        _oc_input( ir(r6), ir(r7) )                             \
                    312:        ((unsigned long*)retarg)[0] = __oc_r4;                  \
                    313:        ((unsigned long*)retarg)[1] = __oc_r5;                  \
                    314:        ((unsigned long*)retarg)[2] = __oc_r6;                  \
                    315:        ((unsigned long*)retarg)[3] = __oc_r7;                  \
                    316:        ((unsigned long*)retarg)[4] = __oc_r8;                  \
                    317:        ((unsigned long*)retarg)[5] = __oc_r9;                  \
                    318:        _oc_tail
                    319: 
                    320: #endif /* SHORT_REGLIST */
                    321: 
                    322: 
                    323: /************************************************************************/
                    324: /*     OSI call inlines                                                */
                    325: /************************************************************************/
                    326: 
                    327: static inline _osi_call1( int, OSI_CallAvailable, OSI_CALL_AVAILABLE, int, osi_num );
                    328: 
                    329: static inline _osi_call1( int, OSI_PutC, OSI_LOG_PUTC, int, ch );
                    330: 
                    331: static inline _osi_call1( int, OSI_Debugger, OSI_DEBUGGER, int, num );
                    332: static inline _osi_call0( int, OSI_Exit, OSI_EXIT );
                    333: 
                    334: /* misc */
                    335: static inline _osi_call0( unsigned long, OSI_GetLocalTime, OSI_GET_LOCALTIME );
                    336: static inline _osi_call0( unsigned long, OSI_GetGMTTime, OSI_GET_GMT_TIME );
                    337: static inline _osi_call1( int, OSI_USleep, OSI_USLEEP, int, usecs );
                    338: 
                    339: /* NVRAM */
                    340: static inline _osi_call0( int, OSI_NVRamSize, OSI_NVRAM_SIZE );
                    341: static inline _osi_call1( int, OSI_ReadNVRamByte, OSI_READ_NVRAM_BYTE, int, offs );
                    342: static inline _osi_call2( int, OSI_WriteNVRamByte, OSI_WRITE_NVRAM_BYTE, int, offs,
                    343:                          unsigned char, ch );
                    344: 
                    345: /* keyboard stuff */
                    346: static inline _osi_call0_w1( int, OSI_GetAdbKey2, OSI_GET_ADB_KEY, int *, raw_key );
                    347: static inline _osi_call1( int, OSI_KbdCntrl, OSI_KBD_CNTRL, int, cmd );
                    348: 
                    349: static inline int OSI_GetAdbKey( void )
                    350:        { int dummy_raw_key; return OSI_GetAdbKey2( &dummy_raw_key ); }
                    351: static inline _osi_call2( int, OSI_MapAdbKey, OSI_MAP_ADB_KEY, int, keycode, int, adbkey )
                    352: static inline _osi_call1( int, OSI_KeycodeToAdb, OSI_KEYCODE_TO_ADB, int, keycode );
                    353: static inline _osi_call0( int, OSI_SaveKeymapping, OSI_SAVE_KEYMAPPING );
                    354: 
                    355: /* mouse support */
                    356: struct osi_mouse;
                    357: static inline _osi_call0_w5( int, OSI_GetMouse, OSI_GET_MOUSE, struct osi_mouse *, ret );
                    358: static inline _osi_call0( int, OSI_GetMouseDPI, OSI_GET_MOUSE_DPI );
                    359: 
                    360: /* video */
                    361: static inline _osi_call2( int, OSI_SetVMode_, OSI_SET_VMODE, int, mode, int, depth_mode );
                    362: struct osi_get_vmode_info;
                    363: static inline _osi_call2_w6( int, OSI_GetVModeInfo_, OSI_GET_VMODE_INFO, int, mode, int, depth_mode,
                    364:                             struct osi_get_vmode_info *, ret );
                    365: static inline _osi_call1( int, OSI_SetVPowerState, OSI_SET_VIDEO_POWER, int, power_state );
                    366: static inline _osi_call2( int, OSI_SetColor, OSI_SET_COLOR, int, index, int, rgb );
                    367: static inline _osi_call0_w1( int, OSI_VideoAckIRQ, OSI_VIDEO_ACK_IRQ, int *, events );
                    368: 
                    369: static inline void OSI_RefreshPalette( void ) { OSI_SetColor(-1,0); }
                    370: 
                    371: /* PIC (mac-io replacement) */
                    372: static inline _osi_call1( int, OSI_PICMaskIRQ, OSI_PIC_MASK_IRQ, int, irq );
                    373: static inline _osi_call1( int, OSI_PICUnmaskIRQ, OSI_PIC_UNMASK_IRQ, int, irq );
                    374: static inline _osi_call2( int, OSI_PICAckIRQ, OSI_PIC_ACK_IRQ, int, irq, int, mask_it );
                    375: static inline _osi_call0( int, OSI_PICGetActiveIRQ, OSI_PIC_GET_ACTIVE_IRQ );
                    376: 
                    377: /* sound */
                    378: static inline _osi_call1( int, OSI_SoundCntl, OSI_SOUND_CNTL, int, cmd );
                    379: static inline _osi_call2( int, OSI_SoundCntl1, OSI_SOUND_CNTL, int, cmd, int, p1 );
                    380: static inline _osi_call3( int, OSI_SoundCntl2, OSI_SOUND_CNTL, int, cmd, int, p1, int, p2 );
                    381: static inline _osi_call0_w2( int, OSI_SoundIRQAck, OSI_SOUND_IRQ_ACK, unsigned long *, timestamp );
                    382: static inline _osi_call3( int, OSI_SoundWrite, OSI_SOUND_WRITE, int, physbuf, int, len, int, restart );
                    383: static inline _osi_call3( int, OSI_SoundSetVolume, OSI_SOUND_SET_VOLUME, int, hwvol, int, speakervol, int, mute );
                    384: 
                    385: /* async block driver */
                    386: struct ablk_disk_info;
                    387: static inline _osi_call2_w4( int, OSI_ABlkDiskInfo, OSI_ABLK_DISK_INFO, int, channel, int, unit,
                    388:                             struct ablk_disk_info *, retinfo );
                    389: static inline _osi_call1( int, OSI_ABlkKick, OSI_ABLK_KICK, int, channel );
                    390: static inline _osi_call1_w1w1w1( int, OSI_ABlkIRQAck, OSI_ABLK_IRQ_ACK, int, channel, int *, req_count,
                    391:                               int *, active, int *, events );
                    392: static inline _osi_call3( int, OSI_ABlkRingSetup, OSI_ABLK_RING_SETUP, int, channel, int, mphys, int, n_el );
                    393: static inline _osi_call2( int, OSI_ABlkCntrl, OSI_ABLK_CNTRL, int, channel, int, cmd );
                    394: static inline _osi_call3( int, OSI_ABlkCntrl1, OSI_ABLK_CNTRL, int, channel, int, cmd, int, param );
                    395: static inline _osi_call5( int, OSI_ABlkSyncRead, OSI_ABLK_SYNC_READ, int, channel, int, unit,
                    396:                          int, blk, unsigned long, mphys, int, size );
                    397: static inline _osi_call5( int, OSI_ABlkSyncWrite, OSI_ABLK_SYNC_WRITE, int, channel, int, unit,
                    398:                          int, blk, unsigned long, mphys, int, size );
                    399: static inline _osi_call2( int, OSI_ABlkBlessDisk, OSI_ABLK_BLESS_DISK, int, channel, int, unit );
                    400: 
                    401: static inline _osi_call0( int, OSI_CMountDrvVol, OSI_CMOUNT_DRV_VOL );
                    402: 
                    403: /* enet2 */
                    404: static inline _osi_call0( int, OSI_Enet2Open, OSI_ENET2_OPEN );
                    405: static inline _osi_call0( int, OSI_Enet2Close, OSI_ENET2_CLOSE );
                    406: static inline _osi_call3( int, OSI_Enet2RingSetup, OSI_ENET2_RING_SETUP, int, which_ring,
                    407:                          int, ring_mphys, int, n_el );
                    408: static inline _osi_call2( int, OSI_Enet2Cntrl1, OSI_ENET2_CNTRL, int, cmd, int, param );
                    409: static inline _osi_call1( int, OSI_Enet2Cntrl, OSI_ENET2_CNTRL, int, cmd );
                    410: static inline _osi_call0( int, OSI_Enet2Kick, OSI_ENET2_KICK );
                    411: 
                    412: static inline _osi_call0_w2( int, OSI_Enet2GetHWAddr__, OSI_ENET2_GET_HWADDR, unsigned long *, retbuf );
                    413: static inline int OSI_Enet2GetHWAddr( unsigned char *addr ) {
                    414:        int ret;
                    415:        unsigned long buf[2];
                    416: 
                    417:        ret = OSI_Enet2GetHWAddr__( buf );
                    418: 
                    419:        ((unsigned long*)addr)[0] = buf[0];
                    420:        ((unsigned short*)addr)[2] = (buf[1] >> 16);
                    421:        return ret;
                    422: }
                    423: static inline _osi_call2( int, OSI_Enet2IRQAck, OSI_ENET2_IRQ_ACK, int, irq_enable, int, rx_head );
                    424: 
                    425: /* PROM (device-tree) */
                    426: static inline _osi_call2( int, OSI_PromIface, OSI_PROM_IFACE, int, what, int, ph );
                    427: static inline _osi_call3( int, OSI_PromIface1, OSI_PROM_IFACE, int, what, int, ph, int, p1 );
                    428: static inline _osi_call4( int, OSI_PromIface2, OSI_PROM_IFACE, int, what, int, ph, int, p1, int, p2 );
                    429: static inline _osi_call5( int, OSI_PromIface3, OSI_PROM_IFACE, int, what, int, ph, int, p1, int, p2, int, p3 );
                    430: static inline _osi_call2( int, OSI_PromPathIface, OSI_PROM_PATH_IFACE, int, what, const char *, p );
                    431: 
                    432: /* emulation acceleration */
                    433: static inline _osi_call1( int, OSI_MapinMregs, OSI_MAPIN_MREGS, unsigned long, mphys );
                    434: static inline _osi_call3( int, OSI_EmuAccel, OSI_EMUACCEL, int, emuaccel_flags, int, param, int, inst_addr );
                    435: 
                    436: /* timer frequency */
                    437: static inline _osi_call1( int, OSI_MticksToUsecs, OSI_MTICKS_TO_USECS, unsigned long, mticks );
                    438: static inline _osi_call1( int, OSI_UsecsToMticks, OSI_USECS_TO_MTICKS, unsigned long, usecs );
                    439: 
                    440: /* fb info */
                    441: struct osi_fb_info;
                    442: static inline _osi_call0_w5( int, OSI_GetFBInfo, OSI_GET_FB_INFO, struct osi_fb_info *, retinfo );
                    443: 
                    444: /* SCSI */
                    445: static inline _osi_call0( int, OSI_SCSIAck, OSI_SCSI_ACK );
                    446: static inline _osi_call1( int, OSI_SCSISubmit, OSI_SCSI_SUBMIT, int, req_mphys );
                    447: static inline _osi_call2( int, OSI_SCSIControl, OSI_SCSI_CNTRL, int, sel, int, param );
                    448: 
                    449: /* TTY */
                    450: static inline _osi_call0( int, OSI_TTYGetc, OSI_TTY_GETC );
                    451: static inline _osi_call1( int, OSI_TTYPutc, OSI_TTY_PUTC, int, ch );
                    452: static inline _osi_call0( int, OSI_TTYIRQAck, OSI_TTY_IRQ_ACK );
                    453: 
                    454: #endif   /* _H_OSI_CALLS */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.