本网站可以出售:只需60000元直接拥有。QQ:939804642
您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ACPI_MEMSET函数代码示例

51自学网 2021-06-01 19:32:47
  C++
这篇教程C++ ACPI_MEMSET函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ACPI_MEMSET函数的典型用法代码示例。如果您正苦于以下问题:C++ ACPI_MEMSET函数的具体用法?C++ ACPI_MEMSET怎么用?C++ ACPI_MEMSET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ACPI_MEMSET函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: acpi_initialize_tables

acpi_status __initacpi_initialize_tables(struct acpi_table_desc * initial_table_array,		       u32 initial_table_count, u8 allow_resize){	acpi_physical_address rsdp_address;	acpi_status status;	ACPI_FUNCTION_TRACE(acpi_initialize_tables);	/*	 * Set up the Root Table Array	 * Allocate the table array if requested	 */	if (!initial_table_array) {		status = acpi_allocate_root_table(initial_table_count);		if (ACPI_FAILURE(status)) {			return_ACPI_STATUS(status);		}	} else {		/* Root Table Array has been statically allocated by the host */		ACPI_MEMSET(initial_table_array, 0,			    (acpi_size) initial_table_count *			    sizeof(struct acpi_table_desc));		acpi_gbl_root_table_list.tables = initial_table_array;		acpi_gbl_root_table_list.max_table_count = initial_table_count;		acpi_gbl_root_table_list.flags = ACPI_ROOT_ORIGIN_UNKNOWN;		if (allow_resize) {			acpi_gbl_root_table_list.flags |=			    ACPI_ROOT_ALLOW_RESIZE;		}	}	/* Get the address of the RSDP */	rsdp_address = acpi_os_get_root_pointer();	if (!rsdp_address) {		return_ACPI_STATUS(AE_NOT_FOUND);	}	/*	 * Get the root table (RSDT or XSDT) and extract all entries to the local	 * Root Table Array. This array contains the information of the RSDT/XSDT	 * in a common, more useable format.	 */	status = acpi_tb_parse_root_table(rsdp_address);	return_ACPI_STATUS(status);}
开发者ID:Core2idiot,项目名称:Kernel-Samsung-3.0...-,代码行数:49,


示例2: AcpiOsAllocateZeroed

void *AcpiOsAllocateZeroed (    ACPI_SIZE               Size){    void                    *Mem;    Mem = AcpiOsAllocate (Size);    if (Mem)    {        ACPI_MEMSET (Mem, 0, Size);    }    return (Mem);}
开发者ID:d3c0n808,项目名称:Intel-iasl,代码行数:15,


示例3: AcpiTbCreateLocalFadt

voidAcpiTbCreateLocalFadt (    ACPI_TABLE_HEADER       *Table,    UINT32                  Length){    /*     * Check if the FADT is larger than the largest table that we expect     * (the ACPI 5.0 version). If so, truncate the table, and issue     * a warning.     */    if (Length > sizeof (ACPI_TABLE_FADT))    {        ACPI_BIOS_WARNING ((AE_INFO,            "FADT (revision %u) is longer than ACPI 5.0 version, "            "truncating length %u to %u",            Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT)));    }    /* Clear the entire local FADT */    ACPI_MEMSET (&AcpiGbl_FADT, 0, sizeof (ACPI_TABLE_FADT));    /* Copy the original FADT, up to sizeof (ACPI_TABLE_FADT) */    ACPI_MEMCPY (&AcpiGbl_FADT, Table,        ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT)));    /* Take a copy of the Hardware Reduced flag */    AcpiGbl_ReducedHardware = FALSE;    if (AcpiGbl_FADT.Flags & ACPI_FADT_HW_REDUCED)    {        AcpiGbl_ReducedHardware = TRUE;    }    /* Convert the local copy of the FADT to the common internal format */    AcpiTbConvertFadt ();    /* Validate FADT values now, before we make any changes */    AcpiTbValidateFadt ();    /* Initialize the global ACPI register structures */    AcpiTbSetupFadtRegisters ();}
开发者ID:RTOSkit,项目名称:haiku,代码行数:48,


示例4: acpi_tb_init_table_descriptor

