summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_disklabel.c17
-rw-r--r--sys/sys/disklabel.h16
-rw-r--r--sys/sys/diskmbr.h16
-rw-r--r--sys/sys/diskpc98.h16
4 files changed, 45 insertions, 20 deletions
diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c
index ed68f38..d7d5dce 100644
--- a/sys/kern/subr_disklabel.c
+++ b/sys/kern/subr_disklabel.c
@@ -324,23 +324,6 @@ done:
}
/*
- * Compute checksum for disk label.
- */
-u_int
-dkcksum(lp)
- register struct disklabel *lp;
-{
- register u_short *start, *end;
- register u_short sum = 0;
-
- start = (u_short *)lp;
- end = (u_short *)&lp->d_partitions[lp->d_npartitions];
- while (start < end)
- sum ^= *start++;
- return (sum);
-}
-
-/*
* Disk error is the preface to plaintive error messages
* about failing disk transfers. It prints messages of the form
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index c88f654..59fb31b 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -180,6 +180,21 @@ struct disklabel {
#define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+
+static __inline u_int16_t
+dkcksum(lp)
+ struct disklabel *lp;
+{
+ u_int16_t *start, *end;
+ u_int16_t sum = 0;
+
+ start = (u_int16_t *)lp;
+ end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions];
+ while (start < end)
+ sum ^= *start++;
+ return (sum);
+}
+
#else /* LOCORE */
/*
* offsets for asm boot files.
@@ -449,7 +464,6 @@ int bounds_check_with_label __P((struct bio *bp, struct disklabel *lp,
void diskerr __P((struct bio *bp, char *what, int pri, int blkdone,
struct disklabel *lp));
void disksort __P((struct buf *ap, struct buf *bp));
-u_int dkcksum __P((struct disklabel *lp));
char *readdisklabel __P((dev_t dev, struct disklabel *lp));
void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp));
int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp,
diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h
index c88f654..59fb31b 100644
--- a/sys/sys/diskmbr.h
+++ b/sys/sys/diskmbr.h
@@ -180,6 +180,21 @@ struct disklabel {
#define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+
+static __inline u_int16_t
+dkcksum(lp)
+ struct disklabel *lp;
+{
+ u_int16_t *start, *end;
+ u_int16_t sum = 0;
+
+ start = (u_int16_t *)lp;
+ end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions];
+ while (start < end)
+ sum ^= *start++;
+ return (sum);
+}
+
#else /* LOCORE */
/*
* offsets for asm boot files.
@@ -449,7 +464,6 @@ int bounds_check_with_label __P((struct bio *bp, struct disklabel *lp,
void diskerr __P((struct bio *bp, char *what, int pri, int blkdone,
struct disklabel *lp));
void disksort __P((struct buf *ap, struct buf *bp));
-u_int dkcksum __P((struct disklabel *lp));
char *readdisklabel __P((dev_t dev, struct disklabel *lp));
void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp));
int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp,
diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h
index c88f654..59fb31b 100644
--- a/sys/sys/diskpc98.h
+++ b/sys/sys/diskpc98.h
@@ -180,6 +180,21 @@ struct disklabel {
#define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+
+static __inline u_int16_t
+dkcksum(lp)
+ struct disklabel *lp;
+{
+ u_int16_t *start, *end;
+ u_int16_t sum = 0;
+
+ start = (u_int16_t *)lp;
+ end = (u_int16_t *)&lp->d_partitions[lp->d_npartitions];
+ while (start < end)
+ sum ^= *start++;
+ return (sum);
+}
+
#else /* LOCORE */
/*
* offsets for asm boot files.
@@ -449,7 +464,6 @@ int bounds_check_with_label __P((struct bio *bp, struct disklabel *lp,
void diskerr __P((struct bio *bp, char *what, int pri, int blkdone,
struct disklabel *lp));
void disksort __P((struct buf *ap, struct buf *bp));
-u_int dkcksum __P((struct disklabel *lp));
char *readdisklabel __P((dev_t dev, struct disklabel *lp));
void bioqdisksort __P((struct bio_queue_head *ap, struct bio *bp));
int setdisklabel __P((struct disklabel *olp, struct disklabel *nlp,
OpenPOWER on IntegriCloud