Annotation of src/sys/arch/mips/include/asm.h, Revision 1.46.24.1
1.46.24.1! tls 1: /* $NetBSD: asm.h,v 1.47 2014/05/30 11:46:48 joerg Exp $ */
1.4 cgd 2:
1.1 deraadt 3: /*
1.2 glass 4: * Copyright (c) 1992, 1993
5: * The Regents of the University of California. All rights reserved.
1.1 deraadt 6: *
7: * This code is derived from software contributed to Berkeley by
8: * Ralph Campbell.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
1.35 agc 18: * 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 19: * may be used to endorse or promote products derived from this software
20: * without specific prior written permission.
21: *
22: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: * SUCH DAMAGE.
33: *
1.4 cgd 34: * @(#)machAsmDefs.h 8.1 (Berkeley) 6/10/93
1.1 deraadt 35: */
36:
37: /*
38: * machAsmDefs.h --
39: *
40: * Macros used when writing assembler programs.
41: *
42: * Copyright (C) 1989 Digital Equipment Corporation.
43: * Permission to use, copy, modify, and distribute this software and
44: * its documentation for any purpose and without fee is hereby granted,
45: * provided that the above copyright notice appears in all copies.
46: * Digital Equipment Corporation makes no representations about the
47: * suitability of this software for any purpose. It is provided "as is"
48: * without express or implied warranty.
49: *
50: * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAsmDefs.h,
1.2 glass 51: * v 1.2 89/08/15 18:28:24 rab Exp SPRITE (DECWRL)
1.1 deraadt 52: */
53:
1.8 jonathan 54: #ifndef _MIPS_ASM_H
1.41 matt 55: #define _MIPS_ASM_H
1.1 deraadt 56:
1.44 matt 57: #include <sys/cdefs.h> /* for API selection */
1.21 soda 58: #include <mips/regdef.h>
1.1 deraadt 59:
60: /*
61: * Define -pg profile entry code.
1.23 castor 62: * Must always be noreorder, must never use a macro instruction
63: * Final addiu to t9 must always equal the size of this _KERN_MCOUNT
1.1 deraadt 64: */
1.41 matt 65: #define _KERN_MCOUNT \
1.23 castor 66: .set push; \
67: .set noreorder; \
68: .set noat; \
1.27 jeffs 69: subu sp,sp,16; \
70: sw t9,12(sp); \
1.23 castor 71: move AT,ra; \
72: lui t9,%hi(_mcount); \
73: addiu t9,t9,%lo(_mcount); \
74: jalr t9; \
1.27 jeffs 75: nop; \
1.23 castor 76: lw t9,4(sp); \
77: addiu sp,sp,8; \
1.28 jeffs 78: addiu t9,t9,40; \
1.23 castor 79: .set pop;
1.13 jonathan 80:
1.11 jtc 81: #ifdef GPROF
1.41 matt 82: #define MCOUNT _KERN_MCOUNT
1.1 deraadt 83: #else
84: #define MCOUNT
1.2 glass 85: #endif
1.1 deraadt 86:
1.15 castor 87: #ifdef USE_AENT
1.41 matt 88: #define AENT(x) \
1.15 castor 89: .aent x, 0
90: #else
1.41 matt 91: #define AENT(x)
1.24 kleink 92: #endif
93:
1.31 simonb 94: /*
95: * WEAK_ALIAS: create a weak alias.
96: */
1.24 kleink 97: #define WEAK_ALIAS(alias,sym) \
98: .weak alias; \
99: alias = sym
1.37 christos 100: /*
101: * STRONG_ALIAS: create a strong alias.
102: */
1.41 matt 103: #define STRONG_ALIAS(alias,sym) \
1.37 christos 104: .globl alias; \
105: alias = sym
1.15 castor 106:
1.14 thorpej 107: /*
1.33 simonb 108: * WARN_REFERENCES: create a warning if the specified symbol is referenced.
1.14 thorpej 109: */
1.43 joerg 110: #define WARN_REFERENCES(sym,msg) \
1.44 matt 111: .pushsection __CONCAT(.gnu.warning.,sym); \
1.43 joerg 112: .ascii msg; \
113: .popsection
1.6 mycroft 114:
1.1 deraadt 115: /*
1.44 matt 116: * STATIC_LEAF_NOPROFILE
117: * No profilable local leaf routine.
1.15 castor 118: */
1.44 matt 119: #define STATIC_LEAF_NOPROFILE(x) \
1.46.24.1! tls 120: .ent _C_LABEL(x); \
1.15 castor 121: _C_LABEL(x): ; \
1.44 matt 122: .frame sp, 0, ra
1.1 deraadt 123:
124: /*
1.15 castor 125: * LEAF_NOPROFILE
126: * No profilable leaf routine.
1.1 deraadt 127: */
1.41 matt 128: #define LEAF_NOPROFILE(x) \
1.15 castor 129: .globl _C_LABEL(x); \
1.44 matt 130: STATIC_LEAF_NOPROFILE(x)
1.15 castor 131:
132: /*
1.34 simonb 133: * STATIC_LEAF
134: * Declare a local leaf function.
135: */
1.41 matt 136: #define STATIC_LEAF(x) \
1.44 matt 137: STATIC_LEAF_NOPROFILE(x); \
1.34 simonb 138: MCOUNT
139:
140: /*
1.44 matt 141: * LEAF
142: * A leaf routine does
143: * - call no other function,
144: * - never use any register that callee-saved (S0-S8), and
145: * - not use any local stack storage.
1.15 castor 146: */
1.44 matt 147: #define LEAF(x) \
148: LEAF_NOPROFILE(x); \
149: MCOUNT
1.34 simonb 150:
151: /*
152: * STATIC_XLEAF
153: * declare alternate entry to a static leaf routine
154: */
1.41 matt 155: #define STATIC_XLEAF(x) \
1.20 soda 156: AENT (_C_LABEL(x)); \
1.15 castor 157: _C_LABEL(x):
158:
159: /*
1.44 matt 160: * XLEAF
161: * declare alternate entry to leaf routine
162: */
163: #define XLEAF(x) \
164: .globl _C_LABEL(x); \
165: STATIC_XLEAF(x)
166:
167: /*
168: * STATIC_NESTED_NOPROFILE
169: * No profilable local nested routine.
170: */
171: #define STATIC_NESTED_NOPROFILE(x, fsize, retpc) \
1.46.24.1! tls 172: .ent _C_LABEL(x); \
1.44 matt 173: _C_LABEL(x): ; \
174: .frame sp, fsize, retpc
175:
176: /*
177: * NESTED_NOPROFILE
178: * No profilable nested routine.
179: */
180: #define NESTED_NOPROFILE(x, fsize, retpc) \
181: .globl _C_LABEL(x); \
182: STATIC_NESTED_NOPROFILE(x, fsize, retpc)
183:
184: /*
1.15 castor 185: * NESTED
186: * A function calls other functions and needs
187: * therefore stack space to save/restore registers.
188: */
1.44 matt 189: #define NESTED(x, fsize, retpc) \
190: NESTED_NOPROFILE(x, fsize, retpc); \
1.15 castor 191: MCOUNT
1.1 deraadt 192:
193: /*
1.44 matt 194: * STATIC_NESTED
195: * No profilable local nested routine.
1.1 deraadt 196: */
1.44 matt 197: #define STATIC_NESTED(x, fsize, retpc) \
198: STATIC_NESTED_NOPROFILE(x, fsize, retpc); \
199: MCOUNT
1.15 castor 200:
201: /*
202: * XNESTED
203: * declare alternate entry point to nested routine.
204: */
1.41 matt 205: #define XNESTED(x) \
1.15 castor 206: .globl _C_LABEL(x); \
1.20 soda 207: AENT (_C_LABEL(x)); \
1.6 mycroft 208: _C_LABEL(x):
1.1 deraadt 209:
210: /*
1.15 castor 211: * END
212: * Mark end of a procedure.
1.1 deraadt 213: */
1.44 matt 214: #define END(x) \
1.41 matt 215: .end _C_LABEL(x); \
216: .size _C_LABEL(x), . - _C_LABEL(x)
1.2 glass 217:
218: /*
1.15 castor 219: * IMPORT -- import external symbol
1.2 glass 220: */
1.41 matt 221: #define IMPORT(sym, size) \
1.20 soda 222: .extern _C_LABEL(sym),size
1.1 deraadt 223:
224: /*
1.15 castor 225: * EXPORT -- export definition of symbol
1.1 deraadt 226: */
1.41 matt 227: #define EXPORT(x) \
1.15 castor 228: .globl _C_LABEL(x); \
229: _C_LABEL(x):
1.1 deraadt 230:
1.15 castor 231: /*
1.17 jonathan 232: * VECTOR
233: * exception vector entrypoint
1.20 soda 234: * XXX: regmask should be used to generate .mask
1.17 jonathan 235: */
1.41 matt 236: #define VECTOR(x, regmask) \
1.46.24.1! tls 237: .ent _C_LABEL(x); \
1.17 jonathan 238: EXPORT(x); \
239:
1.41 matt 240: #define VECTOR_END(x) \
1.44 matt 241: EXPORT(__CONCAT(x,_end)); \
242: END(x); \
243: .org _C_LABEL(x) + 0x80
1.1 deraadt 244:
245: /*
1.10 christos 246: * Macros to panic and printf from assembly language.
1.1 deraadt 247: */
1.41 matt 248: #define PANIC(msg) \
249: PTR_LA a0, 9f; \
1.15 castor 250: jal _C_LABEL(panic); \
1.26 cgd 251: nop; \
1.1 deraadt 252: MSG(msg)
253:
1.15 castor 254: #define PRINTF(msg) \
1.41 matt 255: PTR_LA a0, 9f; \
1.15 castor 256: jal _C_LABEL(printf); \
1.26 cgd 257: nop; \
1.1 deraadt 258: MSG(msg)
259:
1.15 castor 260: #define MSG(msg) \
261: .rdata; \
262: 9: .asciiz msg; \
1.1 deraadt 263: .text
264:
1.41 matt 265: #define ASMSTR(str) \
1.15 castor 266: .asciiz str; \
1.12 jonathan 267: .align 3
1.15 castor 268:
1.41 matt 269: #define RCSID(name) .pushsection ".ident"; .asciz name; .popsection
270:
1.15 castor 271: /*
272: * XXX retain dialects XXX
273: */
1.41 matt 274: #define ALEAF(x) XLEAF(x)
275: #define NLEAF(x) LEAF_NOPROFILE(x)
276: #define NON_LEAF(x, fsize, retpc) NESTED(x, fsize, retpc)
277: #define NNON_LEAF(x, fsize, retpc) NESTED_NOPROFILE(x, fsize, retpc)
278:
279: #if defined(__mips_o32)
280: #define SZREG 4
281: #else
282: #define SZREG 8
283: #endif
284:
285: #if defined(__mips_o32) || defined(__mips_o64)
286: #define ALSK 7 /* stack alignment */
287: #define ALMASK -7 /* stack alignment */
288: #define SZFPREG 4
289: #define FP_L lwc1
290: #define FP_S swc1
291: #else
292: #define ALSK 15 /* stack alignment */
293: #define ALMASK -15 /* stack alignment */
294: #define SZFPREG 8
295: #define FP_L ldc1
296: #define FP_S sdc1
297: #endif
1.15 castor 298:
1.22 simonb 299: /*
1.16 castor 300: * standard callframe {
1.44 matt 301: * register_t cf_args[4]; arg0 - arg3 (only on o32 and o64)
1.41 matt 302: * register_t cf_pad[N]; o32/64 (N=0), n32 (N=1) n64 (N=1)
303: * register_t cf_gp; global pointer (only on n32 and n64)
1.16 castor 304: * register_t cf_sp; frame pointer
305: * register_t cf_ra; return address
306: * };
307: */
1.41 matt 308: #if defined(__mips_o32) || defined(__mips_o64)
309: #define CALLFRAME_SIZ (SZREG * (4 + 2))
310: #define CALLFRAME_S0 0
311: #elif defined(__mips_n32) || defined(__mips_n64)
312: #define CALLFRAME_SIZ (SZREG * 4)
313: #define CALLFRAME_S0 (CALLFRAME_SIZ - 4 * SZREG)
314: #endif
315: #ifndef _KERNEL
316: #define CALLFRAME_GP (CALLFRAME_SIZ - 3 * SZREG)
317: #endif
318: #define CALLFRAME_SP (CALLFRAME_SIZ - 2 * SZREG)
319: #define CALLFRAME_RA (CALLFRAME_SIZ - 1 * SZREG)
1.16 castor 320:
1.15 castor 321: /*
1.22 simonb 322: * While it would be nice to be compatible with the SGI
1.15 castor 323: * REG_L and REG_S macros, because they do not take parameters, it
324: * is impossible to use them with the _MIPS_SIM_ABIX32 model.
325: *
1.22 simonb 326: * These macros hide the use of mips3 instructions from the
1.15 castor 327: * assembler to prevent the assembler from generating 64-bit style
328: * ABI calls.
329: */
1.41 matt 330: #if _MIPS_SZPTR == 32
331: #define PTR_ADD add
332: #define PTR_ADDI addi
333: #define PTR_ADDU addu
334: #define PTR_ADDIU addiu
1.45 matt 335: #define PTR_SUB subu
1.41 matt 336: #define PTR_SUBI subi
337: #define PTR_SUBU subu
338: #define PTR_SUBIU subu
339: #define PTR_L lw
340: #define PTR_LA la
341: #define PTR_S sw
342: #define PTR_SLL sll
343: #define PTR_SLLV sllv
344: #define PTR_SRL srl
345: #define PTR_SRLV srlv
346: #define PTR_SRA sra
347: #define PTR_SRAV srav
348: #define PTR_LL ll
349: #define PTR_SC sc
350: #define PTR_WORD .word
351: #define PTR_SCALESHIFT 2
352: #else /* _MIPS_SZPTR == 64 */
353: #define PTR_ADD dadd
354: #define PTR_ADDI daddi
355: #define PTR_ADDU daddu
356: #define PTR_ADDIU daddiu
1.45 matt 357: #define PTR_SUB dsubu
1.41 matt 358: #define PTR_SUBI dsubi
359: #define PTR_SUBU dsubu
360: #define PTR_SUBIU dsubu
361: #define PTR_L ld
362: #define PTR_LA dla
363: #define PTR_S sd
364: #define PTR_SLL dsll
365: #define PTR_SLLV dsllv
366: #define PTR_SRL dsrl
367: #define PTR_SRLV dsrlv
368: #define PTR_SRA dsra
369: #define PTR_SRAV dsrav
370: #define PTR_LL lld
371: #define PTR_SC scd
372: #define PTR_WORD .dword
373: #define PTR_SCALESHIFT 3
374: #endif /* _MIPS_SZPTR == 64 */
375:
376: #if _MIPS_SZINT == 32
377: #define INT_ADD add
378: #define INT_ADDI addi
379: #define INT_ADDU addu
380: #define INT_ADDIU addiu
1.45 matt 381: #define INT_SUB subu
1.41 matt 382: #define INT_SUBI subi
383: #define INT_SUBU subu
384: #define INT_SUBIU subu
385: #define INT_L lw
386: #define INT_LA la
387: #define INT_S sw
388: #define INT_SLL sll
389: #define INT_SLLV sllv
390: #define INT_SRL srl
391: #define INT_SRLV srlv
392: #define INT_SRA sra
393: #define INT_SRAV srav
394: #define INT_LL ll
395: #define INT_SC sc
396: #define INT_WORD .word
397: #define INT_SCALESHIFT 2
398: #else
399: #define INT_ADD dadd
400: #define INT_ADDI daddi
401: #define INT_ADDU daddu
402: #define INT_ADDIU daddiu
1.45 matt 403: #define INT_SUB dsubu
1.41 matt 404: #define INT_SUBI dsubi
405: #define INT_SUBU dsubu
406: #define INT_SUBIU dsubu
407: #define INT_L ld
408: #define INT_LA dla
409: #define INT_S sd
410: #define INT_SLL dsll
411: #define INT_SLLV dsllv
412: #define INT_SRL dsrl
413: #define INT_SRLV dsrlv
414: #define INT_SRA dsra
415: #define INT_SRAV dsrav
416: #define INT_LL lld
417: #define INT_SC scd
418: #define INT_WORD .dword
419: #define INT_SCALESHIFT 3
420: #endif
1.15 castor 421:
1.41 matt 422: #if _MIPS_SZLONG == 32
423: #define LONG_ADD add
424: #define LONG_ADDI addi
425: #define LONG_ADDU addu
426: #define LONG_ADDIU addiu
1.45 matt 427: #define LONG_SUB subu
1.41 matt 428: #define LONG_SUBI subi
429: #define LONG_SUBU subu
430: #define LONG_SUBIU subu
431: #define LONG_L lw
432: #define LONG_LA la
433: #define LONG_S sw
434: #define LONG_SLL sll
435: #define LONG_SLLV sllv
436: #define LONG_SRL srl
437: #define LONG_SRLV srlv
438: #define LONG_SRA sra
439: #define LONG_SRAV srav
440: #define LONG_LL ll
441: #define LONG_SC sc
442: #define LONG_WORD .word
443: #define LONG_SCALESHIFT 2
444: #else
445: #define LONG_ADD dadd
446: #define LONG_ADDI daddi
447: #define LONG_ADDU daddu
448: #define LONG_ADDIU daddiu
1.45 matt 449: #define LONG_SUB dsubu
1.41 matt 450: #define LONG_SUBI dsubi
451: #define LONG_SUBU dsubu
452: #define LONG_SUBIU dsubu
453: #define LONG_L ld
454: #define LONG_LA dla
455: #define LONG_S sd
456: #define LONG_SLL dsll
457: #define LONG_SLLV dsllv
458: #define LONG_SRL dsrl
459: #define LONG_SRLV dsrlv
460: #define LONG_SRA dsra
461: #define LONG_SRAV dsrav
462: #define LONG_LL lld
463: #define LONG_SC scd
464: #define LONG_WORD .dword
465: #define LONG_SCALESHIFT 3
466: #endif
467:
468: #if SZREG == 4
469: #define REG_L lw
470: #define REG_S sw
471: #define REG_LI li
472: #define REG_ADDU addu
473: #define REG_SLL sll
474: #define REG_SLLV sllv
475: #define REG_SRL srl
476: #define REG_SRLV srlv
477: #define REG_SRA sra
478: #define REG_SRAV srav
479: #define REG_LL ll
480: #define REG_SC sc
481: #define REG_SCALESHIFT 2
482: #else
483: #define REG_L ld
484: #define REG_S sd
485: #define REG_LI dli
486: #define REG_ADDU daddu
487: #define REG_SLL dsll
488: #define REG_SLLV dsllv
489: #define REG_SRL dsrl
490: #define REG_SRLV dsrlv
491: #define REG_SRA dsra
492: #define REG_SRAV dsrav
493: #define REG_LL lld
494: #define REG_SC scd
495: #define REG_SCALESHIFT 3
496: #endif
497:
498: #if _MIPS_ISA == _MIPS_ISA_MIPS1 || _MIPS_ISA == _MIPS_ISA_MIPS2 || \
499: _MIPS_ISA == _MIPS_ISA_MIPS32
500: #define MFC0 mfc0
501: #define MTC0 mtc0
502: #endif
503: #if _MIPS_ISA == _MIPS_ISA_MIPS3 || _MIPS_ISA == _MIPS_ISA_MIPS4 || \
504: _MIPS_ISA == _MIPS_ISA_MIPS64
505: #define MFC0 dmfc0
506: #define MTC0 dmtc0
507: #endif
508:
509: #if defined(__mips_o32) || defined(__mips_o64)
510:
511: #ifdef __ABICALLS__
512: #define CPRESTORE(r) .cprestore r
513: #define CPLOAD(r) .cpload r
514: #else
515: #define CPRESTORE(r) /* not needed */
516: #define CPLOAD(r) /* not needed */
517: #endif
518:
519: #define SETUP_GP \
520: .set push; \
521: .set noreorder; \
522: .cpload t9; \
523: .set pop
524: #define SETUP_GPX(r) \
525: .set push; \
526: .set noreorder; \
527: move r,ra; /* save old ra */ \
528: bal 7f; \
529: nop; \
530: 7: .cpload ra; \
531: move ra,r; \
532: .set pop
533: #define SETUP_GPX_L(r,lbl) \
534: .set push; \
535: .set noreorder; \
536: move r,ra; /* save old ra */ \
537: bal lbl; \
538: nop; \
539: lbl: .cpload ra; \
540: move ra,r; \
541: .set pop
542: #define SAVE_GP(x) .cprestore x
543:
544: #define SETUP_GP64(a,b) /* n32/n64 specific */
545: #define SETUP_GP64_R(a,b) /* n32/n64 specific */
546: #define SETUP_GPX64(a,b) /* n32/n64 specific */
547: #define SETUP_GPX64_L(a,b,c) /* n32/n64 specific */
548: #define RESTORE_GP64 /* n32/n64 specific */
549: #define USE_ALT_CP(a) /* n32/n64 specific */
550: #endif /* __mips_o32 || __mips_o64 */
551:
552: #if defined(__mips_o32) || defined(__mips_o64)
1.22 simonb 553: #define REG_PROLOGUE .set push
1.16 castor 554: #define REG_EPILOGUE .set pop
1.41 matt 555: #endif
556: #if defined(__mips_n32) || defined(__mips_n64)
1.15 castor 557: #define REG_PROLOGUE .set push ; .set mips3
558: #define REG_EPILOGUE .set pop
1.41 matt 559: #endif
560:
561: #if defined(__mips_n32) || defined(__mips_n64)
562: #define SETUP_GP /* o32 specific */
563: #define SETUP_GPX(r) /* o32 specific */
564: #define SETUP_GPX_L(r,lbl) /* o32 specific */
565: #define SAVE_GP(x) /* o32 specific */
566: #define SETUP_GP64(a,b) .cpsetup $25, a, b
567: #define SETUP_GPX64(a,b) \
568: .set push; \
569: move b,ra; \
570: .set noreorder; \
571: bal 7f; \
572: nop; \
573: 7: .set pop; \
574: .cpsetup ra, a, 7b; \
575: move ra,b
576: #define SETUP_GPX64_L(a,b,c) \
577: .set push; \
578: move b,ra; \
579: .set noreorder; \
580: bal c; \
581: nop; \
582: c: .set pop; \
583: .cpsetup ra, a, c; \
584: move ra,b
585: #define RESTORE_GP64 .cpreturn
586: #define USE_ALT_CP(a) .cplocal a
587: #endif /* __mips_n32 || __mips_n64 */
1.25 jeffs 588:
589: /*
590: * The DYNAMIC_STATUS_MASK option adds an additional masking operation
591: * when updating the hardware interrupt mask in the status register.
592: *
593: * This is useful for platforms that need to at run-time mask
594: * interrupts based on motherboard configuration or to handle
595: * slowly clearing interrupts.
596: *
597: * XXX this is only currently implemented for mips3.
598: */
599: #ifdef MIPS_DYNAMIC_STATUS_MASK
1.41 matt 600: #define DYNAMIC_STATUS_MASK(sr,scratch) \
1.25 jeffs 601: lw scratch, mips_dynamic_status_mask; \
602: and sr, sr, scratch
1.29 jeffs 603:
1.41 matt 604: #define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1) \
1.29 jeffs 605: ori sr, (MIPS_INT_MASK | MIPS_SR_INT_IE); \
606: DYNAMIC_STATUS_MASK(sr,scratch1)
1.25 jeffs 607: #else
1.41 matt 608: #define DYNAMIC_STATUS_MASK(sr,scratch)
609: #define DYNAMIC_STATUS_MASK_TOUSER(sr,scratch1)
1.25 jeffs 610: #endif
1.1 deraadt 611:
1.38 ad 612: /* See lock_stubs.S. */
1.44 matt 613: #define LOG2_MIPS_LOCK_RAS_SIZE 8
614: #define MIPS_LOCK_RAS_SIZE 256 /* 16 bytes left over */
1.38 ad 615:
1.41 matt 616: #define CPUVAR(off) _C_LABEL(cpu_info_store)+__CONCAT(CPU_INFO_,off)
1.39 yamt 617:
1.8 jonathan 618: #endif /* _MIPS_ASM_H */
CVSweb <webmaster@jp.NetBSD.org>