/******************************************************************************* * * FUNCTION:    acpi_tb_init_table_descriptor * * PARAMETERS:  table_desc              - Table descriptor *              address                 - Physical address of the table *              flags                   - Allocation flags of the table *              table                   - Pointer to the table * * RETURN:      None * * DESCRIPTION: Initialize a new table descriptor * ******************************************************************************/voidacpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc,			      acpi_physical_address address,			      u8 flags, struct acpi_table_header *table){	/*	 * Initialize the table descriptor. Set the pointer to NULL, since the	 * table is not fully mapped at this time.	 */	ACPI_MEMSET(table_desc, 0, sizeof(struct acpi_table_desc));	table_desc->address = address;	table_desc->length = table->length;	table_desc->flags = flags;	ACPI_MOVE_32_TO_32(table_desc->signature.ascii, table->signature);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:30,


示例5: acpi_ns_initialize_objects

acpi_status acpi_ns_initialize_objects(void){	acpi_status status;	struct acpi_init_walk_info info;	ACPI_FUNCTION_TRACE(ns_initialize_objects);	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "**** Starting initialization of namespace objects ****/n"));	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,			      "Completing Region/Field/Buffer/Package initialization:"));	/* Set all init info to zero */	ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info));	/* Walk entire namespace from the supplied root */	status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,				     ACPI_UINT32_MAX, acpi_ns_init_one_object, NULL,				     &info, NULL);	if (ACPI_FAILURE(status)) {		ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace"));	}	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,<<<<<<< HEAD			      "/nInitialized %u/%u Regions %u/%u Fields %u/%u "			      "Buffers %u/%u Packages (%u nodes)/n",=======			      "/nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd "			      "Buffers %hd/%hd Packages (%hd nodes)/n",>>>>>>> 296c66da8a02d52243f45b80521febece5ed498a			      info.op_region_init, info.op_region_count,			      info.field_init, info.field_count,			      info.buffer_init, info.buffer_count,			      info.package_init, info.package_count,			      info.object_count));	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,<<<<<<< HEAD			  "%u Control Methods found/n", info.method_count));	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "%u Op Regions found/n", info.op_region_count));=======			  "%hd Control Methods found/n", info.method_count));
开发者ID:Core2idiot,项目名称:Kernel-Samsung-3.0...-,代码行数:46,


示例6: ACPI_FUNCTION_NAME

void *acpi_os_acquire_object(struct acpi_memory_list *cache){	acpi_status status;	void *object;	ACPI_FUNCTION_NAME(os_acquire_object);	if (!cache) {		return (NULL);	}	status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);	if (ACPI_FAILURE(status)) {		return (NULL);	}	ACPI_MEM_TRACKING(cache->requests++);	/* Check the cache first */	if (cache->list_head) {		/* There is an object available, use it */		object = cache->list_head;		cache->list_head = *(ACPI_CAST_INDIRECT_PTR(char,							    &(((char *)							       object)[cache->								       link_offset])));		cache->current_depth--;		ACPI_MEM_TRACKING(cache->hits++);		ACPI_DEBUG_PRINT((ACPI_DB_EXEC,				  "Object %p from %s cache/n", object,				  cache->list_name));		status = acpi_ut_release_mutex(ACPI_MTX_CACHES);		if (ACPI_FAILURE(status)) {			return (NULL);		}		/* Clear (zero) the previously used Object */		ACPI_MEMSET(object, 0, cache->object_size);	} else {
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:46,


示例7: ACPI_FUNCTION_ENTRY

void *acpi_ut_allocate_zeroed(acpi_size size,			      u32 component, char *module, u32 line){	void *allocation;	ACPI_FUNCTION_ENTRY();	allocation = acpi_ut_allocate(size, component, module, line);	if (allocation) {		/* Clear the memory block */		ACPI_MEMSET(allocation, 0, size);	}	return (allocation);}
开发者ID:PyroOS,项目名称:Pyro,代码行数:17,


示例8: AcpiUtAcquireFromCache

void *AcpiUtAcquireFromCache (    UINT32                  ListId){    ACPI_MEMORY_LIST        *CacheInfo;    void                    *Object;    ACPI_FUNCTION_NAME ("UtAcquireFromCache");    CacheInfo = &AcpiGbl_MemoryLists[ListId];    if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES)))    {        return (NULL);    }    ACPI_MEM_TRACKING (CacheInfo->CacheRequests++);    /* Check the cache first */    if (CacheInfo->ListHead)    {        /* There is an object available, use it */        Object = CacheInfo->ListHead;        CacheInfo->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) Object)[CacheInfo->LinkOffset])));        ACPI_MEM_TRACKING (CacheInfo->CacheHits++);        CacheInfo->CacheDepth--;#ifdef ACPI_DBG_TRACK_ALLOCATIONS        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p from %s/n",                           Object, AcpiGbl_MemoryLists[ListId].ListName));#endif        if (ACPI_FAILURE (AcpiUtReleaseMutex (ACPI_MTX_CACHES)))        {            return (NULL);        }        /* Clear (zero) the previously used Object */        ACPI_MEMSET (Object, 0, CacheInfo->ObjectSize);    }
开发者ID:kame,项目名称:kame,代码行数:45,


示例9: acpi_os_release_object

acpi_statusacpi_os_release_object(struct acpi_memory_list * cache, void *object){	acpi_status status;	ACPI_FUNCTION_ENTRY();	if (!cache || !object) {		return (AE_BAD_PARAMETER);	}	/* If cache is full, just free this object */	if (cache->current_depth >= cache->max_depth) {		ACPI_FREE(object);		ACPI_MEM_TRACKING(cache->total_freed++);	}	/* Otherwise put this object back into the cache */	else {		status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES);		if (ACPI_FAILURE(status)) {			return (status);		}		/* Mark the object as cached */		ACPI_MEMSET(object, 0xCA, cache->object_size);		ACPI_SET_DESCRIPTOR_TYPE(object, ACPI_DESC_TYPE_CACHED);		/* Put the object at the head of the cache list */		*(ACPI_CAST_INDIRECT_PTR(char,					 &(((char *)object)[cache->							    link_offset]))) =		    cache->list_head;		cache->list_head = object;		cache->current_depth++;		(void)acpi_ut_release_mutex(ACPI_MTX_CACHES);	}	return (AE_OK);}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:45,


