1. /*********************************************************************************************
  2. * TI AM335x Linux MUX hacking
  3. * 声明:
  4. * 1. 本文主要是对TI的AM335x Linux驱动中的引脚复用配置代码进行跟踪;
  5. * 2. 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference Manual
  6. *
  7. * 2015-6-25 阵雨 深圳 南山平山村 曾剑锋
  8. *********************************************************************************************/
  9.  
  10. \\\\\\\\\\\\\-*- 目录 -*-/////////////
  11. | 一、跟踪板级文件:
  12. | 二、跟踪am335x_evm_init()函数:
  13. | 三、跟踪board_mux参数:
  14. | 四、跟踪am33xx_mux_init()函数:
  15. | 五、跟踪am33xx_muxmodes参数:
  16. | 六、跟踪omap_mux_init()函数:
  17. | 七、跟踪omap_mux_init_list()函数:
  18. | 八、跟踪omap_mux_init_signals函数:
  19. \\\\\\\\\\\\\\\\\\\\//////////////////
  20.  
  21. 一、跟踪板级文件:
  22. ......
  23. MACHINE_START(AM335XEVM, "am335xevm")
  24. /* Maintainer: Texas Instruments */
  25. .atag_offset = 0x100,
  26. .map_io = am335x_evm_map_io,
  27. .init_early = am33xx_init_early,
  28. .init_irq = ti81xx_init_irq,
  29. .handle_irq = omap3_intc_handle_irq,
  30. .timer = &omap3_am33xx_timer,
  31. .init_machine = am335x_evm_init, // 跟踪该函数
  32. MACHINE_END ^
  33. |
  34. MACHINE_START(AM335XIAEVM, "am335xiaevm") |
  35. /* Maintainer: Texas Instruments */ |
  36. .atag_offset = 0x100, |
  37. .map_io = am335x_evm_map_io, |
  38. .init_irq = ti81xx_init_irq, |
  39. .init_early = am33xx_init_early, |
  40. .timer = &omap3_am33xx_timer, |
  41. .init_machine = am335x_evm_init, -------------+
  42. MACHINE_END
  43.  
  44. 二、跟踪am335x_evm_init()函数:
  45. static void __init am335x_evm_init(void)
  46. {
  47. am33xx_cpuidle_init();
  48. am33xx_mux_init(board_mux); // 跟踪函数、参数
  49. omap_serial_init();
  50. am335x_evm_i2c_init();
  51. omap_sdrc_init(NULL, NULL);
  52. usb_musb_init(&musb_board_data);
  53. omap_board_config = am335x_evm_config;
  54. omap_board_config_size = ARRAY_SIZE(am335x_evm_config);
  55. /* Create an alias for icss clock */
  56. if (clk_add_alias("pruss", NULL, "pruss_uart_gclk", NULL))
  57. pr_warn("failed to create an alias: icss_uart_gclk --> pruss\n");
  58. /* Create an alias for gfx/sgx clock */
  59. if (clk_add_alias("sgx_ck", NULL, "gfx_fclk", NULL))
  60. pr_warn("failed to create an alias: gfx_fclk --> sgx_ck\n");
  61. }
  62.  
  63. 三、跟踪board_mux参数:
  64. . 跟踪board_mux[]数组:
  65. static struct omap_board_mux board_mux[] __initdata = {
  66. /*
  67. * Setting SYSBOOT[5] should set xdma_event_intr0 pin to mode 3 thereby
  68. * allowing clkout1 to be available on xdma_event_intr0.
  69. * However, on some boards (like EVM-SK), SYSBOOT[5] isn't properly
  70. * latched.
  71. * To be extra cautious, setup the pin-mux manually.
  72. * If any modules/usecase requries it in different mode, then subsequent
  73. * module init call will change the mux accordingly.
  74. *
  75. * 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference Manual -- 760页
  76. * --------------------------------------------------------------------
  77. * | Offset | Acronym | Register | Description Section |
  78. * --------------------------------------------------------------------
  79. * | 9B0h | conf_xdma_event_intr0 | | Section 9.3.51 |
  80. * --------------------------------------------------------------------
  81. * 观察上面的内容和接下来要配置引脚,我们只需要将Acronym中的conf_前缀去掉,
  82. * 然后将剩下的字符串大写,就能配置对应的引脚了,如:
  83. * 1. conf_xdma_event_intr0
  84. * 2. xdma_event_intr0
  85. * 3. XDMA_EVENT_INTR0
  86. * |
  87. * |
  88. */ V
  89. AM33XX_MUX(XDMA_EVENT_INTR0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT), // 跟踪宏
  90. AM33XX_MUX(I2C0_SDA, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |
  91. AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),
  92. AM33XX_MUX(I2C0_SCL, OMAP_MUX_MODE0 | AM33XX_SLEWCTRL_SLOW |
  93. AM33XX_INPUT_EN | AM33XX_PIN_OUTPUT),
  94. { .reg_offset = OMAP_MUX_TERMINATOR }, //后面的程序通过判断这个表示来结束注册
  95. };
  96. . 跟踪struct omap_board_mux结构体:
  97. /**
  98. * struct omap_board_mux - data for initializing mux registers
  99. * @reg_offset: mux register offset from the mux base
  100. * @mux_value: desired mux value to set
  101. */
  102. struct omap_board_mux {
  103. u16 reg_offset;
  104. u16 value;
  105. };
  106. . 跟踪AM33XX_MUX()宏:
  107. /* If pin is not defined as input, pull would get disabled.
  108. * If defined as input, flags supplied will determine pull on/off.
  109. */
  110. // 以此为例:
  111. // AM33XX_MUX(XDMA_EVENT_INTR0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT)
  112. //
  113. // .reg_offset = (AM33XX_CONTROL_PADCONF_XDMA_EVENT_INTR0_OFFSET) // 跟踪宏
  114. // .value = (((OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT) & AM33XX_INPUT_EN) \
  115. // ? (OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT) \
  116. // : ((mux_value) | AM33XX_PULL_DISA))
  117. #define AM33XX_MUX(mode0, mux_value) \
  118. { \
  119. .reg_offset = (AM33XX_CONTROL_PADCONF_##mode0##_OFFSET), \
  120. .value = (((mux_value) & AM33XX_INPUT_EN) ? (mux_value)\
  121. : ((mux_value) | AM33XX_PULL_DISA)), \
  122. }
  123. . 跟踪模式宏声明:
  124. /* 34xx mux mode options for each pin. See TRM for options */
  125. #define OMAP_MUX_MODE0 0
  126. #define OMAP_MUX_MODE1 1
  127. #define OMAP_MUX_MODE2 2
  128. #define OMAP_MUX_MODE3 3
  129. #define OMAP_MUX_MODE4 4
  130. #define OMAP_MUX_MODE5 5
  131. #define OMAP_MUX_MODE6 6
  132. #define OMAP_MUX_MODE7 7
  133. . 跟踪输出宏声明:
  134. /* Definition of output pin could have pull disabled, but
  135. * this has not been done due to two reasons
  136. * 1. AM33XX_MUX will take care of it
  137. * 2. If pull was disabled for out macro, combining out & in pull on macros
  138. * would disable pull resistor and AM33XX_MUX cannot take care of the
  139. * correct pull setting and unintentionally pull would get disabled
  140. */
  141. #define AM33XX_PIN_OUTPUT (0)
  142. . 跟踪引脚配置偏移宏,并对比数据手册:
  143. // 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference Manual -- 760页
  144. // -----------------------------------------------------------------------
  145. // | Offset | Acronym | Register | Description Section |
  146. // +--------+-----------------------+------------+-----------------------+
  147. // | 9B0h | conf_xdma_event_intr0 | | Section 9.3.51 |
  148. // -----------------------------------------------------------------------
  149. #define AM33XX_CONTROL_PADCONF_XDMA_EVENT_INTR0_OFFSET 0x09B0
  150.  
  151. 四、跟踪am33xx_mux_init()函数:
  152. . 跟踪am33xx_mux_init()函数:
  153. int __init am33xx_mux_init(struct omap_board_mux *board_subset)
  154. {
  155. return omap_mux_init("core", , AM33XX_CONTROL_PADCONF_MUX_PBASE, // 跟踪参数
  156. AM33XX_CONTROL_PADCONF_MUX_SIZE, am33xx_muxmodes,
  157. NULL, board_subset, NULL);
  158. }
  159. . 跟踪AM33XX_CONTROL_PADCONF_MUX_PBASE宏:
  160. // 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference Manual -- 158页
  161. // ----------------------------------------------------------------------------------------------------
  162. // | Region Name | Start Address (hex) | End Address (hex) | Size | Description |
  163. // +-----------------+---------------------+--------------------+--------+----------------------------+
  164. // | Control Module | 0x44E1_0000 | 0x44E1_1FFF | 128KB | Control Module Registers |
  165. // ----------------------------------------------------------------------------------------------------
  166. #define AM33XX_CONTROL_PADCONF_MUX_PBASE 0x44E10000LU
  167. . 跟踪AM33XX_CONTROL_PADCONF_MUX_SIZE宏:
  168. // 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference Manual -- 761页
  169. // 这里的大小没有搞懂,在datasheet中是1444h,而这里是B34h,没搞懂
  170. // ----------------------------------------------------------------
  171. // | Offset | Acronym | Register | Description Section |
  172. // +--------+-------------------+----------+----------------------+
  173. // | 1444h | ddr_data1_ioctrl | | Section 9.3.92 |
  174. // ----------------------------------------------------------------
  175. #define AM33XX_CONTROL_PADCONF_VREFN_OFFSET 0x0B34
  176. #define AM33XX_CONTROL_PADCONF_MUX_SIZE \
  177. (AM33XX_CONTROL_PADCONF_VREFN_OFFSET + 0x4)
  178.  
  179. 五、跟踪am33xx_muxmodes参数:
  180. . 跟踪am33xx_muxmodes[]数组:
  181. /* AM33XX pin mux super set */
  182. static struct omap_mux am33xx_muxmodes[] = {
  183. _AM33XX_MUXENTRY(GPMC_AD0, ,
  184. "gpmc_ad0", "mmc1_dat0", NULL, NULL,
  185. NULL, NULL, NULL, "gpio1_0"),
  186. _AM33XX_MUXENTRY(GPMC_AD1, ,
  187. "gpmc_ad1", "mmc1_dat1", NULL, NULL,
  188. NULL, NULL, NULL, "gpio1_1"),
  189. _AM33XX_MUXENTRY(GPMC_AD2, ,
  190. "gpmc_ad2", "mmc1_dat2", NULL, NULL,
  191. NULL, NULL, NULL, "gpio1_2"),
  192. _AM33XX_MUXENTRY(GPMC_AD3, ,
  193. "gpmc_ad3", "mmc1_dat3", NULL, NULL,
  194. NULL, NULL, NULL, "gpio1_3"),
  195. _AM33XX_MUXENTRY(GPMC_AD4, ,
  196. "gpmc_ad4", "mmc1_dat4", NULL, NULL,
  197. NULL, NULL, NULL, "gpio1_4"),
  198. ......
  199. { .reg_offset = OMAP_MUX_TERMINATOR }, //后面的程序通过判断这个表示来结束注册
  200. }
  201. . 跟踪struct omap_mux结构体:
  202. /**
  203. * struct omap_mux - data for omap mux register offset and it's value
  204. * @reg_offset: mux register offset from the mux base
  205. * @gpio: GPIO number
  206. * @muxnames: available signal modes for a ball
  207. * @balls: available balls on the package
  208. * @partition: mux partition
  209. */
  210. struct omap_mux {
  211. u16 reg_offset;
  212. u16 gpio;
  213. #ifdef CONFIG_OMAP_MUX
  214. char *muxnames[OMAP_MUX_NR_MODES];
  215. #ifdef CONFIG_DEBUG_FS
  216. char *balls[OMAP_MUX_NR_SIDES];
  217. #endif
  218. #endif
  219. };
  220. . 跟踪_AM33XX_MUXENTRY宏:
  221. //
  222. // 以此为例:
  223. // _AM33XX_MUXENTRY(GPMC_AD0, 0, "gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0")
  224. //
  225. // .reg_offset = AM33XX_CONTROL_PADCONF_GPMC_AD0_OFFSET
  226. // .gpio = 0 // 相当于取下面muxnames中的第0个
  227. // .muxnames = {"gpmc_ad0", "mmc1_dat0", NULL, NULL, NULL, NULL, NULL, "gpio1_0"}
  228. #define _AM33XX_MUXENTRY(M0, g, m0, m1, m2, m3, m4, m5, m6, m7) \
  229. { \
  230. .reg_offset = (AM33XX_CONTROL_PADCONF_##M0##_OFFSET), \
  231. .gpio = (g), \
  232. .muxnames = { m0, m1, m2, m3, m4, m5, m6, m7 }, \
  233. }
  234. . 跟踪AM33XX_CONTROL_PADCONF_GPMC_AD0_OFFSET宏,并对比datasheet
  235. // 参考书籍:AM335x ARM® Cortex™-A8 Microprocessors (MPUs) Technical Reference Manual -- 758页
  236. // ------------------------------------------------------------------------------------------------------------
  237. // | Offset | Acronym | Register | Description Section
  238. // +--------+----------------+-----------+---------------------------------------------------------------------
  239. // | 800h | conf_gpmc_ad0 | | See the device datasheet for information on default pin Section 9.3.51
  240. // ------------------------------------------------------------------------------------------------------------
  241. #define AM33XX_CONTROL_PADCONF_GPMC_AD0_OFFSET 0x0800
  242.  
  243. 六、跟踪omap_mux_init()函数:
  244. int __init omap_mux_init(const char *name, u32 flags,
  245. u32 mux_pbase, u32 mux_size,
  246. struct omap_mux *superset,
  247. struct omap_mux *package_subset,
  248. struct omap_board_mux *board_mux,
  249. struct omap_ball *package_balls)
  250. {
  251. struct omap_mux_partition *partition;
  252.  
  253. partition = kzalloc(sizeof(struct omap_mux_partition), GFP_KERNEL);
  254. if (!partition)
  255. return -ENOMEM;
  256.  
  257. partition->name = name; // 分区的意思相当于模块的意思
  258. partition->flags = flags;
  259. partition->size = mux_size;
  260. partition->phys = mux_pbase;
  261. partition->base = ioremap(mux_pbase, mux_size); // 重新映射IO地址
  262. if (!partition->base) {
  263. pr_err("%s: Could not ioremap mux partition at 0x%08x\n",
  264. __func__, partition->phys);
  265. kfree(partition);
  266. return -ENODEV;
  267. }
  268.  
  269. INIT_LIST_HEAD(&partition->muxmodes); // 初始化分区头结点链表
  270.  
  271. list_add_tail(&partition->node, &mux_partitions); // 将分区加入分区链表
  272. mux_partitions_cnt++; // 分区总数统计
  273. pr_info("%s: Add partition: #%d: %s, flags: %x\n", __func__,
  274. mux_partitions_cnt, partition->name, partition->flags);
  275.  
  276. omap_mux_init_package(superset, package_subset, package_balls); // 两个都是null
  277. omap_mux_init_list(partition, superset); // 跟踪函数
  278. omap_mux_init_signals(partition, board_mux); // 跟踪函数
  279.  
  280. return ;
  281. }
  282.  
  283. 七、跟踪omap_mux_init_list()函数:
  284. . 跟踪omap_mux_init_list()函数:
  285. /*
  286. * Note if CONFIG_OMAP_MUX is not selected, we will only initialize
  287. * the GPIO to mux offset mapping that is needed for dynamic muxing
  288. * of GPIO pins for off-idle.
  289. */
  290. static void __init omap_mux_init_list(struct omap_mux_partition *partition,
  291. struct omap_mux *superset)
  292. {
  293. while (superset->reg_offset != OMAP_MUX_TERMINATOR) {
  294. struct omap_mux *entry;
  295.  
  296. // 去掉一些不符合要求的的配置引脚
  297. #ifdef CONFIG_OMAP_MUX
  298. if (!superset->muxnames || !superset->muxnames[]) {
  299. superset++;
  300. continue;
  301. }
  302. #else
  303. /* Skip pins that are not muxed as GPIO by bootloader */
  304. if (!OMAP_MODE_GPIO(omap_mux_read(partition,
  305. superset->reg_offset))) {
  306. superset++;
  307. continue;
  308. }
  309. #endif
  310.  
  311. entry = omap_mux_list_add(partition, superset);
  312. if (!entry) {
  313. pr_err("%s: Could not add entry\n", __func__);
  314. return;
  315. }
  316. superset++;
  317. }
  318. }
  319. . 跟踪omap_mux_list_add()函数:
  320. static struct omap_mux * __init omap_mux_list_add(
  321. struct omap_mux_partition *partition,
  322. struct omap_mux *src)
  323. {
  324. struct omap_mux_entry *entry;
  325. struct omap_mux *m;
  326.  
  327. entry = kzalloc(sizeof(struct omap_mux_entry), GFP_KERNEL);
  328. if (!entry)
  329. return NULL;
  330.  
  331. m = &entry->mux;
  332. entry->mux = *src;
  333.  
  334. #ifdef CONFIG_OMAP_MUX
  335. if (omap_mux_copy_names(src, m)) { // 将数据另存的感觉
  336. kfree(entry);
  337. return NULL;
  338. }
  339. #endif
  340.  
  341. mutex_lock(&muxmode_mutex);
  342. list_add_tail(&entry->node, &partition->muxmodes); // 将节点放入分区节点链表中
  343. mutex_unlock(&muxmode_mutex);
  344.  
  345. return m;
  346. }
  347. . 跟踪omap_mux_copy_names()函数:
  348. // 这个函数的大概意思也就是转存的感觉
  349. static int __init omap_mux_copy_names(struct omap_mux *src,
  350. struct omap_mux *dst)
  351. {
  352. int i;
  353.  
  354. for (i = ; i < OMAP_MUX_NR_MODES; i++) {
  355. if (src->muxnames[i]) {
  356. dst->muxnames[i] = kstrdup(src->muxnames[i],
  357. GFP_KERNEL);
  358. if (!dst->muxnames[i])
  359. goto free;
  360. }
  361. }
  362.  
  363. #ifdef CONFIG_DEBUG_FS
  364. for (i = ; i < OMAP_MUX_NR_SIDES; i++) {
  365. if (src->balls[i]) {
  366. dst->balls[i] = kstrdup(src->balls[i], GFP_KERNEL);
  367. if (!dst->balls[i])
  368. goto free;
  369. }
  370. }
  371. #endif
  372.  
  373. return ;
  374.  
  375. free:
  376. omap_mux_free_names(dst);
  377. return -ENOMEM;
  378.  
  379. }
  380.  
  381. 八、跟踪omap_mux_init_signals函数:
  382. . 跟踪omap_mux_init_signals()函数:
  383. static void omap_mux_init_signals(struct omap_mux_partition *partition,
  384. struct omap_board_mux *board_mux)
  385. {
  386. omap_mux_set_cmdline_signals(); // 不知道这里是干啥的,不跟踪
  387. omap_mux_write_array(partition, board_mux); // 跟踪该函数
  388. }
  389. . 跟踪omap_mux_write_array()函数:
  390. void omap_mux_write_array(struct omap_mux_partition *partition,
  391. struct omap_board_mux *board_mux)
  392. {
  393. if (!board_mux)
  394. return;
  395.  
  396. while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) {
  397. omap_mux_write(partition, board_mux->value, // 跟踪函数
  398. board_mux->reg_offset);
  399. board_mux++;
  400. }
  401. }
  402. . 跟踪am33xx_mux_init()函数:
  403. /*
  404. * int __init am33xx_mux_init(struct omap_board_mux *board_subset)
  405. * {
  406. * return omap_mux_init("core", 0 /* flag = 0 */, AM33XX_CONTROL_PADCONF_MUX_PBASE,
  407. * AM33XX_CONTROL_PADCONF_MUX_SIZE, am33xx_muxmodes,
  408. * NULL, board_subset, NULL);
  409. * }
  410. */
  411. void omap_mux_write(struct omap_mux_partition *partition, u16 val,
  412. u16 reg)
  413. {
  414. if (partition->flags & OMAP_MUX_REG_8BIT)
  415. __raw_writeb(val, partition->base + reg);
  416. else
  417. __raw_writew(val, partition->base + reg);
  418. }
  419. . 跟踪OMAP_MUX_REG_8BIT宏:
  420. /*
  421. * omap_mux_init flags definition:
  422. *
  423. * OMAP_MUX_REG_8BIT: Ensure that access to padconf is done in 8 bits.
  424. * The default value is 16 bits.
  425. * OMAP_MUX_GPIO_IN_MODE3: The GPIO is selected in mode3.
  426. * The default is mode4.
  427. */
  428. #define OMAP_MUX_REG_8BIT (1 << 0)

