nvram_device 구조체 참조

nvram_device 구조체 참조

#include < nvram.h >

데이터 필드

구조체 hw_device_t 흔한
nvram_result_t (* get_total_size_in_bytes )(const struct nvram_device *device, uint64_t *total_size)
nvram_result_t (* get_available_size_in_bytes )(const struct nvram_device *device, uint64_t *available_size)
nvram_result_t (* get_max_space_size_in_bytes )(const struct nvram_device *device, uint64_t *max_space_size)
nvram_result_t (* get_max_spaces )(const struct nvram_device *device, uint32_t *num_spaces)
nvram_result_t (* get_space_list )(const struct nvram_device *device, uint32_t max_list_size, uint32_t *space_index_list, uint32_t *list_size)
nvram_result_t (* get_space_size )(const struct nvram_device *device, uint32_t 인덱스, uint64_t *size)
nvram_result_t (* get_space_controls )(const struct nvram_device *device, uint32_t index, uint32_t max_list_size, nvram_control_t *control_list, uint32_t *list_size)
nvram_result_t (* is_space_locked )(const struct nvram_device *device, uint32_t index, int *write_lock_enabled, int *read_lock_enabled)
nvram_result_t (* create_space )(const struct nvram_device *device, uint32_t index, uint64_t size_in_bytes, const nvram_control_t *control_list, uint32_t list_size, const uint8_t *authorization_value, uint32_t Authorization_value_size)
nvram_result_t (* delete_space )(const struct nvram_device *device, uint32_t index, const uint8_t *authorization_value, uint32_t Authorization_value_size)
nvram_result_t (* 비활성화_create )(const struct nvram_device *device)
nvram_result_t (* write_space )(const struct nvram_device *device, uint32_t index, const uint8_t *buffer, uint64_t buffer_size, const uint8_t *authorization_value, uint32_t Authorization_value_size)
nvram_result_t (* read_space )(const struct nvram_device *device, uint32_t index, uint64_t num_bytes_to_read, const uint8_t *authorization_value, uint32_t Authorization_value_size, uint8_t *buffer, uint64_t *bytes_read)
nvram_result_t (* 활성화_write_lock )(const struct nvram_device *device, uint32_t index, const uint8_t *authorization_value, uint32_t Authorization_value_size)
nvram_result_t (* 활성화_read_lock )(const struct nvram_device *device, uint32_t index, const uint8_t *authorization_value, uint32_t Authorization_value_size)

상세 설명

nvram.h 파일의 48 번째 줄에 정의되어 있습니다.

현장 문서

구조체 hw_device_t 공통

nvram_device 의 일반적인 방법. 이 구조의 사용자는 hw_device_t가 nvram_device를 참조하는 것으로 알려진 컨텍스트에서 hw_device_tnvram_device 포인터로 캐스팅하므로 이는 nvram_device 의 첫 번째 멤버 여야 합니다.

nvram.h 파일의 55번째 줄에 정의되어 있습니다.

nvram_result_t (* create_space)(const struct nvram_device *device, uint32_t index, uint64_t size_in_bytes, const nvram_control_t *control_list, uint32_t list_size, const uint8_t *authorization_value, uint32_t Authorization_value_size)

주어진 인덱스, 크기, 컨트롤, 권한 부여 값을 사용하여 새 공간을 만듭니다.

device - nvram_device 인스턴스입니다. index - 새 공간의 인덱스입니다. 인덱스는 32비트 값일 수 있지만 이미 기존 공간에 할당되어서는 안 됩니다. size_in_bytes - 공간에 할당할 바이트 수입니다. control_list - 공간에 적용할 컨트롤의 배열입니다. list_size - |control_list|에 있는 항목 수입니다. Authorization_value - |control_list|인 경우 NV_CONTROL_READ_AUTHORIZATION 및/또는 NV_Control_WRITE_AUTHORIZATION을 포함하는 경우 이 매개변수는 이러한 정책에 대한 인증 값을 제공합니다(두 제어가 모두 설정된 경우 이 값은 둘 다에 적용됩니다). 그렇지 않으면 이 값은 무시되고 NULL이 될 수 있습니다. Authorization_value_size - |authorization_value|의 바이트 수입니다.

nvram.h 파일의 187번째 줄에 정의되어 있습니다.

nvram_result_t (* delete_space)(const struct nvram_device *device, uint32_t index, const uint8_t *authorization_value, uint32_t Authorization_value_size)

공간을 삭제합니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. 승인_값 - 공간에 NV_Control_WRITE_AUTHORIZATION 정책이 있는 경우 이 매개변수는 승인 값을 제공합니다. 그렇지 않으면 이 값은 무시되고 NULL이 될 수 있습니다. Authorization_value_size - |authorization_value|의 바이트 수입니다.

nvram.h 파일의 207번째 줄에 정의되어 있습니다.

