Changeset 138 for trunk/hal/x86_64/drivers
- Timestamp:
- Jul 4, 2017, 12:05:39 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/drivers/soclib_xcu.c
r137 r138 1 1 /* 2 * soclib_xcu.c - soclibXCU driver API implementation.2 * soclib_xcu.c - x86 XCU driver API implementation. 3 3 * 4 * Authors Alain Greiner (2016) 5 * 6 * Copyright (c) UPMC Sorbonne Universites 4 * Copyright (c) 2017 Maxime Villard 7 5 * 8 6 * This file is part of ALMOS-MKH. 9 7 * 10 * ALMOS-MKH .is free software; you can redistribute it and/or modify it8 * ALMOS-MKH is free software; you can redistribute it and/or modify it 11 9 * under the terms of the GNU General Public License as published by 12 10 * the Free Software Foundation; version 2.0 of the License. 13 11 * 14 * ALMOS-MKH .is distributed in the hope that it will be useful, but12 * ALMOS-MKH is distributed in the hope that it will be useful, but 15 13 * WITHOUT ANY WARRANTY; without even the implied warranty of 16 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU … … 18 16 * 19 17 * You should have received a copy of the GNU General Public License 20 * along with ALMOS- kernel; if not, write to the Free Software Foundation,18 * along with ALMOS-MKH.; if not, write to the Free Software Foundation, 21 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 20 */ … … 28 26 29 27 #include <hal_apic.h> 28 #include <hal_segmentation.h> 30 29 #include <hal_internal.h> 31 30 32 31 extern size_t ioapic_pins; 33 34 uint64_t apic_fake_status __in_kdata = 0;35 32 36 33 /* … … 40 37 uint32_t wti_baseidx __in_kdata = 0; 41 38 uint32_t pti_baseidx __in_kdata = 0; 39 40 static uint32_t get_pin(uint32_t idx, uint32_t type) 41 { 42 switch (type) { 43 case HWI_TYPE: 44 return hwi_baseidx + idx; 45 case WTI_TYPE: 46 return wti_baseidx + idx; 47 case PTI_TYPE: 48 return pti_baseidx + idx; 49 default: 50 x86_panic("get_pin: wrong type"); 51 return 0; 52 } 53 } 42 54 43 55 void soclib_xcu_init(chdev_t *icu, lid_t lid) … … 56 68 lid_t lid) 57 69 { 70 uint8_t dest = (uint8_t)lid; /* XXX */ 58 71 uint32_t pin; 72 uint8_t vec; 73 74 pin = get_pin(idx, type); 59 75 60 76 switch (type) { 61 77 case HWI_TYPE: 62 pin = hwi_baseidx + idx;78 vec = VECTOR_APIC_XCU_HWI; 63 79 case WTI_TYPE: 64 pin = wti_baseidx + idx;80 vec = VECTOR_APIC_XCU_WTI; 65 81 case PTI_TYPE: 66 pin = pti_baseidx + idx;82 vec = VECTOR_APIC_XCU_PTI; 67 83 default: 68 84 x86_panic("enabling wrong irq"); 69 85 } 86 87 hal_ioapic_set_entry(pin, vec, dest); 70 88 71 89 x86_panic((char *)__func__); … … 75 93 lid_t lid) 76 94 { 95 uint32_t pin = get_pin(idx, type); 96 97 hal_ioapic_disable_entry(pin); 98 77 99 x86_panic((char *)__func__); 78 100 } 79 101 80 void soclib_xcu_get_masks( chdev_t * icu, 81 lid_t lid, 82 uint32_t * hwi_mask, 83 uint32_t * wti_mask, 84 uint32_t * pti_mask ) 102 void soclib_xcu_get_masks(chdev_t *icu, lid_t lid, uint32_t *hwi_mask, 103 uint32_t *wti_mask, uint32_t *pti_mask) 85 104 { 86 105 x86_panic((char *)__func__); … … 101 120 } 102 121 103 104 105 106 107 122 void soclib_xcu_get_status(chdev_t *icu, lid_t lid, uint32_t *hwi_status, 108 123 uint32_t *wti_status, uint32_t *pti_status) … … 114 129 x86_panic((char *)__func__); 115 130 } 116 117 118 119 120 121 131 122 132 void soclib_xcu_send_ipi( xptr_t icu_xp,
Note: See TracChangeset
for help on using the changeset viewer.