Linux驱动技术(一) _内存申请

时间:2025-11-04 19:31:44来源:极客码头作者:系统运维
Linux驱动技术(一) _内存申请
复制/**   * kmalloc - allocate memory   * @size: how many bytes of memory are required.   * @flags: the type of memory to allocate.   * The @flags argument may be one of:   * %GFP_USER - Allocate memory on behalf ofuser.  May sleep.   * %GFP_KERNEL - Allocate normal kernel ram.  May sleep.   * %GFP_ATOMIC - Allocation will not sleep.  May use emergency pools.   *    * For example,驱请 use this inside interrupt handlers.   */  void *kmalloc(size_t size, gfp_t flags);  /**   * kfree - free previously allocated memory   * @objp: pointer returned by kmalloc.   * If @objp isNULL, no operation is performed.   */  void kfree(const void *objp);   1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.
相关内容