--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ AuthenticationInfo.c\r
+\r
+Abstract:\r
+\r
+ UEFI Authentication Info Protocol.\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+#include "EfiSpec.h"\r
+#include EFI_PROTOCOL_DEFINITION (AuthenticationInfo)\r
+\r
+EFI_GUID gEfiAuthenticationInfoProtocolGuid = EFI_AUTHENTICATION_INFO_PROTOCOL_GUID;\r
+\r
+EFI_GUID_STRING\r
+ (&gEfiAuthenticationInfoProtocolGuid, "Authentication Info Protocol", "UEFI 2.1 Authentication Info Protocol");\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ PlatformToDriverConfiguration.h\r
+\r
+Abstract:\r
+\r
+ UEFI Authentication Info Protocol.\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+#ifndef _EFI_AUTHENTICATION_INFO_H_\r
+#define _EFI_AUTHENTICATION_INFO_H_\r
+\r
+//\r
+// Global ID for the Authentication Info Protocol\r
+//\r
+#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \\r
+ { \\r
+ 0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7} \\r
+ }\r
+\r
+EFI_FORWARD_DECLARATION (EFI_AUTHENTICATION_INFO_PROTOCOL);\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET) (\r
+ IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
+ IN EFI_HANDLE *ControllerHandle,\r
+ OUT VOID *Buffer\r
+ );\r
+/*++\r
+\r
+ Routine Description:\r
+ Retrieves the Authentication information associated with a particular\r
+ controller handle.\r
+\r
+ Arguments:\r
+ This - Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL instance.\r
+ ControllerHandle - Handle to the Controller.\r
+ Buffer - Pointer to the authentication information. This function\r
+ is responsible for allocating the buffer and it is the\r
+ caller's responsibility to free buffer when the caller\r
+ is finished with buffer.\r
+\r
+ Returns:\r
+ EFI_SUCCESS - Successfully retrieved Authentication information\r
+ for the given ControllerHandle.\r
+ EFI_NOT_FOUND - No matching Authentication information found for the\r
+ given ControllerHandle.\r
+ EFI_DEVICE_ERROR - The Authentication information could not be retrieved\r
+ due to a hardware error.\r
+\r
+--*/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET) (\r
+ IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
+ IN EFI_HANDLE *ControllerHandle,\r
+ IN VOID *Buffer\r
+ );\r
+/*++\r
+\r
+ Routine Description:\r
+ Set the Authentication information for a given controller handle.\r
+\r
+ Arguments:\r
+ This - Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL instance.\r
+ ControllerHandle - Handle to the Controller.\r
+ Buffer - Pointer to the authentication information.\r
+\r
+ Returns:\r
+ EFI_SUCCESS - Successfully set the Authentication node information\r
+ for the given ControllerHandle.\r
+ EFI_UNSUPPORTED - If the platform policies do not allow setting of the\r
+ Authentication information.\r
+ EFI_DEVICE_ERROR - The authentication node information could not be configured\r
+ due to a hardware error.\r
+ EFI_OUT_OF_RESOURCES - Not enough storage is available to hold the data.\r
+\r
+--*/\r
+\r
+//\r
+// Interface structure for the Authentication Info Protocol\r
+//\r
+typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL {\r
+ EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;\r
+ EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;\r
+} EFI_AUTHENTICATION_INFO_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;\r
+\r
+#endif\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ DriverSupportedEfiVersion.c\r
+\r
+Abstract:\r
+\r
+ Driver Supported EFI Version Protocol\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+#include "EfiSpec.h"\r
+#include EFI_PROTOCOL_DEFINITION (DriverSupportedEfiVersion)\r
+\r
+EFI_GUID gEfiDriverSupportedEfiVersionProtocolGuid = EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL_GUID;\r
+\r
+EFI_GUID_STRING\r
+ (&gEfiDriverSupportedEfiVersionProtocolGuid, "Driver Supported EFI Version Protocol", "UEFI 2.1 Driver Supported EFI Version Protocol");\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ DriverSupportedEfiVersion.h\r
+\r
+Abstract:\r
+\r
+ Driver Supported EFI Version Protocol\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+#ifndef _EFI_DRIVER_SUPPORTED_EFI_VERSION_H_\r
+#define _EFI_DRIVER_SUPPORTED_EFI_VERSION_H_\r
+\r
+//\r
+// Global ID for the Driver Supported EFI Version Protocol\r
+//\r
+#define EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL_GUID \\r
+ { \\r
+ 0x5c198761, 0x16a8, 0x4e69, {0x97, 0x2c, 0x89, 0xd6, 0x79, 0x54, 0xf8, 0x1d} \\r
+ }\r
+\r
+EFI_FORWARD_DECLARATION (EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL);\r
+\r
+//\r
+// Interface structure for the Driver Supported EFI Version Protocol\r
+//\r
+typedef struct _EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL {\r
+ UINT32 Length;\r
+ UINT32 FirmwareVersion;\r
+} EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDriverSupportedEfiVersionProtocolGuid;\r
+\r
+#endif\r
AcpiTable/AcpiTable.c\r
Arp/Arp.h\r
Arp/Arp.c\r
+ AuthenticationInfo/AuthenticationInfo.h\r
+ AuthenticationInfo/AuthenticationInfo.c\r
Bis/Bis.h\r
Bis/Bis.c\r
BlockIo/BlockIo.h\r
DriverDiagnostics/DriverDiagnostics.c\r
DriverDiagnostics2/DriverDiagnostics2.h\r
DriverDiagnostics2/DriverDiagnostics2.c\r
+ DriverSupportedEfiVersion/DriverSupportedEfiVersion.h\r
+ DriverSupportedEfiVersion/DriverSupportedEfiVersion.c\r
Ebc/Ebc.h\r
Ebc/Ebc.c\r
EdidActive/EdidActive.h\r
Ip4Config/Ip4Config.c\r
LoadedImage/LoadedImage.h\r
LoadedImage/LoadedImage.c\r
+ LoadedImageDevicePath\LoadedImageDevicePath.h\r
+ LoadedImageDevicePath\LoadedImageDevicePath.c\r
LoadFile/LoadFile.h\r
LoadFile/LoadFile.c\r
ManagedNetwork/ManagedNetwork.h\r
PciRootBridgeIo/PciRootBridgeIo.c\r
PlatformDriverOverride/PlatformDriverOverride.h\r
PlatformDriverOverride/PlatformDriverOverride.c\r
+ PlatformToDriverConfiguration/PlatformToDriverConfiguration.h\r
+ PlatformToDriverConfiguration/PlatformToDriverConfiguration.c\r
PxeBaseCode/PxeBaseCode.h\r
PxeBaseCode/PxeBaseCode.c\r
PxeBaseCodeCallBack/PxeBaseCodeCallBack.h\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ LoadedImageDevicePath.c\r
+\r
+Abstract:\r
+\r
+ The Loaded Image Device Path Protocol as defined in UEFI 2.1.\r
+\r
+ When installed, the Loaded Image Device Path Protocol specifies the device\r
+ path that was used when a PE/COFF image was loaded through the EFI Boot\r
+ Service LoadImage().\r
+\r
+\r
+--*/\r
+\r
+#include "EfiSpec.h"\r
+#include EFI_PROTOCOL_DEFINITION (LoadedImageDevicePath)\r
+\r
+EFI_GUID gEfiLoadedImageDevicePathProtocolGuid = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;\r
+\r
+EFI_GUID_STRING(&gEfiLoadedImageDevicePathProtocolGuid, "Loaded Image Device Path Protocol", "UEFI 2.1 Loaded Image Device Path protocol");\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ LoadedImageDevicePath.h\r
+\r
+Abstract:\r
+\r
+ The Loaded Image Device Path Protocol as defined in UEFI 2.1.\r
+\r
+ When installed, the Loaded Image Device Path Protocol specifies the device\r
+ path that was used when a PE/COFF image was loaded through the EFI Boot\r
+ Service LoadImage().\r
+\r
+\r
+--*/\r
+\r
+#ifndef _LOADED_IMAGE_DEVICE_PATH_H_\r
+#define _LOADED_IMAGE_DEVICE_PATH_H_\r
+\r
+#include EFI_PROTOCOL_DEFINITION (DevicePath)\r
+\r
+//\r
+// Loaded Image Device Path protocol\r
+//\r
+#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \\r
+ { \\r
+ 0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf} \\r
+ }\r
+\r
+typedef EFI_DEVICE_PATH_PROTOCOL EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiLoadedImageDevicePathProtocolGuid;\r
+\r
+#endif\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ PlatformToDriverConfiguration.c\r
+\r
+Abstract:\r
+\r
+ UEFI Platform to Driver Configuration Protocol\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+#include "EfiSpec.h"\r
+#include EFI_PROTOCOL_DEFINITION (PlatformToDriverConfiguration)\r
+\r
+EFI_GUID gEfiPlatformToDriverConfigurationProtocolGuid = EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID;\r
+EFI_GUID gEfiPlatformToDriverConfigurationClpGuid = EFI_PLATFORM_TO_DRIVER_CONFIGURATION_CLP_GUID;\r
+\r
+EFI_GUID_STRING\r
+ (&gEfiPlatformToDriverConfigurationProtocolGuid, "Platform to Driver Configuration Protocol", "UEFI 2.1 Platform to Driver Configuration Protocol");\r
--- /dev/null
+/*++\r
+\r
+Copyright (c) 2008, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+ PlatformToDriverConfiguration.h\r
+\r
+Abstract:\r
+\r
+ UEFI Platform to Driver Configuration Protocol\r
+\r
+Revision History:\r
+\r
+--*/\r
+\r
+#ifndef _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_H_\r
+#define _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_H_\r
+\r
+//\r
+// Global ID for the Platform to Driver Configuration Protocol\r
+//\r
+#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID \\r
+ { \\r
+ 0x642cd590, 0x8059, 0x4c0a, {0xa9, 0x58, 0xc5, 0xec, 0x07, 0xd2, 0x3c, 0x4b} \\r
+ }\r
+\r
+#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_CLP_GUID \\r
+ { \\r
+ 0x345ecc0e, 0x0cb6, 0x4b75, {0xbb, 0x57, 0x1b, 0x12, 0x9c, 0x47, 0x33, 0x3e} \\r
+ }\r
+\r
+EFI_FORWARD_DECLARATION (EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL);\r
+\r
+typedef enum {\r
+ EfiPlatformConfigurationActionNone = 0,\r
+ EfiPlatformConfigurationActionStopController = 1,\r
+ EfiPlatformConfigurationActionRestartController = 2,\r
+ EfiPlatformConfigurationActionRestartPlatform = 3,\r
+ EfiPlatformConfigurationActionNvramFailed = 4,\r
+ EfiPlatformConfigurationActionMaximum\r
+} EFI_PLATFORM_CONFIGURATION_ACTION;\r
+\r
+typedef struct {\r
+ CHAR8 *CLPCommand;\r
+ UINT32 CLPCommandLength;\r
+ CHAR8 *CLPReturnString;\r
+ UINT32 CLPReturnStringLength;\r
+ UINT8 CLPCmdStatus;\r
+ UINT8 CLPErrorValue;\r
+ UINT16 CLPMsgCode;\r
+} EFI_CONFIGURE_CLP_PARAMETER_BLK;\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY) (\r
+ IN EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE ChildHandle, OPTIONAL\r
+ IN UINTN *Instance,\r
+ OUT EFI_GUID **ParameterTypeGuid,\r
+ OUT VOID **ParameterBlock,\r
+ OUT UINTN *ParameterBlockSize\r
+ );\r
+/*++\r
+\r
+ Routine Description:\r
+ Allows the UEFI driver to query the platform for configuration information\r
+ needed to complete the drivers Start() operation.\r
+\r
+ Arguments:\r
+ This - A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
+ ControllerHandle - The handle the platform will return configuration\r
+ information about.\r
+ ChildHandle - The handle of the child controller to set options on.\r
+ This is an optional parameter that may be NULL. It will\r
+ be NULL for device drivers, and for a bus drivers that\r
+ wish to set options for the bus controller. It will not\r
+ be NULL for a bus driver that wishes to set options for\r
+ one of its child controllers.\r
+ Instance - Pointer to the Instance value. Zero means return the first\r
+ query data. The caller should increment this value by one\r
+ each time to retrieve successive data.\r
+ ParameterTypeGuid - An EFI_GUID that defines the contents of ParameterBlock.\r
+ UEFI drivers must use the ParameterTypeGuid to determine\r
+ how to parse the ParameterBlock. The caller should not\r
+ attempt to free ParameterTypeGuid.\r
+ ParameterBlock - The platform returns a pointer to the ParameterBlock\r
+ structure which contains details about the configuration\r
+ parameters specific to the ParameterTypeGuid. This structure\r
+ is defined based on the protocol and may be different for\r
+ different protocols. UEFI driver decodes this structure\r
+ and its contents based on ProtocolGuid. ParameterBlock\r
+ is allocated by the platform and the platform is responsible\r
+ for freeing the ParameterBlock after Response is called.\r
+ ParameterBlockSize - The platform returns the size of the ParameterBlock in bytes.\r
+\r
+ Returns:\r
+ EFI_SUCCESS - The platform return parameter information for ControllerHandle.\r
+ EFI_NOT_FOUND - No more unread Instance exists.\r
+ EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
+ EFI_INVALID_PARAMETER - Instance is NULL.\r
+ EFI_DEVICE_ERROR - A device error occurred while attempting to return\r
+ parameter block information for the controller specified\r
+ by ControllerHandle and ChildHandle.\r
+ EFI_OUT_RESOURCES - There are not enough resources available to set the\r
+ configuration options for the controller specified\r
+ by ControllerHandle and ChildHandle.\r
+\r
+--*/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE) (\r
+ IN EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,\r
+ IN EFI_HANDLE ControllerHandle,\r
+ IN EFI_HANDLE ChildHandle OPTIONAL,\r
+ IN UINTN *Instance,\r
+ IN EFI_GUID *ParameterTypeGuid,\r
+ IN VOID *ParameterBlock,\r
+ IN UINTN ParameterBlockSize ,\r
+ IN EFI_PLATFORM_CONFIGURATION_ACTION ConfigurationAction\r
+ );\r
+/*++\r
+\r
+ Routine Description:\r
+ Tell the platform what actions where taken by the driver after processing\r
+ the data returned from Query.\r
+\r
+ Arguments:\r
+ This - A pointer to the EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL instance.\r
+ ControllerHandle - The handle the platform will return configuration\r
+ information about.\r
+ ChildHandle - The handle of the child controller to set options on.\r
+ This is an optional parameter that may be NULL. It will\r
+ be NULL for device drivers, and for a bus drivers that\r
+ wish to set options for the bus controller. It will not\r
+ be NULL for a bus driver that wishes to set options for\r
+ one of its child controllers.\r
+ Instance - Instance data returned from Query.\r
+ ParameterTypeGuid - ParameterTypeGuid returned from Query.\r
+ ParameterBlock - ParameterBlock returned from Query.\r
+ ParameterBlockSize - The ParameterBlock size returned from Query.\r
+ ConfigurationAction- The driver tells the platform what action is required\r
+ for ParameterBlock to take effect.\r
+\r
+ Returns:\r
+ EFI_SUCCESS - The platform return parameter information for ControllerHandle.\r
+ EFI_NOT_FOUND - Instance was not found.\r
+ EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
+ EFI_INVALID_PARAMETER - Instance is zero.\r
+\r
+--*/\r
+\r
+//\r
+// Interface structure for the Platform to Driver Configuration Protocol\r
+//\r
+typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {\r
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY Query;\r
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response;\r
+} EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiPlatformToDriverConfigurationProtocolGuid;\r
+extern EFI_GUID gEfiPlatformToDriverConfigurationClpGuid;\r
+\r
+#endif\r