当前位置:首页>Linux>Linux设备驱动 -- LED字符设备驱动

Linux设备驱动 -- LED字符设备驱动

  • 2026-03-27 15:19:57
Linux设备驱动 -- LED字符设备驱动

Linux字符设备驱动

Linux实现了一套字符设备驱动框架,编写字符设备驱动就按照框架进行编写。

Linux驱动 = 硬件操作 + 软件框架

在字符设备驱动最很重要的就是实现struct file_operations该结构中的函数。

struct file_operations 结构体定义了字符设备驱动提供给虚拟文件系统的接口函数。

struct file_operations结构体定义:

structfile_operations {
structmodule *owner;
loff_t (*llseek) (struct file *, loff_tint);
ssize_t (*read) (struct file *, char __user *, size_tloff_t *);
ssize_t (*write) (struct file *, constchar __user *, size_tloff_t *);
ssize_t (*read_iter) (struct kiocb *, struct iov_iter *);
ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
int (*iterate) (struct file *, struct dir_context *);
int (*iterate_shared) (struct file *, struct dir_context *);
unsignedint(*poll)(struct file *, struct poll_table_struct *);
long (*unlocked_ioctl) (struct file *, unsignedintunsignedlong);
long (*compat_ioctl) (struct file *, unsignedintunsignedlong);
int (*mmap) (struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *, fl_owner_t id);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, loff_tloff_tint datasync);
int (*fasync) (intstruct file *, int);
int (*lock) (struct file *, intstruct file_lock *);
ssize_t (*sendpage) (struct file *, struct page *, intsize_tloff_t *, int);
unsignedlong(*get_unmapped_area)(struct file *, unsignedlongunsignedlongunsignedlongunsignedlong);
int (*check_flags)(int);
int (*flock) (struct file *, intstruct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_tunsignedint);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_tunsignedint);
int (*setlease)(struct file *, longstruct file_lock **, void **);
long (*fallocate)(struct file *file, int mode, loff_t offset,
loff_t len);
void (*show_fdinfo)(struct seq_file *m, struct file *f);
#ifndef CONFIG_MMU
unsigned (*mmap_capabilities)(struct file *);
#endif
ssize_t (*copy_file_range)(struct file *, loff_tstruct file *,
loff_tsize_tunsignedint);
int (*clone_file_range)(struct file *, loff_tstruct file *, loff_t,
            u64);
ssize_t (*dedupe_file_range)(struct file *, u64, u64, struct file *,
            u64);
};

结构体中的函数指针和系统的system call 名字很类似

LED字符设备驱动

1、查看手册和原理图得到可操作LED连接GPIO组的相关寄存器

#define  CCM_CCGR1                0x20C406C                           
#define  MUX_PAD_GPIO1_IO04       0x20E006C    

#define  GPIO1_DR                 0x209C000
#define  GPIO1_GDIR               0x209C004

2、定义struct file_operations led_drv结构体并填充成员

staticstructfile_operationsled_drv = {
    .owner     = THIS_MODULE,
    .open    = led_drv_open,
    .read    = led_drv_read,
    .write   = led_drv_write,
    .release = led_drv_close,
};

.owner成员值一般设置为THIS_MODULE

3、实现file_operations结构填充的函数

staticunsignedint __iomem *_CCM_CCGR1;
staticunsignedint __iomem *_MUX_PAD_GPIO1_IO04;
staticunsignedint __iomem *_GPIO1_DR;
staticunsignedint __iomem *_GPIO1_GDIR;

staticint major = 0;    
staticstructclass *led_class;

staticintled_drv_open(struct inode *node, struct file *file)
{
int val;

     printk("open %s %s line %d\n", __FILE__, __FUNCTION__, __LINE__);

    _CCM_CCGR1 = ioremap(CCM_CCGR1, 4);                        //重映射物理地址为虚拟地址           
    _MUX_PAD_GPIO1_IO04 = ioremap(MUX_PAD_GPIO1_IO04, 4);
    _GPIO1_DR = ioremap(GPIO1_DR, 4);
    _GPIO1_GDIR = ioremap(GPIO1_GDIR, 4);  

    val = ioread32(_CCM_CCGR1);
    val &= ~(3 << 26);   
    val |= (3 << 26);   
    iowrite32(val, _CCM_CCGR1);    

    val = 0;
    val = ioread32(_MUX_PAD_GPIO1_IO04);     
    val &= ~(0xf << 0);    
    val |= (0x5 << 0);  
    iowrite32(val, _MUX_PAD_GPIO1_IO04);   

    val = 0;
    val = ioread32(_GPIO1_GDIR);     
    val |= (0x1 << 4); 
    iowrite32(val, _GPIO1_GDIR);   

return0;
}

staticssize_tled_drv_read(struct file *file, char __user *buf, size_t size, loff_t *offset)
{
    printk("read %s %s line %d\n", __FILE__, __FUNCTION__, __LINE__);
return0;
}

/* write(fd, &val, 1); */
staticssize_tled_drv_write(struct file *file, constchar __user *buf, size_t size, loff_t *offset)
{
int err;
char status;
int val = 0;

    printk("write %s %s line %d\n", __FILE__, __FUNCTION__, __LINE__);

    err = copy_from_user(&status, buf, 1);

if (status)
    {
        val &= ~(1 << 4);
        iowrite32(val, _GPIO1_DR);   
    }
else
    {
        val |= (1 << 4);
        iowrite32(val, _GPIO1_DR);       
    }

return1;
}

