Changeset 9a8d91b in mainline


Ignore:
Timestamp:
2006-04-12T16:40:35Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1ace9ea
Parents:
b7f364e
Message:

Add task_find_by_id().
Add kernel support for SYS_MAP_PHYSMEM.

Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    rb7f364e r9a8d91b  
    109109        generic/src/console/cmd.c \
    110110        generic/src/cpu/cpu.c \
     111        generic/src/ddi/ddi.c \
    111112        generic/src/interrupt/interrupt.c \
    112113        generic/src/main/main.c \
  • generic/include/errno.h

    rb7f364e r9a8d91b  
    3838#define EFORWARD   -5  /* Forward error */
    3939#define EPERM      -6  /* Permission denied */
    40 #define EHANGUP    -7  /* Answerbox closed cionnection, call sys_ipc_hangup
     40#define EHANGUP    -7  /* Answerbox closed connection, call sys_ipc_hangup
    4141                        * to close the connection. Used by answerbox
    4242                        * to close the connection.  */
  • generic/include/mm/as.h

    rb7f364e r9a8d91b  
    5757#define AS_AREA_WRITE   2
    5858#define AS_AREA_EXEC    4
     59#define AS_AREA_DEVICE  8
    5960
    6061/** Address space area structure.
  • generic/include/proc/task.h

    rb7f364e r9a8d91b  
    5959extern task_t *task_create(as_t *as, char *name);
    6060extern task_t *task_run_program(void *program_addr, char *name);
     61extern task_t *task_find_by_id(task_id_t id);
    6162
    6263extern __native sys_get_task_id(task_id_t *uspace_task_id);
  • generic/include/syscall/syscall.h

    rb7f364e r9a8d91b  
    4949        SYS_IPC_WAIT,
    5050        SYS_IPC_HANGUP,
     51        SYS_MAP_PHYSMEM,
    5152        SYSCALL_END
    5253} syscall_t;
  • generic/src/mm/as.c

    rb7f364e r9a8d91b  
    353353        int flags;
    354354
    355         flags = PAGE_USER | PAGE_PRESENT | PAGE_CACHEABLE;
     355        flags = PAGE_USER | PAGE_PRESENT;
    356356       
    357357        if (a->flags & AS_AREA_READ)
     
    364364                flags |= PAGE_EXEC;
    365365       
     366        if (!(a->flags & AS_AREA_DEVICE))
     367                flags |= PAGE_CACHEABLE;
     368               
    366369        return flags;
    367370}
  • generic/src/proc/task.c

    rb7f364e r9a8d91b  
    173173}
    174174
     175/** Find task structure corresponding to task ID.
     176 *
     177 * The tasks_lock must be already held by the caller of this function
     178 * and interrupts must be disabled.
     179 *
     180 * @param id Task ID.
     181 *
     182 * @return Task structure address or NULL if there is no such task ID.
     183 */
     184task_t *task_find_by_id(task_id_t id)
     185{
     186        btree_node_t *leaf;
     187       
     188        return (task_t *) btree_search(&tasks_btree, (btree_key_t) id, &leaf);
     189}
     190
    175191/** Print task list */
    176192void task_print_list(void)
  • generic/src/syscall/syscall.c

    rb7f364e r9a8d91b  
    3838#include <ipc/sysipc.h>
    3939#include <synch/futex.h>
     40#include <ddi/ddi.h>
    4041
    4142static __native sys_io(int fd, const void * buf, size_t count) {
     
    9293        sys_ipc_forward_fast,
    9394        sys_ipc_wait_for_call,
    94         sys_ipc_hangup
     95        sys_ipc_hangup,
     96        sys_map_physmem
    9597};
Note: See TracChangeset for help on using the changeset viewer.