免费注册 查看新帖 |

Chinaunix

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

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

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

  1.         for (tc = tclimit; tc < hw_tcs; tc++) {
  2.                 /*
  3.                  * Must re-enable multithreading temporarily or in case we
  4.                  * reschedule send IPIs or similar we might hang.
  5.                  */
  6.                 clear_c0_mvpcontrol(MVPCONTROL_VPC);
  7.                
  8.                 evpe(vpflags);
  9.                 emt(mtflags);
  10.                 local_irq_restore(flags);
  11.                
  12.                 t = alloc_tc(tc);
  13.                 if (!t) {
  14.                         err = -ENOMEM;
  15.                         goto out;
  16.                 }

  17.                 local_irq_save(flags);
  18.                 mtflags = dmt();
  19.                 vpflags = dvpe();
  20.                
  21.                 set_c0_mvpcontrol(MVPCONTROL_VPC);

  22.                 /* VPE's */
  23.                 if (tc < hw_tcs) {
  24.                         settc(tc);

  25.                         if ((v = alloc_vpe(tc)) == NULL) {
  26.                                 printk(KERN_WARNING "VPE: unable to allocate VPE\n");
  27.                                 //
  28.                                 //why not account for vpelimit@@@@@
  29.                                 //
  30.                                 goto out_reenable;
  31.                         }

  32.                         v->ntcs = hw_tcs - tclimit;
  33. ...
  34. }
复制代码

论坛徽章:
0
142 [报告]
发表于 2008-09-21 09:36 |只看该作者

  1. void mips_reboot_setup(void)
  2. {
  3.         _machine_restart = mips_machine_restart;
  4.         _machine_halt = mips_machine_halt;

  5. #if defined(CONFIG_MIPS_ATLAS)
  6.         pm_power_off = atlas_machine_power_off;
  7. //#endif
  8. //.26 arch/mips/mips-boards/generic/reset.c
  9. #elif /*defined(CONFIG_MIPS_MALTA) ||*/ defined(CONFIG_MIPS_SEAD)
  10.         pm_power_off = mips_machine_halt;
  11. #endif
  12. }
复制代码

论坛徽章:
0
143 [报告]
发表于 2008-09-21 09:56 |只看该作者

  1. void __init prom_meminit(void)
  2. {
  3.         struct prom_pmemblock *p;

  4. #ifdef DEBUG
  5.         pr_debug("YAMON MEMORY DESCRIPTOR dump:\n");
  6.         p = prom_getmdesc();
  7.         while (p->size) {
  8.                 //.26 arch/mips/mips-boards/generic/memory.c
  9.                 int i = 0; //what do u mean?
  10.                 pr_debug("[%d,%p]: base<%08lx> size<%08lx> type<%s>\n",
  11.                          i, p, p->base, p->size, mtypes[p->type]);
  12.                 p++;
  13.                 i++;
  14.         }
  15. #endif
  16. ...
  17. }
复制代码

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

  1. static inline unsigned char str2hexnum(unsigned char c)
  2. {
  3.         if (c >= '0' && c <= '9')
  4.                 return c - '0';
  5.         if (c >= 'a' && c <= 'f')
  6.                 return c - 'a' + 10;
  7. +        //.26 arch/mips/mips-boards/generic/init.c
  8. +        if (c >= 'A' && c <= 'F')
  9. +                return c - 'A' + 10;
  10.         return 0; /* foo */
  11. }
复制代码

论坛徽章:
0
145 [报告]
发表于 2008-09-21 10:27 |只看该作者

  1. int amon_cpu_avail(int cpu)
  2. {
  3.         struct cpulaunch *launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH);

  4.         if (cpu < 0 || cpu >= NCPULAUNCH) {
  5.                 pr_debug("avail: cpu%d is out of range\n", cpu);
  6.                 return 0;
  7.         }

  8.         launch += cpu;
  9.         //.26 arch/mips/mips-boards/generic/amon.c
  10.         //why not LAUNCH_F_READY?
  11.         if (!(launch->flags & LAUNCH_FREADY)) {
  12.                 pr_debug("avail: cpu%d is not ready\n", cpu);
  13.                 return 0;
  14.         }
  15.         if (launch->flags & (LAUNCH_FGO | LAUNCH_FGONE)) {
  16.                 pr_debug("avail: too late.. cpu%d is already gone\n", cpu);
  17.                 return 0;
  18.         }

  19.         return 1;
  20. }
复制代码

论坛徽章:
0
146 [报告]
发表于 2008-10-02 15:55 |只看该作者

  1. /*
  2. * TLB/ASID Management information
  3. */

  4. #define MAX_SMTC_TLBS 2
  5. #define MAX_SMTC_ASIDS 256

  6. #if NR_CPUS <= 8
  7. typedef char asiduse;
  8. #elif NR_CPUS <= 16
  9. typedef short asiduse;
  10. #elif NR_CPUS <= 32
  11. typedef long asiduse;
  12. #elif NR_CPUS <= 64
  13. typedef long long asiduse;
  14. #else
  15. #error sorry too many cpus configed
  16. #endif
  17. //include/asm-mips/smtc.h
  18. //.26.5
  19. //for what?
  20. //#endif
复制代码

论坛徽章:
0
147 [报告]
发表于 2008-10-02 16:00 |只看该作者

  1. //arch/mips/kernel/8250-platform.c
  2. //.26.5
  3. //#define PORT(base, int)                                                \
  4. #define PORT(base, intr)                                                \
  5. {                                                                        \
  6.         .iobase                = base,                                                \
  7.         .irq                = intr,                                                \
  8.         .uartclk        = 1843200,                                        \
  9.         .iotype                = UPIO_PORT,                                        \
  10.         .flags                = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,                \
  11.         .regshift        = 0,                                                \
  12. }
复制代码

论坛徽章:
0
148 [报告]
发表于 2008-10-02 16:03 |只看该作者

  1. ...
  2. #ifdef CONFIG_MIPS_MT_SMTC

  3. #define CPUCTR_IMASKBIT (0x100 << cp0_compare_irq)

  4.         setup_irq_smtc(irq, &c0_compare_irqaction, CPUCTR_IMASKBIT);

  5. //arch/mips/kernel/cevt-r4k.c
  6. //mips_clockevent_init(void)
  7. //.26.5
  8. #undef CPUCTR_IMASKBIT
  9. #else
  10.         setup_irq(irq, &c0_compare_irqaction);
  11. #endif

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

论坛徽章:
0
149 [报告]
发表于 2010-06-23 19:46 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
150 [报告]
发表于 2010-06-30 21:11 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP