hw_watchpoint_aarch32.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. #include <linux/spinlock.h>
  2. #include <linux/errno.h>
  3. #include <linux/module.h>
  4. #include <asm/signal.h>
  5. #include <asm/ptrace.h>
  6. #include "hw_watchpoint_aarch32.h"
  7. #include "mt_dbg_aarch32.h"
  8. #include <linux/of.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/slab.h>
  11. #include <linux/of_address.h>
  12. #include <linux/cpu.h>
  13. #include <linux/delay.h>
  14. #include <mt-plat/sync_write.h>
  15. struct wp_trace_context_t wp_tracer;
  16. #ifdef WATCHPOINT_TEST_SUIT
  17. struct wp_event wp_event;
  18. int err;
  19. volatile int my_watch_data2;
  20. int wp_flag;
  21. int my_wp_handler1(phys_addr_t addr)
  22. {
  23. wp_flag++;
  24. pr_debug("[MTK WP] Access my data from an instruction at %p\n", &addr);
  25. return 0;
  26. }
  27. int my_wp_handler2(phys_addr_t addr)
  28. {
  29. pr_debug("[MTK WP] In my_wp_handler2 Access my data from an instruction at %p\n", &addr);
  30. /* trigger exception */
  31. return 0;
  32. }
  33. void wp_test1(void)
  34. {
  35. init_wp_event(&wp_event, (unsigned int)&my_watch_data2, (unsigned int)&my_watch_data2,
  36. WP_EVENT_TYPE_ALL, my_wp_handler1);
  37. err = add_hw_watchpoint(&wp_event);
  38. if (err) {
  39. pr_debug("[MTK WP] add hw watch point failed...\n");
  40. /* fail to add watchpoing */
  41. } else {
  42. /* the memory address is under watching */
  43. pr_debug("[MTK WP] add hw watch point success...\n");
  44. /* test del
  45. del_hw_watchpoint(&wp_event);
  46. */
  47. }
  48. /* test watchpoint */
  49. my_watch_data2 = 1;
  50. }
  51. void smp_specific_write(int *p)
  52. {
  53. *p = 1;
  54. pr_debug("[MTK WP] wite data in specific address ok,addr=0x%p\n", p);
  55. }
  56. void wp_test2(void)
  57. {
  58. int i;
  59. int ret;
  60. wp_flag = 0;
  61. pr_debug("[MTK WP] Init wp.. ");
  62. init_wp_event(&wp_event, (unsigned int)&my_watch_data2, (unsigned int)&my_watch_data2,
  63. WP_EVENT_TYPE_ALL, my_wp_handler1);
  64. err = add_hw_watchpoint(&wp_event);
  65. if (err) {
  66. pr_debug("[MTK WP] add hw watch point failed...\n");
  67. /* fail to add watchpoing */
  68. } else {
  69. /* the memory address is under watching */
  70. pr_debug("[MTK WP] add hw watch point success...\n");
  71. /* test del
  72. del_hw_watchpoint(&wp_event);
  73. */
  74. }
  75. pr_debug("[MTK WP] dump standard dbgsys setting\n");
  76. for (i = 1; i < num_possible_cpus(); i++) {
  77. ret = cpu_down(i);
  78. if (ret != 0)
  79. pr_debug("[MTK WP] cpu %d power down failed\n", i);
  80. if (!cpu_online(i))
  81. pr_debug("[MTK WP] cpu %d already power down\n", i);
  82. }
  83. for (i = 0; i < num_possible_cpus(); i++) {
  84. ret = cpu_up(i);
  85. if (ret != 0)
  86. pr_debug("[MTK WP] cpu %d power up failed\n", i);
  87. if (cpu_online(i))
  88. pr_debug("[MTK WP] cpu %d already power up\n", i);
  89. pr_debug("[MTK WP] dump dbgsys setting restored\n");
  90. #ifdef DBG_REG_DUMP
  91. dump_dbgregs(i);
  92. print_dbgregs(i);
  93. #endif
  94. ret =
  95. smp_call_function_single(i, (smp_call_func_t) smp_specific_write,
  96. (void *)&my_watch_data2, 1);
  97. if (ret == 0)
  98. pr_debug("[MTK WP] cpu %d, wite data in specific address ok\n", i);
  99. else
  100. pr_debug("[MTK WP] cpu %d, wite data in specific address failed\n", i);
  101. }
  102. if (wp_flag == num_possible_cpus())
  103. pr_debug("[MTK WP] Watchpoint item2 verfication pass 0x%x\n", wp_flag);
  104. else
  105. pr_debug("[MTK WP] Watchpoint item2 verfication failed 0x%x\n", wp_flag);
  106. }
  107. void wp_test3(void)
  108. {
  109. int i;
  110. int ret;
  111. wp_flag = 0;
  112. for (i = 0; i < num_possible_cpus(); i++) {
  113. ret = cpu_up(i);
  114. if (ret != 0)
  115. pr_debug("[MTK WP] cpu %d power up failed\n", i);
  116. if (cpu_online(i))
  117. pr_debug("[MTK WP] cpu %d already power up\n", i);
  118. pr_debug("[MTK WP] dump dbgsys setting restored\n");
  119. #ifdef DBG_REG_DUMP
  120. dump_dbgregs(i);
  121. print_dbgregs(i);
  122. #endif
  123. ret =
  124. smp_call_function_single(i, (smp_call_func_t) smp_specific_write,
  125. (void *)&my_watch_data2, 1);
  126. if (ret == 0)
  127. pr_debug("[MTK WP] cpu %d, wite data in specific address ok\n", i);
  128. else
  129. pr_debug("[MTK WP] cpu %d, wite data in specific address failed\n", i);
  130. }
  131. if (wp_flag == num_possible_cpus())
  132. pr_debug("[MTK WP] Watchpoint item3 verfication pass 0x%x\n", wp_flag);
  133. else
  134. pr_debug("[MTK WP] Watchpoint item3 verfication failed 0x%x\n", wp_flag);
  135. }
  136. #endif
  137. void smp_read_dbgdscr_callback(void *info)
  138. {
  139. unsigned long tmp;
  140. unsigned long *val = info;
  141. ARM_DBG_READ(c0, c2, 2, tmp);
  142. *val = tmp;
  143. }
  144. void smp_write_dbgdscr_callback(void *info)
  145. {
  146. unsigned long *val = info;
  147. unsigned long tmp = *val;
  148. ARM_DBG_WRITE(c0, c2, 2, tmp);
  149. saved_dbgdscr = tmp;
  150. }
  151. void smp_read_dbgoslsr_callback(void *info)
  152. {
  153. unsigned long tmp;
  154. unsigned long *val = info;
  155. ARM_DBG_READ(c1, c1, 4, tmp);
  156. *val = tmp;
  157. }
  158. void smp_write_dbgoslsr_callback(void *info)
  159. {
  160. unsigned long *val = info;
  161. unsigned long tmp = *val;
  162. ARM_DBG_WRITE(c1, c1, 4, tmp);
  163. }
  164. void smp_read_dbgvcr_callback(void *info)
  165. {
  166. unsigned long tmp;
  167. unsigned long *val = info;
  168. ARM_DBG_READ(c0, c7, 0, tmp);
  169. *val = tmp;
  170. }
  171. void smp_write_dbgvcr_callback(void *info)
  172. {
  173. unsigned long *val = info;
  174. unsigned long tmp = *val;
  175. ARM_DBG_WRITE(c0, c7, 0, tmp);
  176. saved_dbgvcr = tmp;
  177. }
  178. void smp_read_dbgsdsr_callback(void *info)
  179. {
  180. unsigned long tmp;
  181. unsigned long *val = info;
  182. __asm__ __volatile__("mrc p15, 0, %0, c1, c3, 1 @SDSR\n\t":"=r"(tmp));
  183. *val = tmp;
  184. }
  185. void smp_write_dbgsdsr_callback(void *info)
  186. {
  187. unsigned long *val = info;
  188. unsigned long tmp = *val;
  189. __asm__ __volatile("mcr p15, 0, %0, c1, c3, 1\n\t" : : "r"(tmp));
  190. }
  191. static spinlock_t wp_lock;
  192. int register_wp_context(struct wp_trace_context_t **wp_tracer_context)
  193. {
  194. *wp_tracer_context = &wp_tracer;
  195. return 0;
  196. }
  197. /*
  198. * enable_hw_watchpoint: Enable the H/W watchpoint.
  199. * Return error code.
  200. */
  201. int enable_hw_watchpoint(void)
  202. {
  203. int i;
  204. unsigned int args;
  205. int oslsr;
  206. int dbglsr;
  207. pr_debug("[MTK WP] Hotplug disable\n");
  208. cpu_hotplug_disable();
  209. for (i = 0; i < num_possible_cpus(); i++) {
  210. if (cpu_online(i)) {
  211. smp_call_function_single(i, smp_read_dbgdscr_callback, &args, 1);
  212. pr_debug("[MTK WP] cpu %d, DBGDSCR 0x%x\n", i, args);
  213. if (args & HDBGEN) {
  214. pr_debug
  215. ("[MTK WP] halting debug mode enabled. Unable to access hardware resources.\n");
  216. return -EPERM;
  217. }
  218. if (args & MDBGEN) {
  219. /* already enabled */
  220. pr_debug("[MTK WP] already enabled, DBGDSCR = 0x%x\n", args);
  221. }
  222. cs_cpu_write(wp_tracer.debug_regs[i], DBGLAR, UNLOCK_KEY);
  223. cs_cpu_write(wp_tracer.debug_regs[i], DBGOSLAR, ~UNLOCK_KEY);
  224. args = args | MDBGEN;
  225. smp_call_function_single(i, smp_write_dbgdscr_callback, &args, 1);
  226. smp_call_function_single(i, smp_read_dbgdscr_callback, &args, 1);
  227. smp_call_function_single(i, smp_read_dbgoslsr_callback, &oslsr, 1);
  228. dbglsr = cs_cpu_read(wp_tracer.debug_regs[i], DBGLSR);
  229. pr_debug("[MTK WP] cpu %d, DBGLSR 0x%x, DBGOSLSR 0x%x\n", i, dbglsr,
  230. oslsr);
  231. pr_debug("[MTK WP] cpu %d, DBGDSCR 0x%x. (after set dbgdscr)\n", i, args);
  232. } else {
  233. pr_debug("[MTK WP] cpu %d, power down(%d) so skip enable_hw_watchpoint\n",
  234. i, cpu_online(i));
  235. }
  236. }
  237. pr_debug("[MTK WP] Hotplug enable\n");
  238. cpu_hotplug_enable();
  239. return 0;
  240. }
  241. /*
  242. * add_hw_watchpoint: add a watch point.
  243. * @wp_event: pointer to the struct wp_event.
  244. * Return error code.
  245. */
  246. int add_hw_watchpoint(struct wp_event *wp_event)
  247. {
  248. int ret, i, j;
  249. unsigned long flags;
  250. unsigned int ctl;
  251. if (!wp_event)
  252. return -EINVAL;
  253. if (!(wp_event->handler))
  254. return -EINVAL;
  255. ret = enable_hw_watchpoint();
  256. if (ret)
  257. return ret;
  258. ctl = DBGWCR_VAL;
  259. if (wp_event->type == WP_EVENT_TYPE_READ)
  260. ctl |= LSC_LDR;
  261. else if (wp_event->type == WP_EVENT_TYPE_WRITE)
  262. ctl |= LSC_STR;
  263. else if (wp_event->type == WP_EVENT_TYPE_ALL)
  264. ctl |= LSC_ALL;
  265. else
  266. return -EINVAL;
  267. spin_lock_irqsave(&wp_lock, flags);
  268. for (i = 0; i < MAX_NR_WATCH_POINT; i++) {
  269. if (!wp_tracer.wp_events[i].in_use) {
  270. wp_tracer.wp_events[i].in_use = 1;
  271. break;
  272. }
  273. }
  274. spin_unlock_irqrestore(&wp_lock, flags);
  275. if (i == MAX_NR_WATCH_POINT)
  276. return -EAGAIN;
  277. wp_tracer.wp_events[i].virt = wp_event->virt & ~3; /* enforce word-aligned */
  278. wp_tracer.wp_events[i].phys = wp_event->phys; /* no use currently */
  279. wp_tracer.wp_events[i].type = wp_event->type;
  280. wp_tracer.wp_events[i].handler = wp_event->handler;
  281. wp_tracer.wp_events[i].auto_disable = wp_event->auto_disable;
  282. pr_debug("[MTK WP] Hotplug disable\n");
  283. cpu_hotplug_disable();
  284. pr_debug("[MTK WP] Add watchpoint %d at address %p\n", i, &(wp_tracer.wp_events[i].virt));
  285. for (j = 0; j < num_possible_cpus(); j++) {
  286. if (cpu_online(j)) {
  287. cs_cpu_write(wp_tracer.debug_regs[j], DBGWVR + (i << 4),
  288. wp_tracer.wp_events[i].virt);
  289. cs_cpu_write(wp_tracer.debug_regs[j], DBGWCR + (i << 4), ctl);
  290. pr_debug("[MTK WP] cpu %d, DBGWVR%d, &0x%p=0x%x\n", j, i,
  291. wp_tracer.debug_regs[j] + DBGWVR + (i << 4),
  292. cs_cpu_read(wp_tracer.debug_regs[j], DBGWVR + (i << 4)));
  293. pr_debug("[MTK WP] cpu %d, DBGWCR%d, &0x%p=0x%x\n", j, i,
  294. wp_tracer.debug_regs[j] + DBGWCR + (i << 4),
  295. cs_cpu_read(wp_tracer.debug_regs[j], DBGWCR + (i << 4)));
  296. } else {
  297. pr_debug("[MTK WP] cpu %d, power down(%d) so skip adding watchpoint\n", j,
  298. cpu_online(j));
  299. }
  300. }
  301. pr_debug("[MTK WP] Hotplug enable\n");
  302. cpu_hotplug_enable();
  303. return 0;
  304. }
  305. /*
  306. * del_hw_watchpoint: delete a watch point.
  307. * @wp_event: pointer to the struct wp_event.
  308. * Return error code.
  309. */
  310. int del_hw_watchpoint(struct wp_event *wp_event)
  311. {
  312. unsigned long flags;
  313. int i, j;
  314. if (!wp_event)
  315. return -EINVAL;
  316. pr_debug("[MTK WP] Hotplug disable\n");
  317. cpu_hotplug_disable();
  318. spin_lock_irqsave(&wp_lock, flags);
  319. for (i = 0; i < MAX_NR_WATCH_POINT; i++) {
  320. if (wp_tracer.wp_events[i].in_use
  321. && (wp_tracer.wp_events[i].virt == wp_event->virt)) {
  322. wp_tracer.wp_events[i].virt = 0;
  323. wp_tracer.wp_events[i].phys = 0;
  324. wp_tracer.wp_events[i].type = 0;
  325. wp_tracer.wp_events[i].handler = NULL;
  326. wp_tracer.wp_events[i].in_use = 0;
  327. for (j = 0; j < num_possible_cpus(); j++) {
  328. if (cpu_online(j)) {
  329. cs_cpu_write(wp_tracer.debug_regs[j], DBGWCR + (i << 4),
  330. cs_cpu_read(wp_tracer.debug_regs[j],
  331. DBGWCR + (i << 4)) & (~WP_EN));
  332. }
  333. }
  334. break;
  335. }
  336. }
  337. spin_unlock_irqrestore(&wp_lock, flags);
  338. pr_debug("[MTK WP] Hotplug enable\n");
  339. cpu_hotplug_enable();
  340. if (i == MAX_NR_WATCH_POINT)
  341. return -EINVAL;
  342. else
  343. return 0;
  344. }
  345. int watchpoint_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
  346. {
  347. unsigned long wfar, daddr, iaddr;
  348. int i, ret, j;
  349. #if defined(CONFIG_ARCH_MT6595) || defined(CONFIG_ARCH_MT6752)\
  350. || defined(CONFIG_ARCH_MT6735) || defined(CONFIG_ARCH_MT6735M) || defined(CONFIG_ARCH_MT6753)
  351. /* Notes
  352. *v7 Debug the address of instruction that triggered the watchpoint is in DBGWFAR
  353. *v7.1 Debug the address is in DFAR
  354. */
  355. asm volatile ("MRC p15, 0, %0, c6, c0, 0\n":"=r" (wfar) : : "cc");
  356. #else
  357. unsigned cluster_id = raw_smp_processor_id() / get_cluster_core_count();
  358. if (cluster_id == 0)
  359. ARM_DBG_READ(c0, c6, 0, wfar);
  360. else if (cluster_id == 1)
  361. ARM_DBG_READ(c0, c6, 0, wfar);
  362. #endif
  363. daddr = addr & ~3;
  364. iaddr = regs->ARM_pc;
  365. pr_debug("[MTK WP] addr = 0x%lx, DBGWFAR/DFAR = 0x%lx\n", (unsigned long)addr, wfar);
  366. pr_debug("[MTK WP] daddr = 0x%lx, iaddr = 0x%lx\n", daddr, iaddr);
  367. /* update PC to avoid re-execution of the instruction under watching */
  368. regs->ARM_pc += thumb_mode(regs) ? 2 : 4;
  369. for (i = 0; i < MAX_NR_WATCH_POINT; i++) {
  370. if (wp_tracer.wp_events[i].in_use && wp_tracer.wp_events[i].virt == (daddr)) {
  371. pr_debug("[MTK WP] Watchpoint %d triggers.\n", i);
  372. if (!(wp_tracer.wp_events[i].handler)) {
  373. pr_debug("[MTK WP] No watchpoint handler. Ignore.\n");
  374. return 0;
  375. }
  376. if (wp_tracer.wp_events[i].auto_disable) {
  377. for (j = 0; j < num_possible_cpus(); j++) {
  378. if (cpu_online(j)) {
  379. cs_cpu_write(wp_tracer.debug_regs[j],
  380. DBGWCR + (i << 4),
  381. cs_cpu_read(wp_tracer.debug_regs[j],
  382. DBGWCR +
  383. (i << 4)) & (~WP_EN));
  384. } else {
  385. pr_debug("[MTK WP] cpu %d, power down(%d) so skip adding watchpoint auto-disable\n",
  386. j, cpu_online(j));
  387. }
  388. }
  389. }
  390. ret = wp_tracer.wp_events[i].handler(iaddr);
  391. if (wp_tracer.wp_events[i].auto_disable) {
  392. for (j = 0; j < num_possible_cpus(); j++) {
  393. if (cpu_online(j)) {
  394. cs_cpu_write(wp_tracer.debug_regs[j],
  395. DBGWCR + (i << 4),
  396. cs_cpu_read(wp_tracer.debug_regs[j],
  397. DBGWCR +
  398. (i << 4)) | WP_EN);
  399. } else {
  400. pr_debug("[MTK WP] cpu %d, power down(%d) so skip watchpoint auto-disable\n",
  401. j, cpu_online(j));
  402. }
  403. }
  404. }
  405. return ret;
  406. }
  407. }
  408. return 0;
  409. }
  410. int wp_probe(struct platform_device *pdev)
  411. {
  412. int ret = 0;
  413. int i;
  414. pr_debug("[MTK WP] watchpoint_probe\n");
  415. of_property_read_u32(pdev->dev.of_node, "num", &wp_tracer.nr_dbg);
  416. pr_debug("[MTK WP] get %d debug interface\n", wp_tracer.nr_dbg);
  417. wp_tracer.debug_regs =
  418. kmalloc(sizeof(void *) * (unsigned long)wp_tracer.nr_dbg, GFP_KERNEL);
  419. if (!wp_tracer.debug_regs) {
  420. pr_err("[MTK WP] Failed to allocate watchpoint register array\n");
  421. ret = -ENOMEM;
  422. goto out;
  423. }
  424. for (i = 0; i < wp_tracer.nr_dbg; i++) {
  425. wp_tracer.debug_regs[i] = of_iomap(pdev->dev.of_node, i);
  426. if (wp_tracer.debug_regs[i] == NULL) {
  427. pr_debug("[MTK WP] debug_interface %d devicetree mapping failed\n", i);
  428. } else {
  429. pr_debug("[MTK WP] debug_interface %d @ vm:0x%p pm:0x%x\n", i,
  430. wp_tracer.debug_regs[i],
  431. IO_VIRT_TO_PHYS((unsigned int)wp_tracer.debug_regs[i]));
  432. }
  433. }
  434. ARM_DBG_READ(c0, c0, 0, wp_tracer.dbgdidr);
  435. wp_tracer.wp_nr = ((wp_tracer.dbgdidr & (0xf << 28)) >> 28);
  436. wp_tracer.bp_nr = ((wp_tracer.dbgdidr & (0xf << 24)) >> 24);
  437. out:
  438. return ret;
  439. }
  440. static const struct of_device_id dbg_of_ids[] = {
  441. {.compatible = "mediatek,mt6735-dbg_debug",},
  442. {}
  443. };
  444. static struct platform_driver wp_driver = {
  445. .probe = wp_probe,
  446. .driver = {
  447. .name = "wp",
  448. .bus = &platform_bus_type,
  449. .owner = THIS_MODULE,
  450. .of_match_table = dbg_of_ids,
  451. },
  452. };
  453. #ifdef WATCHPOINT_TEST_SUIT
  454. static ssize_t wp_test_suit_show(struct device_driver *driver, char *buf)
  455. {
  456. return snprintf(buf, PAGE_SIZE, "==Watchpoint test==\n"
  457. "1. test watchpoints in online cpu\n"
  458. "2. verified all cpu's watchpoint after hotplug\n"
  459. "3. verified all cpu's watchpoing after suspend/resume. Not:you have to run test item 1 or 2 to init watchpoint first\n");
  460. }
  461. static ssize_t wp_test_suit_store(struct device_driver *driver, const char *buf, size_t count)
  462. {
  463. char *p = (char *)buf;
  464. unsigned long int num;
  465. ssize_t ret;
  466. ret = kstrtoul(p, 10, &num);
  467. if (ret == 0) {
  468. switch (num) {
  469. /* Test watchpoint Function */
  470. case 1:
  471. wp_test1();
  472. break;
  473. case 2:
  474. wp_test2();
  475. break;
  476. case 3:
  477. wp_test3();
  478. default:
  479. break;
  480. }
  481. }
  482. return count;
  483. }
  484. DRIVER_ATTR(wp_test_suit, 0664, wp_test_suit_show, wp_test_suit_store);
  485. #endif
  486. static int __init hw_watchpoint_init(void)
  487. {
  488. int err;
  489. #ifdef WATCHPOINT_TEST_SUIT
  490. int ret;
  491. #endif
  492. spin_lock_init(&wp_lock);
  493. err = platform_driver_register(&wp_driver);
  494. if (err) {
  495. pr_err("[MTK WP] watchpoint registration failed\n");
  496. return err;
  497. }
  498. #ifdef WATCHPOINT_TEST_SUIT
  499. ret = driver_create_file(&wp_driver.driver, &driver_attr_wp_test_suit);
  500. if (ret)
  501. pr_err("[MTK WP] Fail to create systracker_drv sysfs files");
  502. #endif
  503. #ifdef CONFIG_ARM_LPAE
  504. hook_fault_code(0x22, watchpoint_handler, SIGTRAP, 0, "watchpoint debug exception");
  505. #else
  506. hook_fault_code(0x02, watchpoint_handler, SIGTRAP, 0, "watchpoint debug exception");
  507. #endif
  508. pr_debug("[MTK WP] watchpoint handler init.\n");
  509. return 0;
  510. }
  511. /* not export currently
  512. EXPORT_SYMBOL(add_hw_watchpoint);
  513. */
  514. arch_initcall(hw_watchpoint_init);