staticintled_drv_close(struct inode *node, struct file *file)
{
    printk("close %s %s line %d\n", __FILE__, __FUNCTION__, __LINE__);
    iounmap(_CCM_CCGR1);
    iounmap(_MUX_PAD_GPIO1_IO04);
    iounmap(_GPIO1_DR);
    iounmap(_GPIO1_GDIR);
return0;
}

因为有MMU存在,Linux进程中使用的是虚拟地址,需要将寄存器的物理地址转换为内核能使用虚拟地址

重映射物理地址为虚拟地址    :

_CCM_CCGR1 = ioremap(CCM_CCGR1, 4);                        //重映射物理地址为虚拟地址           
_MUX_PAD_GPIO1_IO04 = ioremap(MUX_PAD_GPIO1_IO04, 4);
_GPIO1_DR = ioremap(GPIO1_DR, 4);
_GPIO1_GDIR = ioremap(GPIO1_GDIR, 4);  

在led设备关闭操作中对虚拟地址解除映射:

 iounmap(_CCM_CCGR1);
 iounmap(_MUX_PAD_GPIO1_IO04);
 iounmap(_GPIO1_DR);
 iounmap(_GPIO1_GDIR);

读寄存器:

val = ioread32(_CCM_CCGR1);

写寄存器:

iowrite32(val, _CCM_CCGR1);    

用户空间应用程序通过调用system call时通过swi从用户空间陷入到内核空间进而调用了驱动中提供的函数。 而用户空间和内核空间的内存是隔离的,所以应用程序完内核写如数据需要需要进行数据的拷贝传递 将用户空间的程序拷贝到内核空间:

err = copy_from_user(&status, buf, 1);

4、驱动的入口/出口函数


/* 驱动加载函数 */
staticint __init led_init(void)
{
int err;
    major = register_chrdev(0"my_led", &led_drv);

    led_class = class_create(THIS_MODULE, "my_led_class");
    err = PTR_ERR(led_class);
if (IS_ERR(led_class)) {
        unregister_chrdev(major, "my_led"); 
return-1;
    }
    device_create(led_class, NULL, MKDEV(major, 0), NULL"my_led"); 
       printk("init %s %s line %d\n", __FILE__, __FUNCTION__, __LINE__);
return0;
}

/* 驱动卸载函数 */
staticvoid __exit led_exit(void)
{
    printk("exit %s %s line %d\n", __FILE__, __FUNCTION__, __LINE__);
    device_destroy(led_class, MKDEV(major, 0));           //销毁设备节点
    class_destroy(led_class);                             //销毁跟设备节点相关的类       
    unregister_chrdev(major, "my_led");                   //注销设备
}

module_init(led_init);
module_exit(led_exit);

MODULE_AUTHOR("Ares");
MODULE_LICENSE("GPL");

注册字符设备驱动:

major = register_chrdev(0"my_led", &led_drv);  //向系统申请设备号 

创建管理LED设备驱动的类:

led_class = class_create(THIS_MODULE, "my_led_class");

加载驱动自动创建设备节点:

device_create(led_class, NULL, MKDEV(major, 0), NULL"my_led");   //创建了设备节点,用户空间才能通过设备节点进行操作硬件

在驱动入口函数中注册设备、创建设备节点等,相应的需要在驱动卸载的出口函数中进行相反的操作。

通过主设备号和此设备号合并得到设备号:

MKDEV(major, 0)  //kdev_t.h头文件中定义

5、加载/卸载驱动

加载驱动:

debian@npi:~/nfs_rootfs$ sudo insmod led.ko

加载驱动 后/dev/目录下出现了设备节点:

debian@npi:~/nfs_rootfs$ ls /dev/my_led
/dev/my_led
在这里插入图片描述

卸载驱动:

sudo rmmod led.ko

编写应用程序测试驱动


#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdio.h>
#include<string.h>

/*
 * ./ledtest /dev/dev_name on
 * ./ledtest /dev/dev_name off
 */

intmain(int argc, char **argv)
{
int fd;
char status;

if (argc != 3
    {
printf("Usage: %s \n", argv[0]);
return-1;
    }

    fd = open(argv[1], O_RDWR);
if (fd == -1)
    {
printf("can not open file %s\n", argv[1]);
return-1;
    }

if (0 == strcmp(argv[2], "on"))
    {
        status = 1;
        write(fd, &status, 1);
    }
else
    {
        status = 0;
        write(fd, &status, 1);
    }

    close(fd);

return0;
}

执行应用程序操作LED:

debian@npi:~/nfs_rootfs$ sudo ./led_test /dev/my_led on
debian@npi:~/nfs_rootfs$ sudo ./led_test /dev/my_led off

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 16:37:06 HTTP/2.0 GET : https://f.mffb.com.cn/a/480204.html
  2. 运行时间 : 0.227859s [ 吞吐率:4.39req/s ] 内存消耗:4,654.40kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=07988a4dd438bc0395d407234ee54f0e
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001173s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001637s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.005397s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000656s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001335s ]
  6. SELECT * FROM `set` [ RunTime:0.002334s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001513s ]
  8. SELECT * FROM `article` WHERE `id` = 480204 LIMIT 1 [ RunTime:0.002556s ]
  9. UPDATE `article` SET `lasttime` = 1774600626 WHERE `id` = 480204 [ RunTime:0.005483s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.000678s ]
  11. SELECT * FROM `article` WHERE `id` < 480204 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.003105s ]
  12. SELECT * FROM `article` WHERE `id` > 480204 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.005046s ]
  13. SELECT * FROM `article` WHERE `id` < 480204 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002994s ]
  14. SELECT * FROM `article` WHERE `id` < 480204 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002874s ]
  15. SELECT * FROM `article` WHERE `id` < 480204 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003645s ]
0.234093s