Fork me on GitHub

root/include/fiwix/mman.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * fiwix/include/fiwix/mman.h
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #ifndef _FIWIX_MMAN_H
   9 #define _FIWIX_MMAN_H
  10 
  11 #include <fiwix/fs.h>
  12 
  13 #define PROT_READ       0x1             /* page can be read */
  14 #define PROT_WRITE      0x2             /* page can be written */
  15 #define PROT_EXEC       0x4             /* page can be executed */
  16 #define PROT_NONE       0x0             /* page cannot be accessed */
  17 
  18 #define MAP_SHARED      0x01            /* share changes */
  19 #define MAP_PRIVATE     0x02            /* changes are private */
  20 #define MAP_TYPE        0x0f            /* mask for type of mapping */
  21 #define MAP_FIXED       0x10            /* interpret address exactly */
  22 #define MAP_ANONYMOUS   0x20            /* don't use the file descriptor */
  23 
  24 #define MAP_GROWSDOWN   0x0100          /* stack-like segment */
  25 #define MAP_DENYWRITE   0x0800          /* -ETXTBSY */
  26 #define MAP_EXECUTABLE  0x1000          /* mark it as a executable */
  27 #define MAP_LOCKED      0x2000          /* pages are locked */
  28 
  29 #define ZERO_PAGE       0x80000000      /* this page must be zero-filled */
  30 
  31 #define MS_ASYNC        1               /* sync memory asynchronously */
  32 #define MS_INVALIDATE   2               /* invalidate the caches */
  33 #define MS_SYNC         4               /* synchronous memory sync */
  34 
  35 #define MCL_CURRENT     1               /* lock all current mappings */
  36 #define MCL_FUTURE      2               /* lock all future mappings */
  37 
  38 /* compatibility flags */
  39 #define MAP_ANON        MAP_ANONYMOUS
  40 #define MAP_FILE        0
  41 
  42 struct mmap {
  43         unsigned int start;
  44         unsigned int length;
  45         unsigned int prot;
  46         unsigned int flags;
  47         int fd;
  48         unsigned int offset;
  49 };
  50 
  51 void show_vma_regions(struct proc *);
  52 void release_binary(void);
  53 struct vma * find_vma_region(unsigned int);
  54 int expand_heap(unsigned int);
  55 int do_mmap(struct inode *, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, char, char);
  56 int do_munmap(unsigned int, __size_t);
  57 int do_mprotect(struct vma *, unsigned int, __size_t, int);
  58 
  59 #endif /* _FIWIX_MMAN_H */

/* [previous][next][first][last][top][bottom][index][help] */