示例10: AcpiNsInitializeObjects

ACPI_STATUSAcpiNsInitializeObjects (    void){    ACPI_STATUS             Status;    ACPI_INIT_WALK_INFO     Info;    ACPI_FUNCTION_TRACE (NsInitializeObjects);    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,        "**** Starting initialization of namespace objects ****/n"));    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,        "Completing Region/Field/Buffer/Package initialization:/n"));    /* Set all init info to zero */    ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));    /* Walk entire namespace from the supplied root */    Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,                ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,                &Info, NULL);    if (ACPI_FAILURE (Status))    {        ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));    }    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,        "    Initialized %u/%u Regions %u/%u Fields %u/%u "        "Buffers %u/%u Packages (%u nodes)/n",        Info.OpRegionInit,  Info.OpRegionCount,        Info.FieldInit,     Info.FieldCount,        Info.BufferInit,    Info.BufferCount,        Info.PackageInit,   Info.PackageCount, Info.ObjectCount));    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,        "%u Control Methods found/n", Info.MethodCount));    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,        "%u Op Regions found/n", Info.OpRegionCount));    return_ACPI_STATUS (AE_OK);}
开发者ID:CSharpLover,项目名称:MosquitOS,代码行数:45,


示例11: acpi_ut_acquire_from_cache

void *acpi_ut_acquire_from_cache (	u32                             list_id){	struct acpi_memory_list         *cache_info;	void                            *object;	ACPI_FUNCTION_NAME ("ut_acquire_from_cache");	cache_info = &acpi_gbl_memory_lists[list_id];#ifdef ACPI_ENABLE_OBJECT_CACHE	if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) {		return (NULL);	}	ACPI_MEM_TRACKING (cache_info->cache_requests++);	/* Check the cache first */	if (cache_info->list_head) {		/* There is an object available, use it */		object = cache_info->list_head;		cache_info->list_head = *(ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset])));		ACPI_MEM_TRACKING (cache_info->cache_hits++);		cache_info->cache_depth--;#ifdef ACPI_DBG_TRACK_ALLOCATIONS		ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p from %s/n",			object, acpi_gbl_memory_lists[list_id].list_name));#endif		if (ACPI_FAILURE (acpi_ut_release_mutex (ACPI_MTX_CACHES))) {			return (NULL);		}		/* Clear (zero) the previously used Object */		ACPI_MEMSET (object, 0, cache_info->object_size);	}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:45,


示例12: AcpiTbInitTableDescriptor

voidAcpiTbInitTableDescriptor (    ACPI_TABLE_DESC         *TableDesc,    ACPI_PHYSICAL_ADDRESS   Address,    UINT8                   Flags,    ACPI_TABLE_HEADER       *Table){    /*     * Initialize the table descriptor. Set the pointer to NULL, since the     * table is not fully mapped at this time.     */    ACPI_MEMSET (TableDesc, 0, sizeof (ACPI_TABLE_DESC));    TableDesc->Address = Address;    TableDesc->Length = Table->Length;    TableDesc->Flags = Flags;    ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature);}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:18,


示例13: AcpiUtReleaseToCache

voidAcpiUtReleaseToCache (    UINT32                  ListId,    void                    *Object){    ACPI_MEMORY_LIST        *CacheInfo;    ACPI_FUNCTION_ENTRY ();    /* If walk cache is full, just free this wallkstate object */    CacheInfo = &AcpiGbl_MemoryLists[ListId];    if (CacheInfo->CacheDepth >= CacheInfo->MaxCacheDepth)    {        ACPI_MEM_FREE (Object);        ACPI_MEM_TRACKING (CacheInfo->TotalFreed++);    }    /* Otherwise put this object back into the cache */    else    {        if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_CACHES)))        {            return;        }        /* Mark the object as cached */        ACPI_MEMSET (Object, 0xCA, CacheInfo->ObjectSize);        ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED);        /* Put the object at the head of the cache list */        * (ACPI_CAST_INDIRECT_PTR (char, &(((char *) Object)[CacheInfo->LinkOffset]))) = CacheInfo->ListHead;        CacheInfo->ListHead = Object;        CacheInfo->CacheDepth++;        (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);    }}
开发者ID:kame,项目名称:kame,代码行数:43,


示例14: AcpiOsAllocateZeroed

void *AcpiOsAllocateZeroed (    ACPI_SIZE               Size){    void                    *Allocation;    ACPI_FUNCTION_ENTRY ();    Allocation = AcpiOsAllocate (Size);    if (Allocation)    {        /* Clear the memory block */        ACPI_MEMSET (Allocation, 0, Size);    }    return (Allocation);}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:20,


示例15: acpi_ns_initialize_objects