TI AM335x Linux MUX hacking的更多相关文章

  1. ti processor sdk linux am335x evm Makefile hacking

    # # ti processor sdk linux am335x evm Makefile hacking # 说明: # 本文主要对TI的sdk中的Makefile脚本进行解读,是为了了解其工作机 ...

  2. TI AM335X处理器介绍

    AM335X是美国TI(德州仪器)公司基于 ARM Cortex-A8内核的AM335X微处理器,在图像.图形处理.外设方面进行了增强,并全面支持诸如 EtherCAT 和 PROFIBUS等工业接口 ...

  3. am335x Linux kernel DTS pinmux 定义记录

    记录am335x TI PDK3.0 Linux Kernel 设备的pinmux 的配置 在TI 的Linux kernel 设备树里面,有很多关于pinctrl-single,pins 的配置, ...

  4. TI AM335x ARM Cortex-A8工业级核心板,工业网关、工业HMI等用户首选

    创龙科技近期推出了ti AM335x ARM Cortex-A8工业级核心板,它拥有高性能.低功耗.低成本.接口丰富等优势,成为了工业网关.工业HMI等用户的首要选择.另外,核心板采用邮票孔连接方式, ...

  5. OK335xS pwm buzzer Linux driver hacking

    /**************************************************************************** * OK335xS pwm buzzer L ...

  6. TI am335x am437x PRU

    http://bbs.eeworld.com.cn/thread-355798-1-1.html

  7. AM335X启动(转)

    AM335x启动   参考文件: 1.TI.Reference_Manual_1.pdf http://pan.baidu.com/s/1c1BJNtm 2.TI_AM335X.pdf http:// ...

  8. AM335x启动

    参考文件: 1.TI.Reference_Manual_1.pdf http://pan.baidu.com/s/1c1BJNtm 2.TI_AM335X.pdf http://pan.baidu.c ...

  9. AM335X UBOOT(以UART为例分析UBOOT主要流程)

    UBOOT2016.05 UART初始化及设置 SPL阶段 第一部分C函数 |- s_init //(arch/arm/cpu/armv7/am33xx/board.c) |- set_uart_mu ...

随机推荐

  1. Eclipse如何快速改变主题颜色

    厌倦了Eclipse的白底黑子,我们来更换下Eclipse的主题颜色,让眼睛更舒服一点 首先先进入网址:http://eclipsecolorthemes.org/ 选择一个主题进入,点击进入如下: ...

  2. pyHook监听用户鼠标、键盘事件

    一.代码部分:获取用户输入信息,并与截图一起保存到XX目录下   # -*- coding: utf-8 -*- #   import pythoncom import pyHook    impor ...

  3. Qt5_各种路径

    1.Qt5.3.2 -- vs2010 -- OpenGL 1.1.发布时需要的 DLL文件的路径 F:\ZC_software_installDir\Qt5.3.2_vs2010\5.3\msvc2 ...

  4. [原][JSBSim]基于qt代码实现:TCP|UDP与飞行模拟软件JSBSim的通信,现实模型飞行!

    废话没有,上关键代码 头文件 #include <QUdpSocket> #include <qtcpsocket.h> #ifndef vrUDP #define vrUDP ...

  5. 《剑指offer》第十题(斐波那契数列)

    // 面试题:斐波那契数列 // 题目:写一个函数,输入n,求斐波那契(Fibonacci)数列的第n项. #include <iostream> using namespace std; ...

  6. ListView事件的研究

    1. ListView的OnItemClickListener不被触发的另外一种情况 如上图,在一个ItemView中,只有一个TextView位于最左侧,他的右侧是空白区域,没有任何控件,当点击右侧 ...

  7. CAS-自旋锁

    自旋锁 自旋锁(spinlock):是指当一个线程在获取锁的时候,如果锁已经被其它线程获取,那么该线程将循环等待,然后不断的判断锁是否能够被成功获取,直到获取到锁才会退出循环.  获取锁的线程一直处于 ...

  8. SSH Secure Shell Client--- the host may be dow

    the host may be down,or there may be a problem with the network connection. Sometimes such problems ...

  9. jsp post/get中接处理

    jsp post/get中接处理 以参数:username为便 post接收中文比get接收中文要方便多了. <%@ page contentType="text/html;chars ...

  10. English trip -- Review Unit8 Work 工作

    工作一般询问对方的工作情况的方式: What job is it?  它的工作是什么? You're a engineer?     你是工程师? Right  是的 What do you do?  ...