mkimg.h (263831) | mkimg.h (263844) |
---|---|
1/*- 2 * Copyright (c) 2014 Juniper Networks, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2014 Juniper Networks, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: user/marcel/mkimg/mkimg.h 263831 2014-03-27 20:14:40Z marcel $ | 26 * $FreeBSD: user/marcel/mkimg/mkimg.h 263844 2014-03-27 22:45:05Z marcel $ |
27 */ 28 29#ifndef _MKIMG_MKIMG_H_ 30#define _MKIMG_MKIMG_H_ 31 32#include <sys/queue.h> 33 34typedef int64_t lba_t; --- 20 unchanged lines hidden (view full) --- 55extern u_int verbose; 56 57extern u_int ncyls; 58extern u_int nheads; 59extern u_int nsecs; 60extern u_int secsz; /* Logical block size. */ 61extern u_int blksz; /* Physical block size. */ 62 | 27 */ 28 29#ifndef _MKIMG_MKIMG_H_ 30#define _MKIMG_MKIMG_H_ 31 32#include <sys/queue.h> 33 34typedef int64_t lba_t; --- 20 unchanged lines hidden (view full) --- 55extern u_int verbose; 56 57extern u_int ncyls; 58extern u_int nheads; 59extern u_int nsecs; 60extern u_int secsz; /* Logical block size. */ 61extern u_int blksz; /* Physical block size. */ 62 |
63static inline lba_t 64round_block(lba_t n) 65{ 66 lba_t b = blksz / secsz; 67 return ((n + b - 1) & ~(b - 1)); 68} 69 |
|
63int mkimg_seek(int fd, lba_t blk); 64 65#endif /* _MKIMG_MKIMG_H_ */ | 70int mkimg_seek(int fd, lba_t blk); 71 72#endif /* _MKIMG_MKIMG_H_ */ |