Changeset 8b863a62 in mainline for uspace/lib/drv/generic/interrupt.c


Ignore:
Timestamp:
2014-04-16T17:14:06Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f857e8b
Parents:
dba3e2c (diff), 70b570c (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 mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/interrupt.c

    rdba3e2c r8b863a62  
    3939#include <errno.h>
    4040#include <sys/types.h>
     41#include <macros.h>
    4142
    4243#include "ddf/interrupt.h"
     
    5556static interrupt_context_t *find_interrupt_context(
    5657    interrupt_context_list_t *list, ddf_dev_t *dev, int irq);
    57 int register_interrupt_handler(ddf_dev_t *dev, int irq,
    58     interrupt_handler_t *handler, irq_code_t *pseudocode);
    59 int unregister_interrupt_handler(ddf_dev_t *dev, int irq);
    6058
    6159/** Interrupts */
     
    6866};
    6967
    70 static irq_code_t default_pseudocode = {
     68static const irq_code_t default_pseudocode = {
    7169        0,
    7270        NULL,
    73         sizeof(default_cmds) / sizeof(irq_cmd_t),
     71        ARRAY_SIZE(default_cmds),
    7472        default_cmds
    7573};
     
    138136    interrupt_context_list_t *list, int id)
    139137{
    140         interrupt_context_t *ctx;
    141        
    142         fibril_mutex_lock(&list->mutex);
    143        
    144         list_foreach(list->contexts, link) {
    145                 ctx = list_get_instance(link, interrupt_context_t, link);
     138        fibril_mutex_lock(&list->mutex);
     139       
     140        list_foreach(list->contexts, link, interrupt_context_t, ctx) {
    146141                if (ctx->id == id) {
    147142                        fibril_mutex_unlock(&list->mutex);
     
    157152    interrupt_context_list_t *list, ddf_dev_t *dev, int irq)
    158153{
    159         interrupt_context_t *ctx;
    160        
    161         fibril_mutex_lock(&list->mutex);
    162        
    163         list_foreach(list->contexts, link) {
    164                 ctx = list_get_instance(link, interrupt_context_t, link);
     154        fibril_mutex_lock(&list->mutex);
     155       
     156        list_foreach(list->contexts, link, interrupt_context_t, ctx) {
    165157                if (ctx->irq == irq && ctx->dev == dev) {
    166158                        fibril_mutex_unlock(&list->mutex);
     
    175167
    176168int register_interrupt_handler(ddf_dev_t *dev, int irq,
    177     interrupt_handler_t *handler, irq_code_t *pseudocode)
     169    interrupt_handler_t *handler, const irq_code_t *pseudocode)
    178170{
    179171        interrupt_context_t *ctx = create_interrupt_context();
Note: See TracChangeset for help on using the changeset viewer.