return m;
}
-#ifndef makedev /* Missing in sys/types.h */
-#define minor(dev) (((dev) >> MINOR) & BYTE)
-#define major(dev) (((dev) >> MAJOR) & BYTE)
-#define makedev(major, minor) \
- ((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
-#endif
-
typedef enum parttype { DUNNO, SUBPART, PRIMARY, FLOPPY } parttype_t;
typedef struct device {
switch (ip->i_mode & I_TYPE) {
case I_CHAR_SPECIAL:
case I_BLOCK_SPECIAL:
- printf(" %2x,%2x ", (dev_t) ip->i_zone[0] >> MAJOR & 0xFF,
- (dev_t) ip->i_zone[0] >> MINOR & 0xFF);
+ printf(" %2x,%2x ", major(ip->i_zone[0]), minor(ip->i_zone[0]));
break;
default: printf("%7ld ", ip->i_size);
}
return m;
}
-#ifndef makedev /* Missing in sys/types.h */
-#define minor(dev) (((dev) >> MINOR) & BYTE)
-#define major(dev) (((dev) >> MAJOR) & BYTE)
-#define makedev(major, minor) \
- ((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
-#endif
-
typedef enum parttype { DUNNO, SUBPART, PRIMARY, FLOPPY } parttype_t;
typedef struct device {
exit(1);
}
-#ifndef makedev
-#define minor(dev) (((dev) >> MINOR) & BYTE)
-#define major(dev) (((dev) >> MAJOR) & BYTE)
-#define makedev(major, minor) \
- ((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
-#endif
-
int aflag; /* Add a new partition to the current table. */
int mflag; /* Minix rules, no need for alignment. */
int rflag; /* Report current partitions. */
exit(1);
}
-#ifndef makedev
-#define minor(dev) (((dev) >> MINOR) & BYTE)
-#define major(dev) (((dev) >> MAJOR) & BYTE)
-#define makedev(major, minor) \
- ((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
-#endif
-
#define MINOR_d0p0s0 128
void partsort(struct part_entry *pe)
print_usage(argv[ARG_NAME], "major already set");
exit(EINVAL);
}
- req_major = (stat_buf.st_rdev >> MAJOR) & BYTE;
+ req_major = major(stat_buf.st_rdev);
if(req_dev_style == STYLE_NDEV) {
req_dev_style = STYLE_DEV;
}
b = alloc_bit(sp, IMAP, sp->s_isearch);
if (b == NO_BIT) {
err_code = ENOSPC;
- major = (int) (sp->s_dev >> MAJOR) & BYTE;
- minor = (int) (sp->s_dev >> MINOR) & BYTE;
+ major = major(sp->s_dev);
+ minor = minor(sp->s_dev);
printf("Out of i-nodes on device %d/%d\n", major, minor);
return(NULL);
}
*/
typedef unsigned long Ino_t;
-
#endif /* __minix */
#include <machine/endian.h>
#define devmajor_t __devmajor_t
#define devminor_t __devminor_t
#define NODEVMAJOR (-1)
-/* Major, minor numbers, dev_t's. */
-#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
-#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
-#define minor(dev) ((devminor_t)(((dev) >> MINOR) & 0xff))
-#define major(dev) ((devmajor_t)(((dev) >> MAJOR) & 0xff))
-#define makedev(major, minor) \
- ((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
+/* LSC Our major / minor numbering scheme is not the exactly the same, to be updated? */
+#define major(x) ((devmajor_t)(((uint32_t)(x) & 0x0000ff00) >> 8))
+#define minor(x) ((devminor_t)( \
+ (((uint32_t)(x) & 0x000000ff) >> 0)))
+#define makedev(x,y) ((dev_t)((((x) << 8) & 0x0000ff00) | \
+ \
+ (((y) << 0) & 0x000000ff)))
#endif
#ifdef _BSD_CLOCK_T_