Ignore:
Timestamp:
Mar 5, 2013, 4:00:09 PM (12 years ago)
Author:
meunier
Message:

Ajout du malloc dans le Giet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/stdio.c

    r228 r232  
    2121#define SYSCALL_GCD_WRITE       0x06
    2222#define SYSCALL_GCD_READ        0x07
    23 #define SYSCALL_TASK_ID         0x09
     23#define SYSCALL_HEAP_INFO       0x08
     24#define SYSCALL_PROC_TASK_ID    0x09
     25#define SYSCALL_GLOBAL_TASK_ID  0x0A
    2426#define SYSCALL_CTX_SWITCH      0x0D
    2527#define SYSCALL_EXIT            0x0E
     
    742744
    743745//////////////////////////////////////////////////////////////////////////////////
    744 // giet_get_task_id()
    745 // The user task calling this function is descheduled and
    746 // the processor is allocated to another task.
    747 //////////////////////////////////////////////////////////////////////////////////
    748 unsigned int giet_task_id() {
    749     return sys_call(SYSCALL_TASK_ID, 0, 0, 0, 0);
    750 }
    751 
     746// giet_proc_task_id()
     747// This functions returns the local task id, i.e. the processor task id (ranging
     748// from 0 to n-1(p) for each processor if p has n tasks)
     749//////////////////////////////////////////////////////////////////////////////////
     750unsigned int giet_proc_task_id() {
     751    return sys_call(SYSCALL_PROC_TASK_ID, 0, 0, 0, 0);
     752}
     753
     754//////////////////////////////////////////////////////////////////////////////////
     755// giet_heap_info()
     756// This function returns the base address and size of the current task's heap
     757//////////////////////////////////////////////////////////////////////////////////
     758unsigned int giet_heap_info(unsigned int * vaddr, unsigned int * length) {
     759    return sys_call(SYSCALL_HEAP_INFO, (unsigned int) vaddr, (unsigned int) length, 0, 0);
     760}
     761
     762
     763//////////////////////////////////////////////////////////////////////////////////
     764// giet_global_task_id()
     765// This functions returns the global task id, which is unique in all the giet
     766//////////////////////////////////////////////////////////////////////////////////
     767unsigned int giet_global_task_id() {
     768    return sys_call(SYSCALL_GLOBAL_TASK_ID, 0, 0, 0, 0);
     769}
    752770
    753771// Local Variables:
Note: See TracChangeset for help on using the changeset viewer.