Subversion Repositories Kolibri OS

Rev

Rev 4874 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1.  
  2. #include <sys/types.h>
  3. #include <sys/kos_io.h>
  4.  
  5. int get_fileinfo(const char *path, fileinfo_t *info)
  6. {
  7.     int retval;
  8.  
  9.     __asm__ __volatile__ (
  10.     "pushl $0 \n\t"
  11.     "pushl $0 \n\t"
  12.     "movl %1, 1(%%esp) \n\t"
  13.     "pushl %%ebx \n\t"
  14.     "pushl $0 \n\t"
  15.     "pushl $0 \n\t"
  16.     "pushl $0 \n\t"
  17.     "pushl $5 \n\t"
  18.     "movl %%esp, %%ebx \n\t"
  19.     "movl $70, %%eax \n\t"
  20.     "int $0x40 \n\t"
  21.     "addl $28, %%esp \n\t"
  22.     :"=a" (retval)
  23.     :"r" (path), "b" (info));
  24.    return retval;
  25. };
  26.  
  27.  
  28. int set_fileinfo(const char *path, fileinfo_t *info)
  29. {
  30.     int retval;
  31.  
  32.     __asm__ __volatile__ (
  33.     "pushl $0 \n\t"
  34.     "pushl $0 \n\t"
  35.     "movl %1, 1(%%esp) \n\t"
  36.     "pushl %%ebx \n\t"
  37.     "pushl $0 \n\t"
  38.     "pushl $0 \n\t"
  39.     "pushl $0 \n\t"
  40.     "pushl $6 \n\t"
  41.     "movl %%esp, %%ebx \n\t"
  42.     "movl $70, %%eax \n\t"
  43.     "int $0x40 \n\t"
  44.     "addl $28, %%esp \n\t"
  45.     :"=a" (retval)
  46.     :"r" (path), "b" (info));
  47.    return retval;
  48. };
  49.