nvram_result_t (* 비활성화_create)(const struct nvram_device *device)

다음 전체 장치 재설정(재부팅이 아닌 공장 재설정에서와 같이)까지 추가 공간 생성을 비활성화합니다. NV_CreateSpace에 대한 후속 호출은 NV_RESULT_OPERATION_DISABLED를 반환해야 합니다.

device - nvram_device 인스턴스입니다.

nvram.h 파일의 219번째 줄에 정의되어 있습니다.

nvram_result_t (* 활성화_read_lock)(const struct nvram_device *device, uint32_t index, const uint8_t *authorization_value, uint32_t Authorization_value_size)

해당 정책에 따라 지정된 공간에 대한 읽기 잠금을 활성화합니다. 공간에 NV_Control_BOOT_READ_LOCK이 설정되어 있지 않으면 이 함수는 아무런 효과가 없으며 오류를 반환할 수 있습니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. 승인_값 - 공간에 NV_Control_READ_AUTHORIZATION 정책이 있는 경우 이 매개변수는 승인 값을 제공합니다. (읽기 잠금을 위해 쓰기 액세스에 대한 요구 사항은 없습니다. 읽기 잠금은 항상 일시적입니다.) 그렇지 않으면 이 값은 무시되고 NULL이 될 수 있습니다. Authorization_value_size - |authorization_value|의 바이트 수입니다.

nvram.h 파일의 317번째 줄에 정의되어 있습니다.

nvram_result_t (* 활성화_write_lock)(const struct nvram_device *device, uint32_t index, const uint8_t *authorization_value, uint32_t Authorization_value_size)

해당 정책에 따라 지정된 공간에 대한 쓰기 잠금을 활성화합니다. 공간에 NV_CONTROL_PERSISTENT_WRITE_LOCK 또는 NV_Control_BOOT_WRITE_LOCK이 설정되어 있지 않으면 이 함수는 아무런 효과가 없으며 오류를 반환할 수 있습니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. 승인_값 - 공간에 NV_Control_WRITE_AUTHORIZATION 정책이 있는 경우 이 매개변수는 승인 값을 제공합니다. 그렇지 않으면 이 값은 무시되고 NULL이 될 수 있습니다. Authorization_value_size - |authorization_value|의 바이트 수입니다.

nvram.h 파일의 294번째 줄에 정의되어 있습니다.

nvram_result_t (* get_available_size_in_bytes)(const struct nvram_device *device, uint64_t *available_size)

NVRAM에서 사용 가능한 할당되지 않은 바이트 수를 출력합니다. 구현이 사용 가능한 크기를 모르는 경우 추정치 또는 전체 크기를 제공할 수 있습니다.

device - nvram_device 인스턴스입니다. available_size - 출력을 수신합니다. NULL일 수 없습니다.

nvram.h 파일의 76 번째 줄에 정의되어 있습니다.

nvram_result_t (* get_max_space_size_in_bytes)(const struct nvram_device *device, uint64_t *max_space_size)

단일 공간에 할당할 수 있는 최대 바이트 수를 출력합니다. 이는 항상 최소 32입니다. 구현이 최대 크기를 제한하지 않는 경우 전체 크기를 제공할 수 있습니다.

device - nvram_device 인스턴스입니다. max_space_size - 출력을 수신합니다. NULL일 수 없습니다.

nvram.h 파일의 87 번째 줄에 정의되어 있습니다.

nvram_result_t (* get_max_spaces)(const struct nvram_device *device, uint32_t *num_spaces)

할당할 수 있는 최대 총 공간 수를 출력합니다. 이는 항상 최소 8입니다. 공백이 지원되는 경우 NV_UNLIMITED_SPACES를 출력합니다(사용 가능한 NVRAM 바이트로만 제한됨).

device - nvram_device 인스턴스입니다. num_spaces - 출력을 받습니다. NULL일 수 없습니다.

nvram.h 파일의 99 번째 줄에 정의되어 있습니다.

nvram_result_t (* get_space_controls)(const struct nvram_device *device, uint32_t index, uint32_t max_list_size, nvram_control_t *control_list, uint32_t *list_size)

지정된 공간과 연관된 컨트롤 목록을 출력합니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. max_list_size - |control_list|의 항목 수 정렬. control_list - 주어진 |max_list_size|까지 컨트롤 목록을 받습니다. |max_list_size|인 경우 NULL일 수 있습니다. 0입니다. list_size - |control_list|에 채워진 항목 수 또는 |control_list|인 경우 사용 가능한 항목 수를 받습니다. NULL입니다.

nvram.h 파일의 144번째 줄에 정의되어 있습니다.

nvram_result_t (* get_space_list)(const struct nvram_device *device, uint32_t max_list_size, uint32_t *space_index_list, uint32_t *list_size)

