Changeset 35a96cf in mainline


Ignore:
Timestamp:
2006-05-13T20:11:13Z (19 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6326f5e6
Parents:
2666daa
Message:

Sysinfo userspace interface

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/drivers/vesa.c

    r2666daa r35a96cf  
    4242#include <memstr.h>
    4343#include <bitops.h>
     44#include <sysinfo/sysinfo.h>
    4445
    4546__u32 vesa_ph_addr;
     
    7980
    8081        fb_init(vram_lin_addr, vesa_width, vesa_height, vesa_bpp, vesa_scanline);
     82       
     83        sysinfo_set_item_val("Framebuffer.address.physical",NULL,vesa_ph_addr);
    8184}
    8285
  • genarch/src/fb/fb.c

    r2666daa r35a96cf  
    366366        sysinfo_set_item_val("Framebuffer.scanline",NULL,scan);
    367367        sysinfo_set_item_val("Framebuffer.bpp",NULL,bpp);
    368         sysinfo_set_item_val("Framebuffer.address",NULL,addr);
    369        
    370 
    371 
    372 }
     368        sysinfo_set_item_val("Framebuffer.address.virtual",NULL,addr);
     369       
     370
     371
     372}
  • generic/include/syscall/syscall.h

    r2666daa r35a96cf  
    5959        SYS_IOSPACE_ENABLE,
    6060        SYS_PREEMPT_CONTROL,
     61        SYS_SYSINFO_VALID,
     62        SYS_SYSINFO_VALUE,
    6163        SYSCALL_END
    6264} syscall_t;
  • generic/include/sysinfo/sysinfo.h

    r2666daa r35a96cf  
    5252sysinfo_rettype_t sysinfo_get_val(const char *name,sysinfo_item_t **root);
    5353
     54__native sys_sysinfo_valid(__native ptr,__native len);
     55__native sys_sysinfo_value(__native ptr,__native len);
     56
     57
  • generic/src/syscall/syscall.c

    r2666daa r35a96cf  
    4646#include <security/cap.h>
    4747#include <syscall/copy.h>
     48#include <sysinfo/sysinfo.h>
    4849
    4950static __native sys_io(int fd, const void * buf, size_t count) {
     
    109110        sys_physmem_map,
    110111        sys_iospace_enable,
    111         sys_preempt_control
     112        sys_preempt_control,
     113       
     114        /* Sysinfo syscalls */
     115        sys_sysinfo_valid,
     116        sys_sysinfo_value
    112117};
  • generic/src/sysinfo/sysinfo.c

    r2666daa r35a96cf  
    22#include <mm/slab.h>
    33#include <print.h>
     4#include <syscall/copy.h>
    45
    56sysinfo_item_t *_root=NULL;
     
    221222        return ret;
    222223}
     224
     225__native sys_sysinfo_valid(__native ptr,__native len)
     226{
     227        char *str;
     228        sysinfo_rettype_t ret;
     229        str=malloc(len+1,0);
     230        ASSERT(str);
     231        copy_from_uspace(str,(void *)ptr,len+1);
     232        if(str[len]) return 0;          /*This is not len lenght C string*/
     233        ret=sysinfo_get_val(str,NULL);
     234        free(str);
     235        return ret.valid;
     236}
     237
     238__native sys_sysinfo_value(__native ptr,__native len)
     239{
     240        char *str;
     241        sysinfo_rettype_t ret;
     242        str=malloc(len+1,0);
     243        ASSERT(str);
     244        copy_from_uspace(str,(void *)ptr,len+1);
     245        if(str[len]) return 0;          /*This is not len lenght C string*/
     246        ret=sysinfo_get_val(str,NULL);
     247        free(str);
     248        return ret.val;
     249}
     250
     251
Note: See TracChangeset for help on using the changeset viewer.