[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCHv4 25/43] plat/kvm: Add interrupt handle APIs for arm64
Hi Wei, On 07/06/2018 10:03 AM, Wei Chen wrote: These APIs are necessary for Unikraft. We have provided local CPU interrupt functions already, so they can be wrapped in lcpu.c easily. But we haven't implemented GIC libraries, so the APIs in intctrl.c are TODO. Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx> --- plat/kvm/arm/intctrl.c | 24 ++++++++++++++ plat/kvm/arm/lcpu.c | 75 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 plat/kvm/arm/intctrl.c create mode 100644 plat/kvm/arm/lcpu.c diff --git a/plat/kvm/arm/intctrl.c b/plat/kvm/arm/intctrl.c new file mode 100644 index 0000000..1039d7c --- /dev/null +++ b/plat/kvm/arm/intctrl.c @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: ISC */ +#include <stdint.h> +#include <arm/cpu.h> +#include <kvm/intctrl.h> + +void intctrl_init(void) +{ + // TO DO +} + +void intctrl_ack_irq(unsigned int irq) +{ + // TO DO +} + +void intctrl_mask_irq(unsigned int irq) +{ + // TO DO +} + +void intctrl_clear_irq(unsigned int irq) +{ + // TO DO +} From a quick grep in unikraft, I don't see any user of those helpers. So why are they defined? diff --git a/plat/kvm/arm/lcpu.c b/plat/kvm/arm/lcpu.c new file mode 100644 index 0000000..f7bb7f3 --- /dev/null +++ b/plat/kvm/arm/lcpu.c @@ -0,0 +1,75 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * Authors: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> + * Costin Lupu <costin.lupu@xxxxxxxxx> + * Wei Chen <wei.chen@xxxxxxx> + * + * Copyright (c) 2017, NEC Europe Ltd., NEC Corporation. All rights reserved. + * Copyright (c) 2018, Arm Ltd., All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of the copyright holder 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 AND CONTRIBUTORS "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 HOLDER 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. + * + * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. + */ + +#include <stdint.h> +#include <uk/plat/lcpu.h> +#include <arm/irq.h> + + +void ukplat_lcpu_enable_irq(void) +{ + local_irq_enable(); +} + +void ukplat_lcpu_disable_irq(void) +{ + local_irq_disable(); +} + +unsigned long ukplat_lcpu_save_irqf(void) +{ + unsigned long flags; + + local_irq_save(flags); + + return flags; +} + +void ukplat_lcpu_restore_irqf(unsigned long flags) +{ + local_irq_restore(flags); +} + +int ukplat_lcpu_irqs_disabled(void) +{ + return irqs_disabled(); +} + +void ukplat_lcpu_irqs_handle_pending(void) +{ + +} Cheers, -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |