1 // Copyright 2018 The Fuchsia Authors
2 //
3 // Use of this source code is governed by a MIT-style
4 // license that can be found in the LICENSE file or at
5 // https://opensource.org/licenses/MIT
6
7 // Methods in this file exist to provide default stubs for MSI
8 // support so that individual platforms do not need to provide
9 // them if they only partially support MSI.
10
11 #include <dev/interrupt.h>
12
13 #include <stdbool.h>
14 #include <zircon/compiler.h>
15 #include <zircon/types.h>
16
msi_is_supported()17 __WEAK bool msi_is_supported() {
18 return false;
19 }
20
msi_supports_masking()21 __WEAK bool msi_supports_masking() {
22 return false;
23 }
24
msi_mask_unmask(const msi_block_t * block,uint msi_id,bool mask)25 __WEAK void msi_mask_unmask(const msi_block_t* block, uint msi_id, bool mask) {
26 PANIC_UNIMPLEMENTED;
27 }
28
msi_alloc_block(uint requested_irqs,bool can_target_64bit,bool is_msix,msi_block_t * out_block)29 __WEAK zx_status_t msi_alloc_block(uint requested_irqs,
30 bool can_target_64bit,
31 bool is_msix,
32 msi_block_t* out_block) {
33 PANIC_UNIMPLEMENTED;
34 __UNREACHABLE;
35 }
36
msi_free_block(msi_block_t * block)37 __WEAK void msi_free_block(msi_block_t* block) {
38 PANIC_UNIMPLEMENTED;
39 }
40
msi_register_handler(const msi_block_t * block,uint msi_id,int_handler handler,void * ctx)41 __WEAK void msi_register_handler(const msi_block_t* block,
42 uint msi_id,
43 int_handler handler,
44 void *ctx) {
45 PANIC_UNIMPLEMENTED;
46 }
47