lkml.org 
[lkml]   [2002]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Subject[PATCH] linux-2.417 devfs 64bit portablility issue
    From
    Date
    Hi Richard, Hi List-Readers!

    In linux-2.4.17/fs/devfs/util.c, I found the following code:
    struct major_list
    {
    spinlock_t lock;
    __u32 bits[8];
    };

    /* Block majors already assigned:
    0-3, 7-9, 11-63, 65-99, 101-113, 120-127, 199, 201, 240-255
    Total free: 122
    */
    static struct major_list block_major_list =
    {SPIN_LOCK_UNLOCKED,
    {0xfffffb8f, /* Majors 0 to 31 */
    0xffffffff, /* Majors 32 to 63 */
    0xfffffffe, /* Majors 64 to 95 */
    0xff03ffef, /* Majors 96 to 127 */
    0x00000000, /* Majors 128 to 159 */
    0x00000000, /* Majors 160 to 191 */
    0x00000280, /* Majors 192 to 223 */
    0xffff0000} /* Majors 224 to 255 */
    };

    Afterwards, the block_major_list.bits is processed using
    find_first_zero_bit & set_bit out of asm/bitops.h.
    Since bitops are only defined for the datatype long, this does
    only work on 32-bit architectures (on 64 bit data gets
    incorrectly alligned -not on 8byte boundary & the ordering of
    the data is incorrect).
    I attached a patch that should fix it for all architectures.
    (See attached file: linux-2.4.17-devfs_fixup.diff)

    with kind regards
    Carsten Otte[unhandled content-type:application/octet-stream]
    \
     
     \ /
      Last update: 2005-03-22 13:24    [W:0.021 / U:1.448 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site