-/* geometry.h - Device and file geometry computation */
-/*
-Copyright 1992-1998 Werner Almesberger.
-Copyright 1999-2005 John Coffman.
-All rights reserved.
+/* geometry.h - Device and file geometry computation
+ *
+ * Copyright 1992-1998 Werner Almesberger
+ * Copyright 1999-2005 John Coffman
+ * Copyright 2009-2015 Joachim Wiedorn
+ * All rights reserved.
+ *
+ * Licensed under the terms contained in the file 'COPYING'
+ * in the source directory.
+ */
-Licensed under the terms contained in the file 'COPYING' in the
-source directory.
-
-*/
#ifndef GEOMETRY_H
#define GEOMETRY_H
unsigned char heads;
unsigned char sectors;
unsigned short cylinders;
- unsigned long start;
+ uint32_t start;
};
/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
#define MAJOR(dev) (unsigned int)((((dev_t)(dev) >> 8) & 0xfff) | ((unsigned int) ((dev_t)(dev) >> 32) & ~0xfff))
#define MINOR(dev) (unsigned int)(((dev_t)(dev) & 0xff) | ((unsigned int) ((dev_t)(dev) >> 12) & ~0xff))
#define MKDEV(major,minor) (((minor & 0xff) | ((major & 0xfff) << 8) \
- | (((unsigned long long int) (minor & ~0xff)) << 12) \
- | (((unsigned long long int) (major & ~0xfff)) << 32)))
+ | (((uint64_t) (minor & ~0xff)) << 12) \
+ | (((uint64_t) (major & ~0xfff)) << 32)))
#else
#include <sys/sysmacros.h>
#ifdef major
is retrieved and the other geometry information is undefined. */
-int geo_open(GEOMETRY *geo,char *name,int flags);
+int geo_open(GEOMETRY *geo,const char *name,int flags);
/* Opens the specified file or block device, obtains the necessary geometry
information and returns the file descriptor. If the name contains a BIOS
device specification (xxx:yyy), it is removed and stored in the geometry