acpi_status acpi_ns_initialize_objects(void){	acpi_status status;	struct acpi_init_walk_info info;	ACPI_FUNCTION_TRACE(ns_initialize_objects);	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "**** Starting initialization of namespace objects ****/n"));	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,			      "Completing Region/Field/Buffer/Package initialization:"));		ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info));		status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,				     ACPI_UINT32_MAX, acpi_ns_init_one_object, NULL,				     &info, NULL);	if (ACPI_FAILURE(status)) {		ACPI_EXCEPTION((AE_INFO, status, "During WalkNamespace"));	}	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,			      "/nInitialized %u/%u Regions %u/%u Fields %u/%u "			      "Buffers %u/%u Packages (%u nodes)/n",			      info.op_region_init, info.op_region_count,			      info.field_init, info.field_count,			      info.buffer_init, info.buffer_count,			      info.package_init, info.package_count,			      info.object_count));	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "%u Control Methods found/n", info.method_count));	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "%u Op Regions found/n", info.op_region_count));	return_ACPI_STATUS(AE_OK);}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:41,


示例16: acpi_ns_initialize_objects

acpi_status acpi_ns_initialize_objects(void){	acpi_status status;	struct acpi_init_walk_info info;	ACPI_FUNCTION_TRACE("ns_initialize_objects");	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "**** Starting initialization of namespace objects ****/n"));	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,			      "Completing Region/Field/Buffer/Package initialization:"));	/* Set all init info to zero */	ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info));	/* Walk entire namespace from the supplied root */	status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,				     ACPI_UINT32_MAX, acpi_ns_init_one_object,				     &info, NULL);	if (ACPI_FAILURE(status)) {		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed! %s/n",				  acpi_format_exception(status)));	}	ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,			      "/nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd Buffers %hd/%hd Packages (%hd nodes)/n",			      info.op_region_init, info.op_region_count,			      info.field_init, info.field_count,			      info.buffer_init, info.buffer_count,			      info.package_init, info.package_count,			      info.object_count));	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "%hd Control Methods found/n", info.method_count));	ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,			  "%hd Op Regions found/n", info.op_region_count));	return_ACPI_STATUS(AE_OK);}
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:41,


示例17: acpi_ut_release_to_cache

voidacpi_ut_release_to_cache (	u32                             list_id,	void                            *object){	struct acpi_memory_list         *cache_info;	ACPI_FUNCTION_ENTRY ();	/* If walk cache is full, just free this wallkstate object */	cache_info = &acpi_gbl_memory_lists[list_id];	if (cache_info->cache_depth >= cache_info->max_cache_depth) {		ACPI_MEM_FREE (object);		ACPI_MEM_TRACKING (cache_info->total_freed++);	}	/* Otherwise put this object back into the cache */	else {		if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) {			return;		}		/* Mark the object as cached */		ACPI_MEMSET (object, 0xCA, cache_info->object_size);		ACPI_SET_DESCRIPTOR_TYPE (object, ACPI_DESC_TYPE_CACHED);		/* Put the object at the head of the cache list */		* (ACPI_CAST_INDIRECT_PTR (char, &(((char *) object)[cache_info->link_offset]))) = cache_info->list_head;		cache_info->list_head = object;		cache_info->cache_depth++;		(void) acpi_ut_release_mutex (ACPI_MTX_CACHES);	}}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:40,


示例18: acpi_tb_create_local_fadt

void __init acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length){	/*	 * Check if the FADT is larger than the largest table that we expect	 * (the ACPI 5.0 version). If so, truncate the table, and issue	 * a warning.	 */	if (length > sizeof(struct acpi_table_fadt)) {		ACPI_WARNING((AE_INFO,			      "FADT (revision %u) is longer than ACPI 5.0 version,"			      " truncating length %u to %zu",			      table->revision, (unsigned)length,			      sizeof(struct acpi_table_fadt)));	}	/* Clear the entire local FADT */	ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));	/* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */	ACPI_MEMCPY(&acpi_gbl_FADT, table,		    ACPI_MIN(length, sizeof(struct acpi_table_fadt)));	/* Take a copy of the Hardware Reduced flag */	acpi_gbl_reduced_hardware = FALSE;	if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) {		acpi_gbl_reduced_hardware = TRUE;	}	/*	 * 1) Convert the local copy of the FADT to the common internal format	 * 2) Validate some of the important values within the FADT	 */	acpi_tb_convert_fadt();	acpi_tb_validate_fadt();}
开发者ID:0day-ci,项目名称:xen,代码行数:39,


示例19: AcpiUtCreateList

ACPI_STATUSAcpiUtCreateList (    char                    *ListName,    UINT16                  ObjectSize,    ACPI_MEMORY_LIST        **ReturnCache){    ACPI_MEMORY_LIST        *Cache;    Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));    if (!Cache)    {        return (AE_NO_MEMORY);    }    ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST));    Cache->ListName   = ListName;    Cache->ObjectSize = ObjectSize;    *ReturnCache = Cache;    return (AE_OK);}
开发者ID:luciang,项目名称:haiku,代码行数:23,


示例20: AcpiUtAllocateZeroed

