| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chromeos/binder/driver.h" | 5 #include "chromeos/binder/driver.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/android/binder.h> | 9 #include <linux/android/binder.h> |
| 10 #include <stddef.h> |
| 10 #include <sys/ioctl.h> | 11 #include <sys/ioctl.h> |
| 11 #include <sys/mman.h> | 12 #include <sys/mman.h> |
| 12 #include <sys/user.h> | 13 #include <sys/user.h> |
| 13 | 14 |
| 14 #include "base/posix/eintr_wrapper.h" | 15 #include "base/posix/eintr_wrapper.h" |
| 15 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
| 16 | 17 |
| 17 namespace binder { | 18 namespace binder { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 base::ThreadRestrictions::AssertIOAllowed(); | 101 base::ThreadRestrictions::AssertIOAllowed(); |
| 101 return HANDLE_EINTR(ioctl(fd_.get(), BINDER_THREAD_EXIT, 0)) != -1; | 102 return HANDLE_EINTR(ioctl(fd_.get(), BINDER_THREAD_EXIT, 0)) != -1; |
| 102 } | 103 } |
| 103 | 104 |
| 104 size_t Driver::GetBinderMmapSize() const { | 105 size_t Driver::GetBinderMmapSize() const { |
| 105 // Subtract PAGESIZE * 2 to make room for guard pages. https://goo.gl/4Q6sPe | 106 // Subtract PAGESIZE * 2 to make room for guard pages. https://goo.gl/4Q6sPe |
| 106 return 1024 * 1024 - sysconf(_SC_PAGESIZE) * 2; | 107 return 1024 * 1024 - sysconf(_SC_PAGESIZE) * 2; |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace binder | 110 } // namespace binder |
| OLD | NEW |