5
Last change
on this file since b264998 was
b264998,
checked in by Gedare Bloom <gedare@…>, on 07/24/17 at 18:46:49
|
posix: replace mmap mappings lock with libio lock
Use the libio mutex lock instead of the mmap mappings lock.
Updates #2859.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Internal Support for POSIX 1003.1b 6.3.1 - map pages of memory |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * Copyright (c) 2012 Chris Johns |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef _RTEMS_POSIX_MMANIMPL_H |
---|
17 | #define _RTEMS_POSIX_MMANIMPL_H |
---|
18 | |
---|
19 | #include <rtems/libio_.h> |
---|
20 | #include <rtems/chain.h> /* FIXME: use score chains for proper layering? */ |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif |
---|
25 | |
---|
26 | /* FIXME: add Doxygen */ |
---|
27 | |
---|
28 | /** |
---|
29 | * Every mmap'ed region has a mapping. |
---|
30 | */ |
---|
31 | typedef struct mmap_mappings_s { |
---|
32 | rtems_chain_node node; /**< The mapping chain's node */ |
---|
33 | void* addr; /**< The address of the mapped memory */ |
---|
34 | size_t len; /**< The length of memory mapped */ |
---|
35 | int flags; /**< The mapping flags */ |
---|
36 | rtems_libio_t *iop; /**< The mapped object's file descriptor pointer */ |
---|
37 | bool is_shared_shm; /**< True if MAP_SHARED of shared memory */ |
---|
38 | } mmap_mapping; |
---|
39 | |
---|
40 | extern rtems_chain_control mmap_mappings; |
---|
41 | |
---|
42 | static inline void mmap_mappings_lock_obtain( void ) |
---|
43 | { |
---|
44 | rtems_libio_lock(); |
---|
45 | } |
---|
46 | |
---|
47 | static inline void mmap_mappings_lock_release( void ) |
---|
48 | { |
---|
49 | rtems_libio_unlock(); |
---|
50 | } |
---|
51 | |
---|
52 | #ifdef __cplusplus |
---|
53 | } |
---|
54 | #endif |
---|
55 | |
---|
56 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.