免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: sisi8408
打印 上一主题 下一主题

Kernel Bug-Vulnerability-Comment library [复制链接]

论坛徽章:
0
131 [报告]
发表于 2008-09-06 23:03 |只看该作者

  1. static int packet_net_init(struct net *net)
  2. {
  3.         rwlock_init(&net->packet.sklist_lock);
  4.         INIT_HLIST_HEAD(&net->packet.sklist);
  5. /* .26 */
  6. #ifdef CONFIG_PROC_FS
  7.         if (!proc_net_fops_create(net, "packet", 0, &packet_seq_fops))
  8.                 return -ENOMEM;
  9. #endif
  10.         return 0;
  11. }

  12. static void packet_net_exit(struct net *net)
  13. {
  14. #ifdef CONFIG_PROC_FS
  15.         proc_net_remove(net, "packet");
  16. #endif
  17. }
复制代码

论坛徽章:
0
132 [报告]
发表于 2008-09-13 18:07 |只看该作者

  1. /*
  2. * Initialize the calling CPU's compare interrupt as clockevent device
  3. *
  4. * .24.4
  5. */
  6. //#ifdef CONFIG_CEVT_R4K
  7. #if defined(CONFIG_CEVT_R4K) || defined(CONFIG_CPU_XLR)
  8. extern int mips_clockevent_init(void);
  9. extern unsigned int __weak get_c0_compare_int(void);
  10. #else
  11. static inline int mips_clockevent_init(void)
  12. {
  13.         return -ENXIO;
  14. }
  15. #endif
  16. /*
  17. * Initialize the count register as a clocksource
  18. *
  19. * .24.4
  20. */
  21. //#ifdef CONFIG_CEVT_R4K
  22. #if defined(CONFIG_CEVT_R4K) || defined(CONFIG_CPU_XLR)
  23. extern void init_mips_clocksource(void);
  24. #else
  25. static inline void init_mips_clocksource(void) { }
  26. #endif

  27. /* all in one, [url]http://kerneltrap.org/mailarchive/linux-kernel/2007/10/9/333124[/url] */

复制代码

[ 本帖最后由 rtable 于 2008-9-15 11:54 编辑 ]

论坛徽章:
0
133 [报告]
发表于 2008-09-19 20:12 |只看该作者

  1. int allocate_irqno(void)
  2. {
  3.         int irq;

  4. again:
  5.         irq = find_first_zero_bit(irq_map, NR_IRQS);

  6.         if (irq >= NR_IRQS)
  7.                 return -ENOSPC;
  8.         //.26 arch/mips/kernel/irq.c
  9.         // why not with smp_mb__before_clear_bit();
  10.         if (test_and_set_bit(irq, irq_map))
  11.                 goto again;

  12.         return irq;
  13. }
复制代码

论坛徽章:
0
134 [报告]
发表于 2008-09-19 20:16 |只看该作者

  1. void ack_bad_irq(unsigned int irq)
  2. {
  3.         smtc_im_ack_irq(irq);
  4.         //.26 arch/mips/kernel/irq.c
  5.         //nicer?
  6.         printk(KERN_INFO "unexpected IRQ # %d\n", irq);
  7. }
复制代码

论坛徽章:
0
135 [报告]
发表于 2008-09-19 20:26 |只看该作者

  1. extern void breakpoint(void);
  2. extern void set_debug_traps(void);
  3. //.26 arch/mips/kernel/irq.c
  4. //nicer?
  5. static int kgdb_flag = 0;
复制代码

论坛徽章:
0
136 [报告]
发表于 2008-09-19 22:10 |只看该作者

  1.         for (i = 0; i < nipi; i++) {
  2.                 //.26 arch/mips/kernel/smtc.c
  3.                 //shit, smtc_ipi_enqueue
  4.                 smtc_ipi_nq(&freeIPIq, pipi);
  5.                 pipi++;
  6.         }
复制代码

论坛徽章:
0
137 [报告]
发表于 2008-09-19 22:37 |只看该作者

  1.         /* Set up a descriptor, to be delivered either promptly or queued */
  2.         //.26 arch/mips/kernel/smtc.c
  3.         //shit, smtc_ipi_dequeue
  4.         pipi = smtc_ipi_dq(&freeIPIq);
复制代码

论坛徽章:
0
138 [报告]
发表于 2008-09-19 23:09 |只看该作者

  1. static struct irqaction irq_ipi =
  2. {
  3.         .handler        = ipi_interrupt,
  4.         //.26 arch/mips/kernel/smtc.c
  5.         //why u have image?
  6.         .flags                = IRQF_DISABLED,
  7.         .name                = "SMTC_IPI",
  8.         .flags                = IRQF_PERCPU
  9. };
复制代码

论坛徽章:
0
139 [报告]
发表于 2008-09-20 16:17 |只看该作者

  1. static int apply_r_mips_pc16(struct module *me, uint32_t *location, Elf32_Addr v)
  2. {
  3.         int rel;

  4.         rel = (((unsigned int)v - (unsigned int)location));
  5.         rel >>= 2;        // because the offset is in _instructions_ not bytes.
  6.         rel -= 1;        // and one instruction less due to the branch delay slot.

  7.         if ( (rel > 32768) || (rel < -32768) ) {
  8.                 //.26 arch/mips/kernel/vpe.c
  9.                 printk(KERN_DEBUG "VPE loader: %s:"
  10.                         " relative address out of range 0x%x\n", __FUNCTION__, rel);
  11.                 return -ENOEXEC;
  12.         }

  13.         *location = (*location & 0xffff0000) | (rel & 0xffff);

  14.         return 0;
  15. }
复制代码

论坛徽章:
0
140 [报告]
发表于 2008-09-20 16:31 |只看该作者

  1.         dmt_flag = dmt();
  2.         vpeflags = dvpe();

  3.         if (!list_empty(&v->tc)) {
  4.                 t = list_entry(v->tc.next, struct tc, tc);
  5.                 if (t == NULL) { //and u??
  6.                         evpe(vpeflags);
  7.                         emt(dmt_flag);
  8.                         local_irq_restore(flags);

  9.                         printk(KERN_WARNING "VPE loader: TC %d is already in use.\n",
  10.                                t->index); //.26 what u mean?
  11.                         return -ENOEXEC;
  12.                 }
  13.         } else {
  14.                 evpe(vpeflags);
  15.                 emt(dmt_flag);
  16.                 local_irq_restore(flags);

  17.                 printk(KERN_WARNING
  18.                        "VPE loader: No TC's associated with VPE %d\n", v->minor);
  19.                 return -ENOEXEC;
  20.         }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP