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 CINDIR 128 /* number of indirect zno's read at a time */
#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 CINDIR 128 /* number of indirect zno's read at a time */
typedef u32_t block_t; /* block number */
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 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
* sizeof(short) == sizeof(int), there is no promotion, so the type stays
#if PRIV_DEBUG
printf("do_privctl: Setting ipc target mask for %d:");
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");
#endif
#if PRIV_DEBUG
printf("do_privctl: Set ipc target mask for %d:");
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");
#endif
{INIT_PROC_NR, BVM_F, 0, "init" },
};
-/* Verify the size of the system image table at compile time. Also verify that
- * the first chunk of the ipc mask has enough bits to accommodate the processes
- * in the image.
+/* Verify the size of the system image table at compile time.
* 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
* because 'dummy' is declared extern.
*/
extern int dummy[(NR_BOOT_PROCS==sizeof(image)/
sizeof(struct boot_image))?1:-1];
-extern int dummy[(BITCHUNK_BITS > NR_BOOT_PROCS - 1) ? 1 : -1];
}
printf("-nr- -id- -name-- -flags- traps grants -ipc_to--"
- " -kernel calls-\n");
+ " -kernel calls-\n");
PROCLOOP(rp, oldrp)
r = -1;
s_flags_str(sp->s_flags), s_traps_str(sp->s_trap_mask),
sp->s_grant_entries);
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(" ");
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");
/* Iterate over the words in block. */
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;
- /* 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; i < 8*sizeof(k); ++i) {
/* Bit number from the start of the bit map. */
if (*wptr == (bitchunk_t) ~0) continue;
/* 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) {}
/* Bit number from the start of the bit map. */
/* Allocate and return bit number. */
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;
put_block(bp, MAP_BLOCK);
return(b);
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 (map == IMAP) panic("tried to free unused inode");
else panic("tried to free unused block: %u", bit_returned);
}
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;
put_block(bp, MAP_BLOCK);