X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=bfin-5761%2Fsuper.i.1;fp=bfin-5761%2Fsuper.i.1;h=3c87c9528ced17f7c95a8b689798be079adeca0e;hp=0000000000000000000000000000000000000000;hb=0e45bb161e4c1a7d89732e3b1e928f16ae16ef55;hpb=81f80d8c1c9898ae1c26534a3287a47220390f5c diff --git a/bfin-5761/super.i.1 b/bfin-5761/super.i.1 new file mode 100644 index 0000000..3c87c95 --- /dev/null +++ b/bfin-5761/super.i.1 @@ -0,0 +1,67 @@ +typedef unsigned long long u64; +typedef u64 sector_t; +extern struct module __this_module; +struct super_block { + unsigned long s_blocksize; + struct block_device *s_bdev; +}; +struct file_system_type { + const char *name; + int fs_flags; + int (*get_sb) (struct file_system_type *, int, const char *, void *, + struct vfsmount *); + void (*kill_sb) (struct super_block *); + struct module *owner; +}; +void kill_block_super(struct super_block *sb); +struct buffer_head { + sector_t b_blocknr; +}; +static inline __attribute__ ((always_inline)) +struct buffer_head *sb_bread(struct super_block *sb, sector_t block) +{ + return __bread(sb->s_bdev, block, sb->s_blocksize); +} +static int detect_sysv(struct sysv_sb_info *sbi, struct buffer_head *bh) +{ +} +static struct { + int (*test) (struct sysv_sb_info *, struct buffer_head *); +} flavours[] = { + { + 0, detect_sysv} +,}; +static int sysv_fill_super(struct super_block *sb, void *data, int silent) +{ + struct buffer_head *bh1, *bh = ((void *)0); + unsigned long blocknr; + int size = 0, i; + for (i = 0; i < (sizeof(flavours) / sizeof((flavours)[0]) + (sizeof(struct { + } + ))) + && !size; i++) { + size = flavours[i].test(SYSV_SB(sb), bh); + } + switch (size) { + case 3: + blocknr = bh->b_blocknr >> 1; + bh1 = bh = sb_bread(sb, blocknr); + } +} +static int sysv_get_sb(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, struct vfsmount *mnt) +{ + return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super, + mnt); +} +static struct file_system_type sysv_fs_type = { + .owner = (&__this_module),.name = "sysv",.get_sb = + sysv_get_sb,.kill_sb = kill_block_super,.fs_flags = 1, +}; +static int __attribute__ ((__section__(".init.text"))) + __attribute__ ((__cold__)) + __attribute__ ((no_instrument_function)) init_sysv_fs(void) +{ + unregister:unregister_filesystem(&sysv_fs_type); +} +int init_module(void) __attribute__ ((alias("init_sysv_fs")));