void *AcpiUtAllocateZeroed (    ACPI_SIZE               Size,    UINT32                  Component,    const char              *Module,    UINT32                  Line){    void                    *Allocation;    ACPI_FUNCTION_ENTRY ();    Allocation = AcpiUtAllocate (Size, Component, Module, Line);    if (Allocation)    {        /* Clear the memory block */        ACPI_MEMSET (Allocation, 0, Size);    }    return (Allocation);}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:23,


示例21: AcpiOsCreateCache

ACPI_STATUSAcpiOsCreateCache (    char                    *CacheName,    UINT16                  ObjectSize,    UINT16                  MaxDepth,    ACPI_MEMORY_LIST        **ReturnCache){    ACPI_MEMORY_LIST        *Cache;    ACPI_FUNCTION_ENTRY ();    if (!CacheName || !ReturnCache || (ObjectSize < 16))    {        return (AE_BAD_PARAMETER);    }    /* Create the cache object */    Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));    if (!Cache)    {        return (AE_NO_MEMORY);    }    /* Populate the cache object and return it */    ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST));    Cache->LinkOffset = 8;    Cache->ListName   = CacheName;    Cache->ObjectSize = ObjectSize;    Cache->MaxDepth   = MaxDepth;    *ReturnCache = Cache;    return (AE_OK);}
开发者ID:CoryXie,项目名称:BarrelfishOS,代码行数:37,


示例22: acpi_load_table

/******************************************************************************* * * FUNCTION:    acpi_load_table * * PARAMETERS:  table_ptr       - pointer to a buffer containing the entire *                                table to be loaded * * RETURN:      Status * * DESCRIPTION: This function is called to load a table from the caller's *              buffer. The buffer must contain an entire ACPI Table including *              a valid header. The header fields will be verified, and if it *              is determined that the table is invalid, the call will fail. * ******************************************************************************/acpi_status acpi_load_table(struct acpi_table_header *table_ptr){	acpi_status status;	u32 table_index;	struct acpi_table_desc table_desc;	if (!table_ptr)		return AE_BAD_PARAMETER;	ACPI_MEMSET(&table_desc, 0, sizeof(struct acpi_table_desc));	table_desc.pointer = table_ptr;	table_desc.length = table_ptr->length;	table_desc.flags = ACPI_TABLE_ORIGIN_UNKNOWN;	/*	 * Install the new table into the local data structures	 */	status = acpi_tb_add_table(&table_desc, &table_index);	if (ACPI_FAILURE(status)) {		return status;	}	status = acpi_ns_load_table(table_index, acpi_gbl_root_node);	return status;}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:39,


示例23: acpi_tb_create_local_fadt

void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length){	/*	 * Check if the FADT is larger than the largest table that we expect	 * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue	 * a warning.	 */	if (length > sizeof(struct acpi_table_fadt)) {		ACPI_WARNING((AE_INFO,			      "FADT (revision %u) is longer than ACPI 2.0 version, "			      "truncating length %u to %u",			      table->revision, length,			      (u32)sizeof(struct acpi_table_fadt)));	}	/* Clear the entire local FADT */	ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt));	/* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */	ACPI_MEMCPY(&acpi_gbl_FADT, table,		    ACPI_MIN(length, sizeof(struct acpi_table_fadt)));	/* Convert the local copy of the FADT to the common internal format */	acpi_tb_convert_fadt();	/* Validate FADT values now, before we make any changes */	acpi_tb_validate_fadt();	/* Initialize the global ACPI register structures */	acpi_tb_setup_fadt_registers();}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:36,


示例24: AcpiDbCreateExecutionThreads

