⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delay.h

📁 Linux内核源代码 为压缩文件 是<<Linux内核>>一书中的源代码
💻 H
字号:
#ifdef __KERNEL__#ifndef _PPC_DELAY_H#define _PPC_DELAY_H/* * Copyright 1996, Paul Mackerras. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */extern unsigned long loops_per_sec;extern __inline__ void __delay(unsigned int loops){	if (loops != 0)		__asm__ __volatile__("mtctr %0; 1: bdnz 1b" : :				     "r" (loops) : "ctr");}extern __inline__ void udelay(unsigned long usecs){	unsigned long loops;	/* compute (usecs * 2^32 / 10^6) * loops_per_sec / 2^32 */	usecs *= 0x10c6;		/* 2^32 / 10^6 */	__asm__("mulhwu %0,%1,%2" : "=r" (loops) :		"r" (usecs), "r" (loops_per_sec));	__delay(loops);}#endif /* defined(_PPC_DELAY_H) */#endif /* __KERNEL__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -