Changeset e3c762cd in mainline for generic/src/ipc/irq.c


Ignore:
Timestamp:
2006-05-05T11:59:19Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
de07bcf
Parents:
22cf454d
Message:

Complete implementation of copy_from_uspace() and copy_to_uspace()
for amd64 and ia32. Other architectures still compile and run,
but need to implement their own assembly-only memcpy(), memcpy_from_uspace(),
memcpy_to_uspace() and their failover parts. For these architectures
only dummy implementations are provided.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/ipc/irq.c

    r22cf454d re3c762cd  
    4848#include <ipc/irq.h>
    4949#include <atomic.h>
     50#include <syscall/copy.h>
    5051
    5152typedef struct {
     
    121122        irq_code_t *code;
    122123        irq_cmd_t *ucmds;
     124        int rc;
    123125
    124126        code = malloc(sizeof(*code), 0);
    125         copy_from_uspace(code, ucode, sizeof(*code));
     127        rc = copy_from_uspace(code, ucode, sizeof(*code));
     128        if (rc != 0) {
     129                free(code);
     130                return NULL;
     131        }
    126132       
    127133        if (code->cmdcount > IRQ_MAX_PROG_SIZE) {
     
    131137        ucmds = code->cmds;
    132138        code->cmds = malloc(sizeof(code->cmds[0]) * (code->cmdcount), 0);
    133         copy_from_uspace(code->cmds, ucmds, sizeof(code->cmds[0]) * (code->cmdcount));
     139        rc = copy_from_uspace(code->cmds, ucmds, sizeof(code->cmds[0]) * (code->cmdcount));
     140        if (rc != 0) {
     141                free(code->cmds);
     142                free(code);
     143                return NULL;
     144        }
    134145
    135146        return code;
Note: See TracChangeset for help on using the changeset viewer.