voidAcpiDbCreateExecutionThreads (    char                    *NumThreadsArg,    char                    *NumLoopsArg,    char                    *MethodNameArg){    ACPI_STATUS             Status;    UINT32                  NumThreads;    UINT32                  NumLoops;    UINT32                  i;    UINT32                  Size;    ACPI_MUTEX              MainThreadGate;    ACPI_MUTEX              ThreadCompleteGate;    ACPI_MUTEX              InfoGate;    /* Get the arguments */    NumThreads = ACPI_STRTOUL (NumThreadsArg, NULL, 0);    NumLoops   = ACPI_STRTOUL (NumLoopsArg, NULL, 0);    if (!NumThreads || !NumLoops)    {        AcpiOsPrintf ("Bad argument: Threads %X, Loops %X/n",            NumThreads, NumLoops);        return;    }    /*     * Create the semaphore for synchronization of     * the created threads with the main thread.     */    Status = AcpiOsCreateSemaphore (1, 0, &MainThreadGate);    if (ACPI_FAILURE (Status))    {        AcpiOsPrintf ("Could not create semaphore for synchronization with the main thread, %s/n",            AcpiFormatException (Status));        return;    }    /*     * Create the semaphore for synchronization     * between the created threads.     */    Status = AcpiOsCreateSemaphore (1, 1, &ThreadCompleteGate);    if (ACPI_FAILURE (Status))    {        AcpiOsPrintf ("Could not create semaphore for synchronization between the created threads, %s/n",            AcpiFormatException (Status));        (void) AcpiOsDeleteSemaphore (MainThreadGate);        return;    }    Status = AcpiOsCreateSemaphore (1, 1, &InfoGate);    if (ACPI_FAILURE (Status))    {        AcpiOsPrintf ("Could not create semaphore for synchronization of AcpiGbl_DbMethodInfo, %s/n",            AcpiFormatException (Status));        (void) AcpiOsDeleteSemaphore (ThreadCompleteGate);        (void) AcpiOsDeleteSemaphore (MainThreadGate);        return;    }    ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO));    /* Array to store IDs of threads */    AcpiGbl_DbMethodInfo.NumThreads = NumThreads;    Size = sizeof (ACPI_THREAD_ID) * AcpiGbl_DbMethodInfo.NumThreads;    AcpiGbl_DbMethodInfo.Threads = AcpiOsAllocate (Size);    if (AcpiGbl_DbMethodInfo.Threads == NULL)    {        AcpiOsPrintf ("No memory for thread IDs array/n");        (void) AcpiOsDeleteSemaphore (MainThreadGate);        (void) AcpiOsDeleteSemaphore (ThreadCompleteGate);        (void) AcpiOsDeleteSemaphore (InfoGate);        return;    }    ACPI_MEMSET (AcpiGbl_DbMethodInfo.Threads, 0, Size);    /* Setup the context to be passed to each thread */    AcpiGbl_DbMethodInfo.Name = MethodNameArg;    AcpiGbl_DbMethodInfo.Flags = 0;    AcpiGbl_DbMethodInfo.NumLoops = NumLoops;    AcpiGbl_DbMethodInfo.MainThreadGate = MainThreadGate;    AcpiGbl_DbMethodInfo.ThreadCompleteGate = ThreadCompleteGate;    AcpiGbl_DbMethodInfo.InfoGate = InfoGate;    /* Init arguments to be passed to method */    AcpiGbl_DbMethodInfo.InitArgs = 1;    AcpiGbl_DbMethodInfo.Args = AcpiGbl_DbMethodInfo.Arguments;    AcpiGbl_DbMethodInfo.Arguments[0] = AcpiGbl_DbMethodInfo.NumThreadsStr;    AcpiGbl_DbMethodInfo.Arguments[1] = AcpiGbl_DbMethodInfo.IdOfThreadStr;    AcpiGbl_DbMethodInfo.Arguments[2] = AcpiGbl_DbMethodInfo.IndexOfThreadStr;    AcpiGbl_DbMethodInfo.Arguments[3] = NULL;    AcpiGbl_DbMethodInfo.Types = AcpiGbl_DbMethodInfo.ArgTypes;    AcpiGbl_DbMethodInfo.ArgTypes[0] = ACPI_TYPE_INTEGER;//.........这里部分代码省略.........
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,


示例25: AcpiDbExecute