생성된 공간 인덱스 목록을 출력합니다. 만약 |max_list_size| 0입니다. |list_size|만 채워져 있습니다.

device - nvram_device 인스턴스입니다. max_list_size - |space_index_list|에 있는 항목 수 정렬. space_index_list - 주어진 |max_list_size|까지 생성된 공간의 목록을 받습니다. |max_list_size|인 경우 NULL일 수 있습니다. 0입니다. list_size - |space_index_list|에 채워진 항목 수 또는 |space_index_list|인 경우 사용 가능한 항목 수를 받습니다. NULL입니다.

nvram.h 파일의 116 번째 줄에 정의되어 있습니다.

nvram_result_t (* get_space_size)(const struct nvram_device *device, uint32_t index, uint64_t *size)

주어진 공간의 크기(바이트)를 출력합니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. size - 출력을 받습니다. NULL일 수 없습니다.

nvram.h 파일의 128 번째 줄에 정의되어 있습니다.

nvram_result_t (* get_total_size_in_bytes)(const struct nvram_device *device, uint64_t *total_size)

NVRAM에서 사용 가능한 총 바이트 수를 출력합니다. 이는 항상 최소 2048입니다. 구현이 전체 크기를 모르는 경우 추정치 또는 2048을 제공할 수 있습니다.

device - nvram_device 인스턴스입니다. total_size - 출력을 받습니다. NULL일 수 없습니다.

nvram.h 파일의 65번째 줄에 정의되어 있습니다.

nvram_result_t (* is_space_locked)(const struct nvram_device *device, uint32_t index, int *write_lock_enabled, int *read_lock_enabled)

지정된 공간에 대해 잠금이 활성화되어 있는지 여부를 출력합니다. 잠금이 활성화되면 작업이 비활성화되고 해당 작업을 수행하려고 시도하면 NV_RESULT_OPERATION_DISABLED가 발생합니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. write_lock_enabled - 쓰기 작업이 현재 비활성화된 경우 0이 아닌 값으로 설정됩니다. read_lock_enabled - 읽기 작업이 현재 비활성화된 경우 0이 아닌 값으로 설정됩니다.

nvram.h 파일의 161 번째 줄에 정의되어 있습니다.

nvram_result_t (* read_space)(const struct nvram_device *device, uint32_t index, uint64_t num_bytes_to_read, const uint8_t *authorization_value, uint32_t Authorization_value_size, uint8_t *buffer, uint64_t *bytes_read)

공간의 내용을 읽습니다. 공간이 쓰여진 적이 없다면 읽은 모든 바이트는 0x00이 됩니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. num_bytes_to_read - 읽을 바이트 수입니다. |버퍼| 이 바이트 수를 수용할 수 있을 만큼 커야 합니다. 공간 크기보다 크면 공간 전체를 읽습니다. 이것이 공간 크기보다 작으면 공간의 첫 번째 바이트를 읽습니다. 승인_값 - 공간에 NV_Control_READ_AUTHORIZATION 정책이 있는 경우 이 매개변수는 승인 값을 제공합니다. 그렇지 않으면 이 값은 무시되고 NULL이 될 수 있습니다. Authorization_value_size - |authorization_value|의 바이트 수입니다. buffer - 공간에서 읽은 데이터를 수신합니다. 최소한 |num_bytes_to_read|여야 합니다. 바이트 크기입니다. bytes_read - 읽은 바이트 수입니다. NV_RESULT_SUCCESS가 반환되면 |num_bytes_to_read|보다 작은 값으로 설정됩니다. 또는 공간의 크기.

nvram.h 파일의 272번째 줄에 정의되어 있습니다.

nvram_result_t (* write_space)(const struct nvram_device *device, uint32_t index, const uint8_t *buffer, uint64_t buffer_size, const uint8_t *authorization_value, uint32_t Authorization_value_size)

공간의 내용을 씁니다. 공간이 NV_CONTROL_WRITE_EXTEND로 구성된 경우 입력 데이터는 현재 데이터를 확장하는 데 사용됩니다.

device - nvram_device 인스턴스입니다. index - 공간 인덱스입니다. buffer - 쓸 데이터입니다. buffer_size - |buffer|의 바이트 수입니다. 공간 크기보다 작으면 나머지 바이트는 0x00으로 설정됩니다. 공간 크기보다 크면 NV_RESULT_INVALID_PARAMETER를 반환합니다. 승인_값 - 공간에 NV_Control_WRITE_AUTHORIZATION 정책이 있는 경우 이 매개변수는 승인 값을 제공합니다. 그렇지 않으면 이 값은 무시되고 NULL이 될 수 있습니다. Authorization_value_size - |authorization_value|의 바이트 수입니다.

nvram.h 파일의 241 번째 줄에 정의되어 있습니다.


이 구조체에 대한 문서는 다음 파일에서 생성되었습니다.
  • hardware/libhardware/include/hardware/ nvram.h