/*
 * Copyright (c) 2022 NVIDIA CORPORATION.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/* NOTE: This is a dummy header file to parse the doxygen comments for APIs
 * implemented using assembly language. The file defines C function prototype
 * corresponding to the ASM APIs and captures doxygen comments accordingly.
 * This function won't be used for any software development and shall not be
 * delivered to the customer
 */

/**
 * @brief bad_irq_handler macro
 *
 * Defines the handler for an interrupt vector for which there is
 * no other handler.  Calls the function:
 *      void bad_irq(uint32_t vector)
 *
 * ASM MACRO: .macro  bad_irq_handler label, vector 
 *
 * @param[in] label  Label to be applied to the code
 * @param[in] vector Tegra interrupt vector. It is a number that encodes both
 *                   VIC instance ID and local IRQ number
 *                   [0 - MAX_VIC_INTERRUPT_VECTOR]
 */
bad_irq_handler(label, vector);

/**
 * @brief Interrupt handler with address as input
 *
 * Interrupt handlers that take an address as a parameter to be passed
 * to a C function with the prototype:
 *     void func(void *addr)
 *
 * ASM MACRO: .macro  isr_addr         label, addr, func, vector 
 *
 * @param[in] label  Label to be applied to the code
 * @param[in] addr   Address to be passed to the function
 * @param[in] func   Function to be called
 * @param[in] vector Tegra interrupt vector. It is a number that encodes both
 *                   VIC instance ID and local IRQ number
 *                   [0 - MAX_VIC_INTERRUPT_VECTOR]
 *
 */
isr_addr(label, addr, func, vector);

/**
 * @brief Interrupt handler with value as an input to the function
 * Interrupt handlers that take a value as a parameter to be passed
 * to a C function with the prototype:
 *     void func(uint32_t value)
 *
 * ASM MACRO : .macro  isr_value       label, value, func, vector  
 *
 * @param[in] label  Label to be applied to the code
 * @param[in] value  16-bit constant value to be passed to the function
 * @param[in] func   Function to be called
 * @param[in] vector Tegra interrupt vector. It is a number that encodes both
 *                   VIC instance ID and local IRQ number
 *                   [0 - MAX_VIC_INTERRUPT_VECTOR]
 *
 */
isr_value(label, value, func, vector);

/**
 * @brief ACK_VIC0_IRQ macro
 *
 * Acknowledges an interrupt originating from VIC0.
 *
 * ASM MACRO: .macro  ACK_VIC0_IRQ    label 
 *
 * Usage:
 *      ACK_VIC0_IRQ label
 *
 * Registers Modified:
 *      R0
 *
 */
ACK_VIC0_IRQ(label);

/**
 * @brief ACK_VIC1_IRQ macro
 *
 * Acknowledges an interrupt originating from VIC1.
 *
 * ASM MACRO: .macro  ACK_VIC1_IRQ    label 
 *
 * Usage:
 *      ACK_VIC1_IRQ label
 *
 * Registers Modified:
 *      R0
 *      R1
 *
 * @param[in] label Label to be applied to the code
 */
ACK_VIC1_IRQ(lable);

/**
 * @brief isr_map_entry macro
 *
 * Creates an ISR map entry
 *
 * ASM MACRO: .macro  isr_map_entry   vector, isr_fn 
 *
 * Usage:
 *      isr_map_entry vector, isr_fn
 *
 * @param[in] vector Tegra interrupt vector. It is a number that encodes both
 *                   VIC instance ID and local IRQ number
 *                   [0 - MAX_VIC_INTERRUPT_VECTOR]
 * @param[in] isr_fn Assembler ISR function that will be dispatched when an
 *                   interrupt occurs
 *
 * @pre
 * - Interrupts set using static configuration
 *
 */
isr_map_entry(vector, isr_fn);

#endif
