Subversion Repositories HelenOS

Rev

Rev 3743 | Rev 3835 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (c) 2006 Jakub Jermar
  3.  * Copyright (c) 2008 Pavel Rimsky
  4.  * All rights reserved.
  5.  *
  6.  * Redistribution and use in source and binary forms, with or without
  7.  * modification, are permitted provided that the following conditions
  8.  * are met:
  9.  *
  10.  * - Redistributions of source code must retain the above copyright
  11.  *   notice, this list of conditions and the following disclaimer.
  12.  * - Redistributions in binary form must reproduce the above copyright
  13.  *   notice, this list of conditions and the following disclaimer in the
  14.  *   documentation and/or other materials provided with the distribution.
  15.  * - The name of the author may not be used to endorse or promote products
  16.  *   derived from this software without specific prior written permission.
  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 BE LIABLE FOR ANY DIRECT, INDIRECT,
  22.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28.  */
  29.  
  30. /** @addtogroup sparc64interrupt
  31.  * @{
  32.  */
  33. /**
  34.  * @file
  35.  * @brief This file contains fast MMU trap handlers.
  36.  */
  37.  
  38. #ifndef KERN_sparc64_sun4v_MMU_TRAP_H_
  39. #define KERN_sparc64_sun4v_MMU_TRAP_H_
  40.  
  41. #include <arch/stack.h>
  42. #include <arch/sun4v/regdef.h>
  43. #include <arch/mm/tlb.h>
  44. #include <arch/mm/sun4v/mmu.h>
  45. #include <arch/mm/sun4v/tte.h>
  46. #include <arch/trap/regwin.h>
  47.  
  48. #ifdef CONFIG_TSB
  49. #include <arch/mm/tsb.h>
  50. #endif
  51.  
  52. #define TT_FAST_INSTRUCTION_ACCESS_MMU_MISS 0x64
  53. #define TT_FAST_DATA_ACCESS_MMU_MISS        0x68
  54. #define TT_FAST_DATA_ACCESS_PROTECTION      0x6c
  55.  
  56. #define FAST_MMU_HANDLER_SIZE           128
  57.  
  58. #ifdef __ASM__
  59.  
  60. .macro FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER
  61. .endm
  62.  
  63. /*
  64.  * So far it is here only to process the trap which occurs when the kernel
  65.  * needs to access the bootinfo structure, which is placed in the bootloader
  66.  * memory (i.e. before address 0x400000).
  67.  */
  68. .macro FAST_DATA_ACCESS_MMU_MISS_HANDLER tl
  69.     save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
  70.     set 0x8000, %o0
  71.     set 0x0, %o1
  72.     setx 0x80000000804087c3, %g1, %o2
  73.     set 0x3, %o3
  74.     ta 0x83
  75.     restore %g0, 0, %g0
  76.     retry
  77. .endm
  78.  
  79. .macro FAST_DATA_ACCESS_PROTECTION_HANDLER tl
  80. .endm
  81.  
  82. #endif /* __ASM__ */
  83.  
  84. #endif
  85.  
  86. /** @}
  87.  */
  88.