voidAcpiDbExecute (    char                    *Name,    char                    **Args,    ACPI_OBJECT_TYPE        *Types,    UINT32                  Flags){    ACPI_STATUS             Status;    ACPI_BUFFER             ReturnObj;    char                    *NameString;#ifdef ACPI_DEBUG_OUTPUT    UINT32                  PreviousAllocations;    UINT32                  Allocations;    /* Memory allocation tracking */    PreviousAllocations = AcpiDbGetOutstandingAllocations ();#endif    if (*Name == '*')    {        (void) AcpiWalkNamespace (ACPI_TYPE_METHOD, ACPI_ROOT_OBJECT,                    ACPI_UINT32_MAX, AcpiDbExecutionWalk, NULL, NULL, NULL);        return;    }    else    {        NameString = ACPI_ALLOCATE (ACPI_STRLEN (Name) + 1);        if (!NameString)        {            return;        }        ACPI_MEMSET (&AcpiGbl_DbMethodInfo, 0, sizeof (ACPI_DB_METHOD_INFO));        ACPI_STRCPY (NameString, Name);        AcpiUtStrupr (NameString);        AcpiGbl_DbMethodInfo.Name = NameString;        AcpiGbl_DbMethodInfo.Args = Args;        AcpiGbl_DbMethodInfo.Types = Types;        AcpiGbl_DbMethodInfo.Flags = Flags;        ReturnObj.Pointer = NULL;        ReturnObj.Length = ACPI_ALLOCATE_BUFFER;        Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo);        if (ACPI_FAILURE (Status))        {            ACPI_FREE (NameString);            return;        }        /* Get the NS node, determines existence also */        Status = AcpiGetHandle (NULL, AcpiGbl_DbMethodInfo.Pathname,            &AcpiGbl_DbMethodInfo.Method);        if (ACPI_SUCCESS (Status))        {            Status = AcpiDbExecuteMethod (&AcpiGbl_DbMethodInfo, &ReturnObj);        }        ACPI_FREE (NameString);    }    /*     * Allow any handlers in separate threads to complete.     * (Such as Notify handlers invoked from AML executed above).     */    AcpiOsSleep ((UINT64) 10);#ifdef ACPI_DEBUG_OUTPUT    /* Memory allocation tracking */    Allocations = AcpiDbGetOutstandingAllocations () - PreviousAllocations;    AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);    if (Allocations > 0)    {        AcpiOsPrintf ("0x%X Outstanding allocations after evaluation of %s/n",                        Allocations, AcpiGbl_DbMethodInfo.Pathname);    }#endif    if (ACPI_FAILURE (Status))    {        AcpiOsPrintf ("Evaluation of %s failed with status %s/n",            AcpiGbl_DbMethodInfo.Pathname, AcpiFormatException (Status));    }    else    {        /* Display a return object, if any */        if (ReturnObj.Length)        {            AcpiOsPrintf (                "Evaluation of %s returned object %p, external buffer length %X/n",//.........这里部分代码省略.........
开发者ID:Lxg1582,项目名称:freebsd,代码行数:101,


示例26: AcpiNsInitOneDevice

//.........这里部分代码省略.........    {        WalkInfo->Num_STA++;    }    /*     * Examine the PRESENT and FUNCTIONING status bits     *     * Note: ACPI spec does not seem to specify behavior for the present but     * not functioning case, so we assume functioning if present.     */    if (!(Flags & ACPI_STA_DEVICE_PRESENT))    {        /* Device is not present, we must examine the Functioning bit */        if (Flags & ACPI_STA_DEVICE_FUNCTIONING)        {            /*             * Device is not present but is "functioning". In this case,             * we will not run _INI, but we continue to examine the children             * of this device.             *             * From the ACPI spec, description of _STA: (Note - no mention             * of whether to run _INI or not on the device in question)             *             * "_STA may return bit 0 clear (not present) with bit 3 set             * (device is functional). This case is used to indicate a valid             * device for which no device driver should be loaded (for example,             * a bridge device.) Children of this device may be present and             * valid. OSPM should continue enumeration below a device whose             * _STA returns this bit combination"             */            return_ACPI_STATUS (AE_OK);        }        else        {            /*             * Device is not present and is not functioning. We must abort the             * walk of this subtree immediately -- don't look at the children             * of such a device.             *             * From the ACPI spec, description of _INI:             *             * "If the _STA method indicates that the device is not present,             * OSPM will not run the _INI and will not examine the children             * of the device for _INI methods"             */            return_ACPI_STATUS (AE_CTRL_DEPTH);        }    }    /*     * The device is present or is assumed present if no _STA exists.     * Run the _INI if it exists (not required to exist)     *     * Note: We know there is an _INI within this subtree, but it may not be     * under this particular device, it may be lower in the branch.     */    ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (        ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI));    ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));    Info->PrefixNode = DeviceNode;    Info->RelativePathname = METHOD_NAME__INI;    Info->Parameters = NULL;    Info->Flags = ACPI_IGNORE_RETURN_VALUE;    Status = AcpiNsEvaluate (Info);    if (ACPI_SUCCESS (Status))    {        WalkInfo->Num_INI++;    }#ifdef ACPI_DEBUG_OUTPUT    else if (Status != AE_NOT_FOUND)    {        /* Ignore error and move on to next device */        char *ScopeName = AcpiNsGetExternalPathname (Info->Node);        ACPI_EXCEPTION ((AE_INFO, Status, "during %s._INI execution",            ScopeName));        ACPI_FREE (ScopeName);    }#endif    /* Ignore errors from above */    Status = AE_OK;    /*     * The _INI method has been run if present; call the Global Initialization     * Handler for this device.     */    if (AcpiGbl_InitHandler)    {        Status = AcpiGbl_InitHandler (DeviceNode, ACPI_INIT_DEVICE_INI);    }    return_ACPI_STATUS (Status);}
开发者ID:CSharpLover,项目名称:MosquitOS,代码行数:101,


示例27: AcpiExStoreBufferToBuffer

ACPI_STATUSAcpiExStoreBufferToBuffer (    ACPI_OPERAND_OBJECT     *SourceDesc,    ACPI_OPERAND_OBJECT     *TargetDesc){    UINT32                  Length;    UINT8                   *Buffer;    ACPI_FUNCTION_TRACE_PTR (ExStoreBufferToBuffer, SourceDesc);    /* If Source and Target are the same, just return */    if (SourceDesc == TargetDesc)    {        return_ACPI_STATUS (AE_OK);    }    /* We know that SourceDesc is a buffer by now */    Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->Buffer.Pointer);    Length = SourceDesc->Buffer.Length;    /*     * If target is a buffer of length zero or is a static buffer,     * allocate a new buffer of the proper length     */    if ((TargetDesc->Buffer.Length == 0) ||        (TargetDesc->Common.Flags & AOPOBJ_STATIC_POINTER))    {        TargetDesc->Buffer.Pointer = ACPI_ALLOCATE (Length);        if (!TargetDesc->Buffer.Pointer)        {            return_ACPI_STATUS (AE_NO_MEMORY);        }        TargetDesc->Buffer.Length = Length;    }    /* Copy source buffer to target buffer */    if (Length <= TargetDesc->Buffer.Length)    {        /* Clear existing buffer and copy in the new one */        ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);        ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length);#ifdef ACPI_OBSOLETE_BEHAVIOR        /*         * NOTE: ACPI versions up to 3.0 specified that the buffer must be         * truncated if the string is smaller than the buffer.  However, "other"         * implementations of ACPI never did this and thus became the defacto         * standard. ACPI 3.0A changes this behavior such that the buffer         * is no longer truncated.         */        /*         * OBSOLETE BEHAVIOR:         * If the original source was a string, we must truncate the buffer,         * according to the ACPI spec.  Integer-to-Buffer and Buffer-to-Buffer         * copy must not truncate the original buffer.         */        if (OriginalSrcType == ACPI_TYPE_STRING)        {            /* Set the new length of the target */            TargetDesc->Buffer.Length = Length;        }#endif    }    else    {        /* Truncate the source, copy only what will fit */        ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer,            TargetDesc->Buffer.Length);        ACPI_DEBUG_PRINT ((ACPI_DB_INFO,            "Truncating source buffer from %X to %X/n",            Length, TargetDesc->Buffer.Length));    }    /* Copy flags */    TargetDesc->Buffer.Flags = SourceDesc->Buffer.Flags;    TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER;    return_ACPI_STATUS (AE_OK);}
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:90,


