change bitchunk_t from 16-bit to 32-bit
This commit is contained in:
parent
d23c3d110e
commit
5d8d5e0c3a
@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
unsigned int fs_version = 2, block_size = 0;
|
unsigned int fs_version = 2, block_size = 0;
|
||||||
|
|
||||||
#define BITSHIFT 4 /* = log2(#bits(int)) */
|
#define BITSHIFT 5 /* = log2(#bits(int)) */
|
||||||
|
|
||||||
#define MAXPRINT 80 /* max. number of error lines in chkmap */
|
#define MAXPRINT 80 /* max. number of error lines in chkmap */
|
||||||
#define CINDIR 128 /* number of indirect zno's read at a time */
|
#define CINDIR 128 /* number of indirect zno's read at a time */
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#define BLOCK_SIZE _STATIC_BLOCK_SIZE
|
#define BLOCK_SIZE _STATIC_BLOCK_SIZE
|
||||||
|
|
||||||
#define BITSHIFT 4 /* = log2(#bits(int)) */
|
#define BITSHIFT 5 /* = log2(#bits(int)) */
|
||||||
|
|
||||||
#define MAXPRINT 8 /* max. number of error lines in chkmap */
|
#define MAXPRINT 8 /* max. number of error lines in chkmap */
|
||||||
#define CINDIR 128 /* number of indirect zno's read at a time */
|
#define CINDIR 128 /* number of indirect zno's read at a time */
|
||||||
|
@ -44,7 +44,7 @@ typedef u32_t zone_t; /* zone number */
|
|||||||
typedef u32_t block_t; /* block number */
|
typedef u32_t block_t; /* block number */
|
||||||
typedef u32_t bit_t; /* bit number in a bit map */
|
typedef u32_t bit_t; /* bit number in a bit map */
|
||||||
typedef u16_t zone1_t; /* zone number for V1 file systems */
|
typedef u16_t zone1_t; /* zone number for V1 file systems */
|
||||||
typedef u16_t bitchunk_t; /* collection of bits in a bitmap */
|
typedef u32_t bitchunk_t; /* collection of bits in a bitmap */
|
||||||
|
|
||||||
/* ANSI C makes writing down the promotion of unsigned types very messy. When
|
/* ANSI C makes writing down the promotion of unsigned types very messy. When
|
||||||
* sizeof(short) == sizeof(int), there is no promotion, so the type stays
|
* sizeof(short) == sizeof(int), there is no promotion, so the type stays
|
||||||
|
@ -363,7 +363,7 @@ PRIVATE int update_priv(struct proc *rp, struct priv *priv)
|
|||||||
#if PRIV_DEBUG
|
#if PRIV_DEBUG
|
||||||
printf("do_privctl: Setting ipc target mask for %d:");
|
printf("do_privctl: Setting ipc target mask for %d:");
|
||||||
for (i=0; i < NR_SYS_PROCS; i += BITCHUNK_BITS) {
|
for (i=0; i < NR_SYS_PROCS; i += BITCHUNK_BITS) {
|
||||||
printf(" %04x", get_sys_bits(priv->s_ipc_to, i));
|
printf(" %08x", get_sys_bits(priv->s_ipc_to, i));
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
@ -373,7 +373,7 @@ PRIVATE int update_priv(struct proc *rp, struct priv *priv)
|
|||||||
#if PRIV_DEBUG
|
#if PRIV_DEBUG
|
||||||
printf("do_privctl: Set ipc target mask for %d:");
|
printf("do_privctl: Set ipc target mask for %d:");
|
||||||
for (i=0; i < NR_SYS_PROCS; i += BITCHUNK_BITS) {
|
for (i=0; i < NR_SYS_PROCS; i += BITCHUNK_BITS) {
|
||||||
printf(" %04x", get_sys_bits(priv(rp)->s_ipc_to, i));
|
printf(" %08x", get_sys_bits(priv(rp)->s_ipc_to, i));
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -90,13 +90,10 @@ PUBLIC struct boot_image image[] = {
|
|||||||
{INIT_PROC_NR, BVM_F, 0, "init" },
|
{INIT_PROC_NR, BVM_F, 0, "init" },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Verify the size of the system image table at compile time. Also verify that
|
/* Verify the size of the system image table at compile time.
|
||||||
* the first chunk of the ipc mask has enough bits to accommodate the processes
|
|
||||||
* in the image.
|
|
||||||
* If a problem is detected, the size of the 'dummy' array will be negative,
|
* If a problem is detected, the size of the 'dummy' array will be negative,
|
||||||
* causing a compile time error. Note that no space is actually allocated
|
* causing a compile time error. Note that no space is actually allocated
|
||||||
* because 'dummy' is declared extern.
|
* because 'dummy' is declared extern.
|
||||||
*/
|
*/
|
||||||
extern int dummy[(NR_BOOT_PROCS==sizeof(image)/
|
extern int dummy[(NR_BOOT_PROCS==sizeof(image)/
|
||||||
sizeof(struct boot_image))?1:-1];
|
sizeof(struct boot_image))?1:-1];
|
||||||
extern int dummy[(BITCHUNK_BITS > NR_BOOT_PROCS - 1) ? 1 : -1];
|
|
||||||
|
@ -327,7 +327,7 @@ PUBLIC void privileges_dmp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("-nr- -id- -name-- -flags- traps grants -ipc_to--"
|
printf("-nr- -id- -name-- -flags- traps grants -ipc_to--"
|
||||||
" -kernel calls-\n");
|
" -kernel calls-\n");
|
||||||
|
|
||||||
PROCLOOP(rp, oldrp)
|
PROCLOOP(rp, oldrp)
|
||||||
r = -1;
|
r = -1;
|
||||||
@ -341,12 +341,12 @@ PUBLIC void privileges_dmp()
|
|||||||
s_flags_str(sp->s_flags), s_traps_str(sp->s_trap_mask),
|
s_flags_str(sp->s_flags), s_traps_str(sp->s_trap_mask),
|
||||||
sp->s_grant_entries);
|
sp->s_grant_entries);
|
||||||
for (i=0; i < NR_SYS_PROCS; i += BITCHUNK_BITS) {
|
for (i=0; i < NR_SYS_PROCS; i += BITCHUNK_BITS) {
|
||||||
printf(" %04x", get_sys_bits(sp->s_ipc_to, i));
|
printf(" %08x", get_sys_bits(sp->s_ipc_to, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(" ");
|
printf(" ");
|
||||||
for (i=0; i < NR_SYS_CALLS; i += BITCHUNK_BITS) {
|
for (i=0; i < NR_SYS_CALLS; i += BITCHUNK_BITS) {
|
||||||
printf(" %04x", sp->s_k_call_mask[i/BITCHUNK_BITS]);
|
printf(" %08x", sp->s_k_call_mask[i/BITCHUNK_BITS]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
@ -57,11 +57,10 @@ int map; /* IMAP (inode map) or ZMAP (zone map) */
|
|||||||
/* Iterate over the words in block. */
|
/* Iterate over the words in block. */
|
||||||
for (wptr = &bp->b_bitmap[word]; wptr < wlim; wptr++) {
|
for (wptr = &bp->b_bitmap[word]; wptr < wlim; wptr++) {
|
||||||
|
|
||||||
/* Does this word contain a free bit? */
|
/* Does this word contain a free bit? */
|
||||||
if (*wptr == (bitchunk_t) ~0) continue;
|
if (*wptr == (bitchunk_t) ~0) continue;
|
||||||
|
|
||||||
/* Find and allocate the free bit. */
|
k = (bitchunk_t) conv4(sp->s_native, (int) *wptr);
|
||||||
k = (bitchunk_t) conv2(sp->s_native, (int) *wptr);
|
|
||||||
|
|
||||||
for (i = 0; i < 8*sizeof(k); ++i) {
|
for (i = 0; i < 8*sizeof(k); ++i) {
|
||||||
/* Bit number from the start of the bit map. */
|
/* Bit number from the start of the bit map. */
|
||||||
|
@ -73,7 +73,7 @@ bit_t origin; /* number of bit to start searching at */
|
|||||||
if (*wptr == (bitchunk_t) ~0) continue;
|
if (*wptr == (bitchunk_t) ~0) continue;
|
||||||
|
|
||||||
/* Find and allocate the free bit. */
|
/* Find and allocate the free bit. */
|
||||||
k = (bitchunk_t) conv2(sp->s_native, (int) *wptr);
|
k = (bitchunk_t) conv4(sp->s_native, (int) *wptr);
|
||||||
for (i = 0; (k & (1 << i)) != 0; ++i) {}
|
for (i = 0; (k & (1 << i)) != 0; ++i) {}
|
||||||
|
|
||||||
/* Bit number from the start of the bit map. */
|
/* Bit number from the start of the bit map. */
|
||||||
@ -86,7 +86,7 @@ bit_t origin; /* number of bit to start searching at */
|
|||||||
|
|
||||||
/* Allocate and return bit number. */
|
/* Allocate and return bit number. */
|
||||||
k |= 1 << i;
|
k |= 1 << i;
|
||||||
*wptr = (bitchunk_t) conv2(sp->s_native, (int) k);
|
*wptr = (bitchunk_t) conv4(sp->s_native, (int) k);
|
||||||
bp->b_dirt = DIRTY;
|
bp->b_dirt = DIRTY;
|
||||||
put_block(bp, MAP_BLOCK);
|
put_block(bp, MAP_BLOCK);
|
||||||
return(b);
|
return(b);
|
||||||
@ -131,14 +131,14 @@ bit_t bit_returned; /* number of bit to insert into the map */
|
|||||||
|
|
||||||
bp = get_block(sp->s_dev, start_block + block, NORMAL);
|
bp = get_block(sp->s_dev, start_block + block, NORMAL);
|
||||||
|
|
||||||
k = (bitchunk_t) conv2(sp->s_native, (int) bp->b_bitmap[word]);
|
k = (bitchunk_t) conv4(sp->s_native, (int) bp->b_bitmap[word]);
|
||||||
if (!(k & mask)) {
|
if (!(k & mask)) {
|
||||||
if (map == IMAP) panic("tried to free unused inode");
|
if (map == IMAP) panic("tried to free unused inode");
|
||||||
else panic("tried to free unused block: %u", bit_returned);
|
else panic("tried to free unused block: %u", bit_returned);
|
||||||
}
|
}
|
||||||
|
|
||||||
k &= ~mask;
|
k &= ~mask;
|
||||||
bp->b_bitmap[word] = (bitchunk_t) conv2(sp->s_native, (int) k);
|
bp->b_bitmap[word] = (bitchunk_t) conv4(sp->s_native, (int) k);
|
||||||
bp->b_dirt = DIRTY;
|
bp->b_dirt = DIRTY;
|
||||||
|
|
||||||
put_block(bp, MAP_BLOCK);
|
put_block(bp, MAP_BLOCK);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user