X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fcommon%2Fmmap-align.h;h=7a5ed990493b98b192b39820789a450ac1473004;hp=c42cdeb34da234b02490db1f0cf25c6fe877893f;hb=328342cd737582216dc7b8b7d558b2a1bf8ea5e8;hpb=3b16a19b790b255ac0ca7561279b258589b58cbe diff --git a/src/common/mmap-align.h b/src/common/mmap-align.h index c42cdeb3..7a5ed990 100644 --- a/src/common/mmap-align.h +++ b/src/common/mmap-align.h @@ -1,28 +1,12 @@ -#ifndef _BABELTRACE_MMAP_ALIGN_H -#define _BABELTRACE_MMAP_ALIGN_H - /* - * Copyright 2010 - Mathieu Desnoyers - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * SPDX-License-Identifier: MIT * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright 2010 Mathieu Desnoyers */ +#ifndef _BABELTRACE_MMAP_ALIGN_H +#define _BABELTRACE_MMAP_ALIGN_H + #include "common/align.h" #include #include @@ -49,7 +33,7 @@ struct mmap_align { static inline off_t get_page_aligned_offset(off_t offset, int log_level) { - return ALIGN_FLOOR(offset, bt_mmap_get_offset_align_size(log_level)); + return BT_ALIGN_FLOOR(offset, bt_mmap_get_offset_align_size(log_level)); } static inline @@ -73,7 +57,7 @@ struct mmap_align *mmap_align(size_t length, int prot, * require a 2 pages page_aligned_length if the range crosses a page * boundary. */ - mma->page_aligned_length = ALIGN(length + offset - page_aligned_offset, page_size); + mma->page_aligned_length = BT_ALIGN(length + offset - page_aligned_offset, page_size); mma->page_aligned_addr = bt_mmap(NULL, mma->page_aligned_length, prot, flags, fd, page_aligned_offset, log_level); if (mma->page_aligned_addr == MAP_FAILED) {