Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
alt_interrupt.h
1 
5 /******************************************************************************
6 *
7 * Copyright 2013 Altera Corporation. All Rights Reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of the copyright holder nor the names of its contributors
20 * may be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36 
37 /*
38  * $Id: //depot/embedded/rel/15.0/ip/hps/altera_hps/hwlib/include/alt_interrupt.h#1 $
39  */
40 
41 #ifndef __ALT_INT_H__
42 #define __ALT_INT_H__
43 
44 #ifdef __ALT_INT_NS_H__
45 #error Secure and Non-Secure interrupt API cannot be used together.
46 #endif
47 
48 #include "alt_interrupt_common.h"
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif /* __cplusplus */
54 
93 #ifndef ALT_INT_PROVISION_VECTOR_SUPPORT
94 #define ALT_INT_PROVISION_VECTOR_SUPPORT (1)
95 #endif
96 
106 #ifndef ALT_INT_PROVISION_STACK_SUPPORT
107 #define ALT_INT_PROVISION_STACK_SUPPORT (1)
108 #endif
109 
123 #ifndef ALT_INT_PROVISION_STACK_SIZE
124 #define ALT_INT_PROVISION_STACK_SIZE (4096)
125 #endif
126 
135 #define ALT_INT_PROVISION_INT_COUNT (256)
136 
147 #ifndef ALT_INT_PROVISION_CPU_COUNT
148 #define ALT_INT_PROVISION_CPU_COUNT (1)
149 #endif
150 
172 ALT_STATUS_CODE alt_int_global_init(void);
173 
181 ALT_STATUS_CODE alt_int_global_uninit(void);
182 
193 ALT_STATUS_CODE alt_int_global_enable(void);
194 
205 ALT_STATUS_CODE alt_int_global_disable(void);
206 
217 ALT_STATUS_CODE alt_int_global_enable_ns(void);
218 
229 ALT_STATUS_CODE alt_int_global_disable_ns(void);
230 
241 ALT_STATUS_CODE alt_int_global_enable_all(void);
242 
253 ALT_STATUS_CODE alt_int_global_disable_all(void);
254 
283 ALT_STATUS_CODE alt_int_dist_secure_enable(ALT_INT_INTERRUPT_t int_id);
284 
297 ALT_STATUS_CODE alt_int_dist_secure_disable(ALT_INT_INTERRUPT_t int_id);
298 
310 ALT_STATUS_CODE alt_int_dist_is_secure(ALT_INT_INTERRUPT_t int_id);
311 
312 
328 ALT_STATUS_CODE alt_int_dist_enable(ALT_INT_INTERRUPT_t int_id);
329 
345 ALT_STATUS_CODE alt_int_dist_disable(ALT_INT_INTERRUPT_t int_id);
346 
363 ALT_STATUS_CODE alt_int_dist_is_enabled(ALT_INT_INTERRUPT_t int_id);
364 
365 
384 ALT_STATUS_CODE alt_int_dist_pending_set(ALT_INT_INTERRUPT_t int_id);
385 
403 ALT_STATUS_CODE alt_int_dist_pending_clear(ALT_INT_INTERRUPT_t int_id);
404 
422 ALT_STATUS_CODE alt_int_dist_is_pending(ALT_INT_INTERRUPT_t int_id);
423 
441 ALT_STATUS_CODE alt_int_dist_is_active(ALT_INT_INTERRUPT_t int_id);
442 
443 
464 ALT_STATUS_CODE alt_int_dist_priority_get(ALT_INT_INTERRUPT_t int_id,
465  uint32_t * priority);
466 
487 ALT_STATUS_CODE alt_int_dist_priority_set(ALT_INT_INTERRUPT_t int_id,
488  uint32_t priority);
489 
490 
509 ALT_STATUS_CODE alt_int_dist_target_get(ALT_INT_INTERRUPT_t int_id,
510  alt_int_cpu_target_t * target);
511 
528 ALT_STATUS_CODE alt_int_dist_target_set(ALT_INT_INTERRUPT_t int_id,
529  alt_int_cpu_target_t target);
530 
531 
551 ALT_STATUS_CODE alt_int_dist_trigger_get(ALT_INT_INTERRUPT_t int_id,
552  ALT_INT_TRIGGER_t * trigger_type);
553 
574 ALT_STATUS_CODE alt_int_dist_trigger_set(ALT_INT_INTERRUPT_t int_id,
575  ALT_INT_TRIGGER_t trigger_type);
576 
633 ALT_STATUS_CODE alt_int_sgi_trigger(ALT_INT_INTERRUPT_t int_id,
634  ALT_INT_SGI_TARGET_t target_filter,
635  alt_int_cpu_target_t target_list,
636  bool secure_only);
637 
659 ALT_STATUS_CODE alt_int_cpu_init(void);
660 
665 ALT_STATUS_CODE alt_int_cpu_uninit(void);
666 
677 ALT_STATUS_CODE alt_int_cpu_enable(void);
678 
689 ALT_STATUS_CODE alt_int_cpu_disable(void);
690 
701 ALT_STATUS_CODE alt_int_cpu_enable_ns(void);
702 
713 ALT_STATUS_CODE alt_int_cpu_disable_ns(void);
714 
725 ALT_STATUS_CODE alt_int_cpu_enable_all(void);
726 
737 ALT_STATUS_CODE alt_int_cpu_disable_all(void);
738 
739 
798 ALT_STATUS_CODE alt_int_cpu_config_get(bool* use_secure_binary_point,
799  bool* use_FIQ_for_secure_interrupts,
800  bool* allow_secure_ack_all_interrupts);
801 
856 ALT_STATUS_CODE alt_int_cpu_config_set(bool use_secure_binary_point,
857  bool use_FIQ_for_secure_interrupts,
858  bool allow_secure_ack_all_interrupts);
859 
860 
869 uint32_t alt_int_cpu_priority_mask_get(void);
870 
885 ALT_STATUS_CODE alt_int_cpu_priority_mask_set(uint32_t priority_mask);
886 
896 uint32_t alt_int_cpu_binary_point_get(void);
897 
913 ALT_STATUS_CODE alt_int_cpu_binary_point_set(uint32_t binary_point);
914 
925 uint32_t alt_int_cpu_binary_point_get_ns(void);
926 
943 ALT_STATUS_CODE alt_int_cpu_binary_point_set_ns(uint32_t binary_point);
944 
980 ALT_STATUS_CODE alt_int_isr_register(ALT_INT_INTERRUPT_t int_id,
981  alt_int_callback_t callback,
982  void * context);
983 
998 ALT_STATUS_CODE alt_int_isr_unregister(ALT_INT_INTERRUPT_t int_id);
999 
1017 uint32_t alt_int_util_cpu_count(void);
1018 
1024 uint32_t alt_int_util_int_count(void);
1025 
1032 
1041 #ifdef __cplusplus
1042 }
1043 #endif
1044 
1045 #endif /* __ALT_INT_H__ */