]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / Partition.h
CommitLineData
adbcbf8f 1/** @file\r
d1102dba 2 Partition driver that produces logical BlockIo devices from a physical\r
adbcbf8f 3 BlockIo device. The logical BlockIo devices are based on the format\r
8aafec2c 4 of the raw block devices media. Currently "El Torito CD-ROM", UDF, Legacy\r
adbcbf8f 5 MBR, and GPT partition schemes are supported.\r
6\r
709c9fd5 7Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc.\r
d1102dba 8Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 9SPDX-License-Identifier: BSD-2-Clause-Patent\r
adbcbf8f 10\r
11**/\r
12\r
d1102dba
LG
13#ifndef _PARTITION_H_\r
14#define _PARTITION_H_\r
adbcbf8f 15\r
16#include <Uefi.h>\r
17#include <Protocol/BlockIo.h>\r
490b5ea1 18#include <Protocol/BlockIo2.h>\r
adbcbf8f 19#include <Guid/Gpt.h>\r
20#include <Protocol/ComponentName.h>\r
21#include <Protocol/DevicePath.h>\r
22#include <Protocol/DriverBinding.h>\r
23#include <Protocol/DiskIo.h>\r
493d8e3a 24#include <Protocol/DiskIo2.h>\r
3a3d62d2 25#include <Protocol/PartitionInfo.h>\r
adbcbf8f 26#include <Library/DebugLib.h>\r
27#include <Library/UefiDriverEntryPoint.h>\r
28#include <Library/BaseLib.h>\r
29#include <Library/UefiLib.h>\r
30#include <Library/BaseMemoryLib.h>\r
31#include <Library/MemoryAllocationLib.h>\r
32#include <Library/UefiBootServicesTableLib.h>\r
33#include <Library/DevicePathLib.h>\r
34\r
35#include <IndustryStandard/Mbr.h>\r
36#include <IndustryStandard/ElTorito.h>\r
8aafec2c 37#include <IndustryStandard/Udf.h>\r
adbcbf8f 38\r
39//\r
40// Partition private data\r
41//\r
f3f2e05d 42#define PARTITION_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'a', 'r', 't')\r
adbcbf8f 43typedef struct {\r
3a3d62d2
HW
44 UINT64 Signature;\r
45\r
46 EFI_HANDLE Handle;\r
47 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
48 EFI_BLOCK_IO_PROTOCOL BlockIo;\r
49 EFI_BLOCK_IO2_PROTOCOL BlockIo2;\r
50 EFI_BLOCK_IO_MEDIA Media;\r
51 EFI_BLOCK_IO_MEDIA Media2;//For BlockIO2\r
52 EFI_PARTITION_INFO_PROTOCOL PartitionInfo;\r
53\r
54 EFI_DISK_IO_PROTOCOL *DiskIo;\r
55 EFI_DISK_IO2_PROTOCOL *DiskIo2;\r
56 EFI_BLOCK_IO_PROTOCOL *ParentBlockIo;\r
57 EFI_BLOCK_IO2_PROTOCOL *ParentBlockIo2;\r
58 UINT64 Start;\r
59 UINT64 End;\r
60 UINT32 BlockSize;\r
61 BOOLEAN InStop;\r
62\r
709c9fd5 63 EFI_GUID TypeGuid;\r
adbcbf8f 64\r
65} PARTITION_PRIVATE_DATA;\r
66\r
493d8e3a
RN
67typedef struct {\r
68 EFI_DISK_IO2_TOKEN DiskIo2Token;\r
69 EFI_BLOCK_IO2_TOKEN *BlockIo2Token;\r
70} PARTITION_ACCESS_TASK;\r
71\r
adbcbf8f 72#define PARTITION_DEVICE_FROM_BLOCK_IO_THIS(a) CR (a, PARTITION_PRIVATE_DATA, BlockIo, PARTITION_PRIVATE_DATA_SIGNATURE)\r
490b5ea1 73#define PARTITION_DEVICE_FROM_BLOCK_IO2_THIS(a) CR (a, PARTITION_PRIVATE_DATA, BlockIo2, PARTITION_PRIVATE_DATA_SIGNATURE)\r
adbcbf8f 74\r
75//\r
76// Global Variables\r
77//\r
d38a0f44 78extern EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding;\r
79extern EFI_COMPONENT_NAME_PROTOCOL gPartitionComponentName;\r
80extern EFI_COMPONENT_NAME2_PROTOCOL gPartitionComponentName2;\r
adbcbf8f 81\r
82//\r
83// Extract INT32 from char array\r
84//\r
85#define UNPACK_INT32(a) (INT32)( (((UINT8 *) a)[0] << 0) | \\r
86 (((UINT8 *) a)[1] << 8) | \\r
87 (((UINT8 *) a)[2] << 16) | \\r
88 (((UINT8 *) a)[3] << 24) )\r
89\r
90//\r
91// Extract UINT32 from char array\r
92//\r
93#define UNPACK_UINT32(a) (UINT32)( (((UINT8 *) a)[0] << 0) | \\r
94 (((UINT8 *) a)[1] << 8) | \\r
95 (((UINT8 *) a)[2] << 16) | \\r
96 (((UINT8 *) a)[3] << 24) )\r
97\r
4f06d35a 98\r
99//\r
100// GPT Partition Entry Status\r
101//\r
102typedef struct {\r
103 BOOLEAN OutOfRange;\r
104 BOOLEAN Overlap;\r
47e1a80b 105 BOOLEAN OsSpecific;\r
4f06d35a 106} EFI_PARTITION_ENTRY_STATUS;\r
107\r
adbcbf8f 108//\r
109// Function Prototypes\r
110//\r
a8d0c20e 111/**\r
112 Test to see if this driver supports ControllerHandle. Any ControllerHandle\r
113 than contains a BlockIo and DiskIo protocol can be supported.\r
114\r
115 @param This Protocol instance pointer.\r
116 @param ControllerHandle Handle of device to test\r
117 @param RemainingDevicePath Optional parameter use to pick a specific child\r
118 device to start.\r
119\r
120 @retval EFI_SUCCESS This driver supports this device\r
121 @retval EFI_ALREADY_STARTED This driver is already running on this device\r
122 @retval other This driver does not support this device\r
123\r
124**/\r
adbcbf8f 125EFI_STATUS\r
126EFIAPI\r
127PartitionDriverBindingSupported (\r
128 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
129 IN EFI_HANDLE ControllerHandle,\r
130 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
131 );\r
132\r
a8d0c20e 133/**\r
134 Start this driver on ControllerHandle by opening a Block IO and Disk IO\r
135 protocol, reading Device Path, and creating a child handle with a\r
136 Disk IO and device path protocol.\r
137\r
138 @param This Protocol instance pointer.\r
139 @param ControllerHandle Handle of device to bind driver to\r
140 @param RemainingDevicePath Optional parameter use to pick a specific child\r
141 device to start.\r
142\r
143 @retval EFI_SUCCESS This driver is added to ControllerHandle\r
144 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r
145 @retval other This driver does not support this device\r
146\r
147**/\r
adbcbf8f 148EFI_STATUS\r
149EFIAPI\r
150PartitionDriverBindingStart (\r
151 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
152 IN EFI_HANDLE ControllerHandle,\r
153 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
154 );\r
155\r
a8d0c20e 156/**\r
48557c65 157 Stop this driver on ControllerHandle. Support stopping any child handles\r
a8d0c20e 158 created by this driver.\r
159\r
160 @param This Protocol instance pointer.\r
161 @param ControllerHandle Handle of device to stop driver on\r
162 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r
163 children is zero stop the entire bus driver.\r
164 @param ChildHandleBuffer List of Child Handles to Stop.\r
165\r
166 @retval EFI_SUCCESS This driver is removed ControllerHandle\r
167 @retval other This driver was not removed from this device\r
168\r
169**/\r
adbcbf8f 170EFI_STATUS\r
171EFIAPI\r
172PartitionDriverBindingStop (\r
ea7cb08c 173 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
174 IN EFI_HANDLE ControllerHandle,\r
175 IN UINTN NumberOfChildren,\r
176 IN EFI_HANDLE *ChildHandleBuffer\r
adbcbf8f 177 );\r
178\r
179//\r
180// EFI Component Name Functions\r
181//\r
d38a0f44 182/**\r
183 Retrieves a Unicode string that is the user readable name of the driver.\r
184\r
185 This function retrieves the user readable name of a driver in the form of a\r
186 Unicode string. If the driver specified by This has a user readable name in\r
187 the language specified by Language, then a pointer to the driver name is\r
188 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
189 by This does not support the language specified by Language,\r
190 then EFI_UNSUPPORTED is returned.\r
191\r
192 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
193 EFI_COMPONENT_NAME_PROTOCOL instance.\r
194\r
195 @param Language[in] A pointer to a Null-terminated ASCII string\r
196 array indicating the language. This is the\r
197 language of the driver name that the caller is\r
198 requesting, and it must match one of the\r
199 languages specified in SupportedLanguages. The\r
200 number of languages supported by a driver is up\r
201 to the driver writer. Language is specified\r
0254efc0 202 in RFC 4646 or ISO 639-2 language code format.\r
d38a0f44 203\r
204 @param DriverName[out] A pointer to the Unicode string to return.\r
205 This Unicode string is the name of the\r
206 driver specified by This in the language\r
207 specified by Language.\r
208\r
209 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
210 This and the language specified by Language was\r
211 returned in DriverName.\r
212\r
213 @retval EFI_INVALID_PARAMETER Language is NULL.\r
214\r
215 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
216\r
217 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
218 the language specified by Language.\r
219\r
220**/\r
adbcbf8f 221EFI_STATUS\r
222EFIAPI\r
223PartitionComponentNameGetDriverName (\r
224 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
225 IN CHAR8 *Language,\r
226 OUT CHAR16 **DriverName\r
227 );\r
228\r
d38a0f44 229\r
230/**\r
231 Retrieves a Unicode string that is the user readable name of the controller\r
232 that is being managed by a driver.\r
233\r
234 This function retrieves the user readable name of the controller specified by\r
235 ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
236 driver specified by This has a user readable name in the language specified by\r
237 Language, then a pointer to the controller name is returned in ControllerName,\r
238 and EFI_SUCCESS is returned. If the driver specified by This is not currently\r
239 managing the controller specified by ControllerHandle and ChildHandle,\r
240 then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r
241 support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
242\r
243 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
244 EFI_COMPONENT_NAME_PROTOCOL instance.\r
245\r
246 @param ControllerHandle[in] The handle of a controller that the driver\r
247 specified by This is managing. This handle\r
248 specifies the controller whose name is to be\r
249 returned.\r
250\r
251 @param ChildHandle[in] The handle of the child controller to retrieve\r
252 the name of. This is an optional parameter that\r
253 may be NULL. It will be NULL for device\r
254 drivers. It will also be NULL for a bus drivers\r
255 that wish to retrieve the name of the bus\r
256 controller. It will not be NULL for a bus\r
257 driver that wishes to retrieve the name of a\r
258 child controller.\r
259\r
260 @param Language[in] A pointer to a Null-terminated ASCII string\r
261 array indicating the language. This is the\r
262 language of the driver name that the caller is\r
263 requesting, and it must match one of the\r
264 languages specified in SupportedLanguages. The\r
265 number of languages supported by a driver is up\r
266 to the driver writer. Language is specified in\r
0254efc0 267 RFC 4646 or ISO 639-2 language code format.\r
d38a0f44 268\r
269 @param ControllerName[out] A pointer to the Unicode string to return.\r
270 This Unicode string is the name of the\r
271 controller specified by ControllerHandle and\r
272 ChildHandle in the language specified by\r
273 Language from the point of view of the driver\r
274 specified by This.\r
275\r
276 @retval EFI_SUCCESS The Unicode string for the user readable name in\r
277 the language specified by Language for the\r
278 driver specified by This was returned in\r
279 DriverName.\r
280\r
281 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
282\r
283 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
284 EFI_HANDLE.\r
285\r
286 @retval EFI_INVALID_PARAMETER Language is NULL.\r
287\r
288 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
289\r
290 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
291 managing the controller specified by\r
292 ControllerHandle and ChildHandle.\r
293\r
294 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
295 the language specified by Language.\r
296\r
297**/\r
adbcbf8f 298EFI_STATUS\r
299EFIAPI\r
300PartitionComponentNameGetControllerName (\r
301 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
302 IN EFI_HANDLE ControllerHandle,\r
303 IN EFI_HANDLE ChildHandle OPTIONAL,\r
304 IN CHAR8 *Language,\r
305 OUT CHAR16 **ControllerName\r
306 );\r
307\r
d38a0f44 308\r
a8d0c20e 309/**\r
310 Create a child handle for a logical block device that represents the\r
311 bytes Start to End of the Parent Block IO device.\r
312\r
490b5ea1 313 @param[in] This Protocol instance pointer.\r
314 @param[in] ParentHandle Parent Handle for new child.\r
315 @param[in] ParentDiskIo Parent DiskIo interface.\r
493d8e3a 316 @param[in] ParentDiskIo2 Parent DiskIo2 interface.\r
490b5ea1 317 @param[in] ParentBlockIo Parent BlockIo interface.\r
318 @param[in] ParentBlockIo2 Parent BlockIo2 interface.\r
319 @param[in] ParentDevicePath Parent Device Path.\r
320 @param[in] DevicePathNode Child Device Path node.\r
3a3d62d2 321 @param[in] PartitionInfo Child Partition Information interface.\r
490b5ea1 322 @param[in] Start Start Block.\r
323 @param[in] End End Block.\r
324 @param[in] BlockSize Child block size.\r
709c9fd5 325 @param[in] TypeGuid Parition Type Guid.\r
a8d0c20e 326\r
490b5ea1 327 @retval EFI_SUCCESS A child handle was added.\r
328 @retval other A child handle was not added.\r
a8d0c20e 329\r
330**/\r
adbcbf8f 331EFI_STATUS\r
332PartitionInstallChildHandle (\r
333 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
334 IN EFI_HANDLE ParentHandle,\r
335 IN EFI_DISK_IO_PROTOCOL *ParentDiskIo,\r
493d8e3a 336 IN EFI_DISK_IO2_PROTOCOL *ParentDiskIo2,\r
adbcbf8f 337 IN EFI_BLOCK_IO_PROTOCOL *ParentBlockIo,\r
490b5ea1 338 IN EFI_BLOCK_IO2_PROTOCOL *ParentBlockIo2,\r
adbcbf8f 339 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
340 IN EFI_DEVICE_PATH_PROTOCOL *DevicePathNode,\r
3a3d62d2 341 IN EFI_PARTITION_INFO_PROTOCOL *PartitionInfo,\r
ea7cb08c 342 IN EFI_LBA Start,\r
343 IN EFI_LBA End,\r
709c9fd5
JB
344 IN UINT32 BlockSize,\r
345 IN EFI_GUID *TypeGuid\r
ea7cb08c 346 );\r
adbcbf8f 347\r
e3325721
HW
348/**\r
349 Test to see if there is any child on ControllerHandle.\r
350\r
351 @param[in] ControllerHandle Handle of device to test.\r
352\r
353 @retval TRUE There are children on the ControllerHandle.\r
354 @retval FALSE No child is on the ControllerHandle.\r
355\r
356**/\r
357BOOLEAN\r
358HasChildren (\r
359 IN EFI_HANDLE ControllerHandle\r
360 );\r
361\r
a8d0c20e 362/**\r
363 Install child handles if the Handle supports GPT partition structure.\r
364\r
490b5ea1 365 @param[in] This Calling context.\r
366 @param[in] Handle Parent Handle.\r
367 @param[in] DiskIo Parent DiskIo interface.\r
493d8e3a 368 @param[in] DiskIo2 Parent DiskIo2 interface.\r
490b5ea1 369 @param[in] BlockIo Parent BlockIo interface.\r
370 @param[in] BlockIo2 Parent BlockIo2 interface.\r
371 @param[in] DevicePath Parent Device Path.\r
a8d0c20e 372\r
490b5ea1 373 @retval EFI_SUCCESS Valid GPT disk.\r
374 @retval EFI_MEDIA_CHANGED Media changed Detected.\r
375 @retval EFI_INVALID_PARAMETER If both BlockIo and BlockIo2 are NULL;\r
376 @retval other Not a valid GPT disk.\r
a8d0c20e 377\r
378**/\r
adbcbf8f 379EFI_STATUS\r
380PartitionInstallGptChildHandles (\r
381 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
382 IN EFI_HANDLE Handle,\r
383 IN EFI_DISK_IO_PROTOCOL *DiskIo,\r
493d8e3a 384 IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r
adbcbf8f 385 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
490b5ea1 386 IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2,\r
adbcbf8f 387 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
ea7cb08c 388 );\r
adbcbf8f 389\r
a8d0c20e 390/**\r
391 Install child handles if the Handle supports El Torito format.\r
392\r
393 @param[in] This Calling context.\r
490b5ea1 394 @param[in] Handle Parent Handle.\r
395 @param[in] DiskIo Parent DiskIo interface.\r
493d8e3a 396 @param[in] DiskIo2 Parent DiskIo2 interface.\r
490b5ea1 397 @param[in] BlockIo Parent BlockIo interface.\r
398 @param[in] BlockIo2 Parent BlockIo2 interface.\r
a8d0c20e 399 @param[in] DevicePath Parent Device Path\r
400\r
401\r
490b5ea1 402 @retval EFI_SUCCESS Child handle(s) was added.\r
403 @retval EFI_MEDIA_CHANGED Media changed Detected.\r
404 @retval other no child handle was added.\r
a8d0c20e 405\r
406**/\r
adbcbf8f 407EFI_STATUS\r
408PartitionInstallElToritoChildHandles (\r
409 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
410 IN EFI_HANDLE Handle,\r
411 IN EFI_DISK_IO_PROTOCOL *DiskIo,\r
493d8e3a 412 IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r
adbcbf8f 413 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
490b5ea1 414 IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2,\r
adbcbf8f 415 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
ea7cb08c 416 );\r
adbcbf8f 417\r
a8d0c20e 418/**\r
419 Install child handles if the Handle supports MBR format.\r
420\r
490b5ea1 421 @param[in] This Calling context.\r
422 @param[in] Handle Parent Handle.\r
423 @param[in] DiskIo Parent DiskIo interface.\r
493d8e3a 424 @param[in] DiskIo2 Parent DiskIo2 interface.\r
490b5ea1 425 @param[in] BlockIo Parent BlockIo interface.\r
426 @param[in] BlockIo2 Parent BlockIo2 interface.\r
427 @param[in] DevicePath Parent Device Path.\r
d1102dba 428\r
a8d0c20e 429 @retval EFI_SUCCESS A child handle was added.\r
430 @retval EFI_MEDIA_CHANGED Media change was detected.\r
431 @retval Others MBR partition was not found.\r
432\r
433**/\r
adbcbf8f 434EFI_STATUS\r
435PartitionInstallMbrChildHandles (\r
436 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
437 IN EFI_HANDLE Handle,\r
438 IN EFI_DISK_IO_PROTOCOL *DiskIo,\r
493d8e3a 439 IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r
adbcbf8f 440 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
490b5ea1 441 IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2,\r
adbcbf8f 442 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
ea7cb08c 443 );\r
adbcbf8f 444\r
8aafec2c
PA
445/**\r
446 Install child handles if the Handle supports UDF/ECMA-167 volume format.\r
447\r
448 @param[in] This Calling context.\r
449 @param[in] Handle Parent Handle.\r
450 @param[in] DiskIo Parent DiskIo interface.\r
451 @param[in] DiskIo2 Parent DiskIo2 interface.\r
452 @param[in] BlockIo Parent BlockIo interface.\r
453 @param[in] BlockIo2 Parent BlockIo2 interface.\r
454 @param[in] DevicePath Parent Device Path\r
455\r
456\r
457 @retval EFI_SUCCESS Child handle(s) was added.\r
458 @retval EFI_MEDIA_CHANGED Media changed Detected.\r
459 @retval other no child handle was added.\r
460\r
461**/\r
462EFI_STATUS\r
463PartitionInstallUdfChildHandles (\r
464 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
465 IN EFI_HANDLE Handle,\r
466 IN EFI_DISK_IO_PROTOCOL *DiskIo,\r
467 IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r
468 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
469 IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2,\r
470 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
471 );\r
472\r
adbcbf8f 473typedef\r
474EFI_STATUS\r
475(*PARTITION_DETECT_ROUTINE) (\r
476 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
477 IN EFI_HANDLE Handle,\r
478 IN EFI_DISK_IO_PROTOCOL *DiskIo,\r
493d8e3a 479 IN EFI_DISK_IO2_PROTOCOL *DiskIo2,\r
adbcbf8f 480 IN EFI_BLOCK_IO_PROTOCOL *BlockIo,\r
490b5ea1 481 IN EFI_BLOCK_IO2_PROTOCOL *BlockIo2,\r
adbcbf8f 482 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
483 );\r
484\r
485#endif\r