Changeset 91b60499 in mainline for kernel/generic/include/ddi/irq.h


Ignore:
Timestamp:
2017-09-30T06:29:42Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
300f4c4
Parents:
d076f16 (diff), 6636fb19 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge support for capabilities from lp:~jakub/helenos/caps

This commit introduces capabilities as task-local names for references to kernel
objects. Kernel objects are reference-counted wrappers for a select group of
objects allocated in and by the kernel that can be made accessible to userspace
in a controlled way via integer handles.

So far, a kernel object encapsulates either an irq_t or a phone_t.

Support for the former lead to the removal of kernel-assigned devnos and
unsecure deregistration of IRQs in which a random task was able to unregister
some other task's IRQ.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ddi/irq.h

    rd076f16 r91b60499  
    4343#include <proc/task.h>
    4444#include <ipc/ipc.h>
     45#include <mm/slab.h>
     46
     47typedef enum {
     48        IRQ_HT_KEY_INR,
     49        IRQ_HT_KEY_MODE
     50} irq_ht_key_t;
     51
     52typedef enum {
     53        IRQ_HT_MODE_CLAIM,
     54        IRQ_HT_MODE_NO_CLAIM
     55} irq_ht_mode_t;
    4556
    4657typedef enum {
     
    7081        /** When false, notifications are not sent. */
    7182        bool notify;
     83        /** True if the structure is in irq_uspace_hash_table_table */
     84        bool hashed_in;
    7285        /** Answerbox for notifications. */
    7386        answerbox_t *answerbox;
     
    7689        /** Arguments that will be sent if the IRQ is claimed. */
    7790        uint32_t scratch[IPC_CALL_LEN];
    78         /** Top-half pseudocode. */
     91        /** Top-half IRQ code. */
    7992        irq_code_t *code;
    8093        /** Counter. */
    8194        size_t counter;
    82        
    83         /**
    84          * Link between IRQs that are notifying the same answerbox. The list is
    85          * protected by the answerbox irq_lock.
    86          */
    87         link_t link;
    8895} ipc_notif_cfg_t;
    8996
     
    9198 *
    9299 * If one device has multiple interrupts, there will be multiple irq_t
    93  * instantions with the same devno.
    94  *
     100 * instantions.
    95101 */
    96102typedef struct irq {
     
    112118         */
    113119        bool preack;
    114        
    115         /** Unique device number. -1 if not yet assigned. */
    116         devno_t devno;
    117120       
    118121        /** Actual IRQ number. -1 if not yet assigned. */
     
    139142extern hash_table_t irq_uspace_hash_table;
    140143
     144extern slab_cache_t *irq_slab;
     145
    141146extern inr_t last_inr;
    142147
Note: See TracChangeset for help on using the changeset viewer.