示例28: AcpiExStoreStringToString

ACPI_STATUSAcpiExStoreStringToString (    ACPI_OPERAND_OBJECT     *SourceDesc,    ACPI_OPERAND_OBJECT     *TargetDesc){    UINT32                  Length;    UINT8                   *Buffer;    ACPI_FUNCTION_TRACE_PTR (ExStoreStringToString, SourceDesc);    /* If Source and Target are the same, just return */    if (SourceDesc == TargetDesc)    {        return_ACPI_STATUS (AE_OK);    }    /* We know that SourceDesc is a string by now */    Buffer = ACPI_CAST_PTR (UINT8, SourceDesc->String.Pointer);    Length = SourceDesc->String.Length;    /*     * Replace existing string value if it will fit and the string     * pointer is not a static pointer (part of an ACPI table)     */    if ((Length < TargetDesc->String.Length) &&       (!(TargetDesc->Common.Flags & AOPOBJ_STATIC_POINTER)))    {        /*         * String will fit in existing non-static buffer.         * Clear old string and copy in the new one         */        ACPI_MEMSET (TargetDesc->String.Pointer, 0,            (ACPI_SIZE) TargetDesc->String.Length + 1);        ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length);    }    else    {        /*         * Free the current buffer, then allocate a new buffer         * large enough to hold the value         */        if (TargetDesc->String.Pointer &&           (!(TargetDesc->Common.Flags & AOPOBJ_STATIC_POINTER)))        {            /* Only free if not a pointer into the DSDT */            ACPI_FREE (TargetDesc->String.Pointer);        }        TargetDesc->String.Pointer = ACPI_ALLOCATE_ZEROED (                                        (ACPI_SIZE) Length + 1);        if (!TargetDesc->String.Pointer)        {            return_ACPI_STATUS (AE_NO_MEMORY);        }        TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER;        ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length);    }    /* Set the new target length */    TargetDesc->String.Length = Length;    return_ACPI_STATUS (AE_OK);}
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:69,


示例29: AcpiUtInitializeBuffer

ACPI_STATUSAcpiUtInitializeBuffer (    ACPI_BUFFER             *Buffer,    ACPI_SIZE               RequiredLength){    ACPI_SIZE               InputBufferLength;    /* Parameter validation */    if (!Buffer || !RequiredLength)    {        return (AE_BAD_PARAMETER);    }    /*     * Buffer->Length is used as both an input and output parameter. Get the     * input actual length and set the output required buffer length.     */    InputBufferLength = Buffer->Length;    Buffer->Length = RequiredLength;    /*     * The input buffer length contains the actual buffer length, or the type     * of buffer to be allocated by this routine.     */    switch (InputBufferLength)    {    case ACPI_NO_BUFFER:        /* Return the exception (and the required buffer length) */        return (AE_BUFFER_OVERFLOW);    case ACPI_ALLOCATE_BUFFER:        /*         * Allocate a new buffer. We directectly call AcpiOsAllocate here to         * purposefully bypass the (optionally enabled) internal allocation         * tracking mechanism since we only want to track internal         * allocations. Note: The caller should use AcpiOsFree to free this         * buffer created via ACPI_ALLOCATE_BUFFER.         */        Buffer->Pointer = AcpiOsAllocate (RequiredLength);        break;    case ACPI_ALLOCATE_LOCAL_BUFFER:        /* Allocate a new buffer with local interface to allow tracking */        Buffer->Pointer = ACPI_ALLOCATE (RequiredLength);        break;    default:        /* Existing buffer: Validate the size of the buffer */        if (InputBufferLength < RequiredLength)        {            return (AE_BUFFER_OVERFLOW);        }        break;    }    /* Validate allocation from above or input buffer pointer */    if (!Buffer->Pointer)    {        return (AE_NO_MEMORY);    }    /* Have a valid buffer, clear it */    ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength);    return (AE_OK);}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:75,



注:本文中的ACPI_MEMSET函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ACPI_MEM_FREE函数代码示例
C++ ACPI_MEMCPY函数代码示例
51自学网自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1