Changeset 99 for trunk/hal/x86_64/core/hal_irqmask.c
- Timestamp:
- Jun 29, 2017, 3:48:39 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_irqmask.c
r51 r99 1 1 /* 2 * hal_irqmask.c - implementation of Generic IRQ Masking API for TSAR-MIPS32 3 * 4 * Author Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016) 2 * hal_irqmask.c - implementation of Generic IRQ Masking API for x86 6 3 * 7 * Copyright (c) UPMC Sorbonne Universites 8 * 9 * This file is part of ALMOS-MKH.. 4 * Copyright (c) 2017 Maxime Villard 10 5 * 11 * ALMOS-MKH. is free software; you can redistribute it and/or modify it 6 * This file is part of ALMOS-MKH. 7 * 8 * ALMOS-MKH is free software; you can redistribute it and/or modify it 12 9 * under the terms of the GNU General Public License as published by 13 10 * the Free Software Foundation; version 2.0 of the License. 14 11 * 15 * 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 16 13 * WITHOUT ANY WARRANTY; without even the implied warranty of 17 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU … … 26 23 #include <hal_internal.h> 27 24 28 inline void hal_disable_irq( uint32_t * old ) 25 static int interrupts_enabled __in_kdata = 0; 26 27 inline void hal_disable_irq(uint32_t *old) 28 { 29 if (!interrupts_enabled) { 30 x86_panic("nested critical sections forbidden"); 31 } 32 interrupts_enabled = 0; 33 cli(); 34 } 35 36 inline void hal_enable_irq(uint32_t *old) 37 { 38 if (interrupts_enabled) { 39 x86_panic("nested critical sections forbidden"); 40 } 41 interrupts_enabled = 1; 42 sti(); 43 } 44 45 inline void hal_restore_irq(uint32_t old) 29 46 { 30 47 x86_panic((char *)__func__); 31 48 } 32 49 33 inline void hal_enable_irq( uint32_t * old )34 {35 x86_panic((char *)__func__);36 }37 38 inline void hal_restore_irq( uint32_t old )39 {40 x86_panic((char *)__func__);41 }42
Note: See TracChangeset
for help on using the changeset viewer.