summaryrefslogtreecommitdiff
path: root/tools/unittests/kdoc-test.yaml
blob: 14d36daa1bba5cd548f27f7145f94388d27e71a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2026: Mauro Carvalho Chehab <mchehab@kernel.org>

# Test cases for the dynamic tests.
# Useful to test if kernel-doc classes are doing what it is expected.
#

tests:
- name: func1
  fname: mock_functions.c
  description: "Simplest function test: do nothing, just rst output"

  source: |
    /**
      * func1 - Not exported function
      * @arg1: @arg1 does nothing
      *
      * Does nothing
      *
      * return:
      *    always return 0.
      */
    int func1(char *arg1) { return 0; };

  expected:
  - rst: |
    .. c:function:: int func1 (char *arg1)

      Not exported function

    .. container:: kernelindent

      **Parameters**

      ``char *arg1``
        **arg1** does nothing

      **Description**

      Does nothing

      **Return**

      always return 0.

    # TODO: how to handle timestamps at .TH?
    man: |
      .TH "func1" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      func1 \- Not exported function
      .SH SYNOPSIS
      .B "int" func1
      .BI "(char *arg1 "  ");"
      .SH ARGUMENTS
      .IP "arg1" 12
      \fIarg1\fP does nothing
      .SH "DESCRIPTION"
      Does nothing
      .SH "RETURN"
      always return 0.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_functions.c\fR

- name: func2
  fname: func2.c
  description: Simple test with exports

  source: |
    /**
      * func2() - Exported function
      * @arg1: @arg1 does nothing
      *
      * Does nothing
      *
      * return:
      *    always return 0.
      */
    int func2(char *arg1) { return 0; };
    EXPORT_SYMBOL(func2);

  exports: func2
  expected:
  - kdoc_item:
      name: func2
      type: function
      declaration_start_line: 1

      sections:
        Description: |
          Does nothing

        Return: |
          always return 0.

      sections_start_lines:
        Description: 3
        Return: 6

      parameterdescs:
        arg1: |
          @arg1 does nothing
      parameterlist:
        - arg1
      parameterdesc_start_lines:
        arg1: 2
      parametertypes:
        arg1: char *arg1

      other_stuff:
        func_macro: false
        functiontype: int
        purpose: "Exported function"
        typedef: false

    rst: |
      .. c:function:: int func2 (char *arg1)

        Exported function

      .. container:: kernelindent

        **Parameters**

        ``char *arg1``
          **arg1** does nothing

        **Description**

        Does nothing

        **Return**

        always return 0.

    man: |
      .TH "func2" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      func2 \- Exported function
      .SH SYNOPSIS
      .B "int" func2
      .BI "(char *arg1 "  ");"
      .SH ARGUMENTS
      .IP "arg1" 12
      \fIarg1\fP does nothing
      .SH "DESCRIPTION"
      Does nothing
      .SH "RETURN"
      always return 0.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBfunc2.c\fR

- name: doc_with_complex_table
  description: Test if complex tables are handled
  fname: mock.c
  source: |
    /**
      * DOC: Supported input formats and encodings
      *
      * Depending on the Hardware configuration of the Controller IP, it supports
      * a subset of the following input formats and encodings on its internal
      * 48bit bus.
      *
      * +----------------------+----------------------------------+------------------------------+
      * | Format Name          | Format Code                      | Encodings                    |
      * +======================+==================================+==============================+
      * | RGB 4:4:4 8bit       | ``MEDIA_BUS_FMT_RGB888_1X24``    | ``V4L2_YCBCR_ENC_DEFAULT``   |
      * +----------------------+----------------------------------+------------------------------+
      * | RGB 4:4:4 10bits     | ``MEDIA_BUS_FMT_RGB101010_1X30`` | ``V4L2_YCBCR_ENC_DEFAULT``   |
      * +----------------------+----------------------------------+------------------------------+
      */
  expected:
    - man: |
        .TH "Supported input formats and encodings" 9 "March 2026" "" "Kernel API Manual"
        .SH "Supported input formats and encodings"
        Depending on the Hardware configuration of the Controller IP, it supports
        a subset of the following input formats and encodings on its internal
        48bit bus.
        .PP


        .TS
        box;
        l	l	l.
        \fBFormat Name\fP	\fBFormat Code\fP	\fBEncodings\fP
        _
        RGB 4:4:4 8bit	``MEDIA_BUS_FMT_RGB888_1X24	V4L2_YCBCR_ENC_DEFAULT
        RGB 4:4:4 10bits	MEDIA_BUS_FMT_RGB101010_1X30	V4L2_YCBCR_ENC_DEFAULT``
        .TE
        .SH "SEE ALSO"
        .PP
        Kernel file \fBmock.c\fR

      rst: |-
        .. _Supported input formats and encodings:
        **Supported input formats and encodings**
        Depending on the Hardware configuration of the Controller IP, it supports
        a subset of the following input formats and encodings on its internal
        48bit bus.
        +----------------------+----------------------------------+------------------------------+
        | Format Name          | Format Code                      | Encodings                    |
        +======================+==================================+==============================+
        | RGB 4:4:4 8bit       | ``MEDIA_BUS_FMT_RGB888_1X24``    | ``V4L2_YCBCR_ENC_DEFAULT``   |
        +----------------------+----------------------------------+------------------------------+
        | RGB 4:4:4 10bits     | ``MEDIA_BUS_FMT_RGB101010_1X30`` | ``V4L2_YCBCR_ENC_DEFAULT``   |
        +----------------------+----------------------------------+------------------------------+
- name: func_with_ascii_artwork
  description: Test if ascii artwork is properly output
  fname: mock.c
  source: |
    /**
      * add_cxl_resources() - reflect CXL fixed memory windows in iomem_resource
      * @cxl_res: A standalone resource tree where each CXL window is a sibling
      *
      * Walk each CXL window in @cxl_res and add it to iomem_resource potentially
      * expanding its boundaries to ensure that any conflicting resources become
      * children. If a window is expanded it may then conflict with a another window
      * entry and require the window to be truncated or trimmed. Consider this
      * situation::
      *
      *      |-- "CXL Window 0" --||----- "CXL Window 1" -----|
      *      |--------------- "System RAM" -------------|
      *
      * ...where platform firmware has established as System RAM resource across 2
      * windows, but has left some portion of window 1 for dynamic CXL region
      * provisioning. In this case "Window 0" will span the entirety of the "System
      * RAM" span, and "CXL Window 1" is truncated to the remaining tail past the end
      * of that "System RAM" resource.
      */
    static int add_cxl_resources(struct resource *cxl_res);
  expected:
    - man: |-
        .TH "add_cxl_resources" 9 "March 2026" "" "Kernel API Manual"
        .SH NAME
        add_cxl_resources \- reflect CXL fixed memory windows in iomem_resource
        .SH SYNOPSIS
        .B "int" add_cxl_resources
        .BI "(struct resource *cxl_res "  ");"
        .SH ARGUMENTS
        .IP "cxl_res" 12
        A standalone resource tree where each CXL window is a sibling
        .SH "DESCRIPTION"
        Walk each CXL window in \fIcxl_res\fP and add it to iomem_resource potentially
        expanding its boundaries to ensure that any conflicting resources become
        children. If a window is expanded it may then conflict with a another window
        entry and require the window to be truncated or trimmed. Consider this
        situation:
        .nf

             |-- "CXL Window 0" --||----- "CXL Window 1" -----|
             |--------------- "System RAM" -------------|


        .fi
        .PP

        \&...where platform firmware has established as System RAM resource across 2
        windows, but has left some portion of window 1 for dynamic CXL region
        provisioning. In this case "Window 0" will span the entirety of the "System
        RAM" span, and "CXL Window 1" is truncated to the remaining tail past the end
        of that "System RAM" resource.
        .SH "SEE ALSO"
        .PP
        Kernel file \fBmock.c\fR
      rst: |
        .. c:function:: int add_cxl_resources (struct resource *cxl_res)

          reflect CXL fixed memory windows in iomem_resource

        .. container:: kernelindent

          **Parameters**

          ``struct resource *cxl_res``
            A standalone resource tree where each CXL window is a sibling

          **Description**

          Walk each CXL window in **cxl_res** and add it to iomem_resource potentially
          expanding its boundaries to ensure that any conflicting resources become
          children. If a window is expanded it may then conflict with a another window
          entry and require the window to be truncated or trimmed. Consider this
          situation::

            |-- "CXL Window 0" --||----- "CXL Window 1" -----|
            |--------------- "System RAM" -------------|

          ...where platform firmware has established as System RAM resource across 2
          windows, but has left some portion of window 1 for dynamic CXL region
          provisioning. In this case "Window 0" will span the entirety of the "System
          RAM" span, and "CXL Window 1" is truncated to the remaining tail past the end
          of that "System RAM" resource.

- name: simple_tables
  description: Test formatting two simple tables
  fname: mock.c
  source: |
    /**
     * bitmap_onto - translate one bitmap relative to another
     *      @dst: resulting translated bitmap
     *      @orig: original untranslated bitmap
     *      @relmap: bitmap relative to which translated
     *      @bits: number of bits in each of these bitmaps
     *
     *      =============== ============== =================
     *      @orig           tmp            @dst
     *      0                0             40
     *      1                1             41
     *      =============== ============== =================
     *
     * And:
     *
     *      =============== ============== =================
     *      @orig           tmp            @dst
     *      =============== ============== =================
     *      9                9             95
     *      10               0             40 [#f1]_
     *      =============== ============== =================
     */
    void bitmap_onto(unsigned long *dst, const unsigned long *orig,
                     const unsigned long *relmap, unsigned int bits);
  expected:
    - man: |
        .TH "bitmap_onto" 9 "March 2026" "" "Kernel API Manual"
        .SH NAME
        bitmap_onto \- translate one bitmap relative to another
        .SH SYNOPSIS
        .B "void" bitmap_onto
        .BI "(unsigned long *dst "  ","
        .BI "const unsigned long *orig "  ","
        .BI "const unsigned long *relmap "  ","
        .BI "unsigned int bits "  ");"
        .SH ARGUMENTS
        .IP "dst" 12
        resulting translated bitmap
        .IP "orig" 12
        original untranslated bitmap
        .IP "relmap" 12
        bitmap relative to which translated
        .IP "bits" 12
        number of bits in each of these bitmaps
        .SH "DESCRIPTION"

        .TS
        box;
        l	l	l.
        \fIorig\fP	tmp	\fIdst\fP
        0	0	40
        1	1	41
        .TE
        .PP

        And:
        .PP


        .TS
        box;
        l	l	l.
        \fIorig\fP	tmp	\fIdst\fP
        .TE
        9                9             95
        10               0             40 [#f1]_
        .SH "SEE ALSO"
        .PP
        Kernel file \fBmock.c\fR

      rst: |
        .. c:function:: void bitmap_onto (unsigned long *dst, const unsigned long *orig, const unsigned long *relmap,  unsigned int bits)

          translate one bitmap relative to another

        .. container:: kernelindent

          **Parameters**

          ``unsigned long *dst``
            resulting translated bitmap

          ``const unsigned long *orig``
            original untranslated bitmap

          ``const unsigned long *relmap``
            bitmap relative to which translated

          ``unsigned int bits``
            number of bits in each of these bitmaps

          **Description**

              =============== ============== =================
              **orig**           tmp            **dst**
              0                0             40
              1                1             41
              =============== ============== =================

          And:

              =============== ============== =================
              **orig**           tmp            **dst**
              =============== ============== =================
              9                9             95
              10               0             40 [#f1]_
              =============== ============== =================

#
# Variable tests from Randy Dunlap's testset
#
- name: unsigned_long_var_on_uppercase
  description: Test an unsigned long varaible in uppercase
  fname: mock-vars.c
  source: |
    /**
     * var ROOT_DEV - system root device
     *
     * @ROOT_DEV is either the successful root device or the root device
     * that failed boot in the boot failure message.
     */
    unsigned long ROOT_DEV;
  expected:
  - man: |
      .TH "var ROOT_DEV" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      ROOT_DEV \- system root device
      .SH SYNOPSIS
      unsigned long ROOT_DEV;
      .SH "Description"
      \fIROOT_DEV\fP is either the successful root device or the root device
      that failed boot in the boot failure message.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: ROOT_DEV

        ``unsigned long ROOT_DEV;``

        system root device

        **Description**

        **ROOT_DEV** is either the successful root device or the root device
        that failed boot in the boot failure message.
- name: enum_var
  description: Test an enum var with __read_mostly
  fname: mock-vars.c
  source: |
    /**
     * var system_state - system state used during boot or suspend/hibernate/resume
     *
     * @system_state can be used during boot to determine if it is safe to
     * make certain calls to other parts of the kernel. It can also be used
     * during suspend/hibernate or resume to determine the order of actions
     * that need to be executed. The numerical values of system_state are
     * sometimes used in numerical ordering tests, so the relative values
     * must not be altered.
     */
    enum system_states system_state __read_mostly;
  expected:
  - man: |
      .TH "var system_state" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      system_state \- system state used during boot or suspend/hibernate/resume
      .SH SYNOPSIS
      enum system_states system_state __read_mostly;
      .SH "Description"
      \fIsystem_state\fP can be used during boot to determine if it is safe to
      make certain calls to other parts of the kernel. It can also be used
      during suspend/hibernate or resume to determine the order of actions
      that need to be executed. The numerical values of system_state are
      sometimes used in numerical ordering tests, so the relative values
      must not be altered.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: system_state

        ``enum system_states system_state __read_mostly;``

        system state used during boot or suspend/hibernate/resume

        **Description**

        **system_state** can be used during boot to determine if it is safe to
        make certain calls to other parts of the kernel. It can also be used
        during suspend/hibernate or resume to determine the order of actions
        that need to be executed. The numerical values of system_state are
        sometimes used in numerical ordering tests, so the relative values
        must not be altered.
- name: char_pointer_var
  description: Test char * var with __ro_after_init
  fname: mock-vars.c
  source: |
    /**
     * var saved_command_line - kernel's command line, saved from use at
     * any later time in the kernel.
     */
    char *saved_command_line __ro_after_init;
  expected:
  - man: |
      .TH "var saved_command_line" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      saved_command_line \- kernel's command line, saved from use at any later time in the kernel.
      .SH SYNOPSIS
      char *saved_command_line __ro_after_init;
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: saved_command_line

        ``char *saved_command_line __ro_after_init;``

        kernel's command line, saved from use at any later time in the kernel.
- name: unsigned_long_with_default
  description: Test an unsigned long var that is set to a default value
  fname: mock-vars.c
  source: |
    /**
     * var loop_per_jiffy - calculated loop count needed to consume one jiffy
     * of time
     */
    unsigned long loops_per_jiffy = (1<<12);
  expected:
  - man: |
      .TH "var loops_per_jiffy" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      loops_per_jiffy \- calculated loop count needed to consume one jiffy of time
      .SH SYNOPSIS
      unsigned long loops_per_jiffy = (1<<12);
      .SH "Initialization"
      default: (1<<12)
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: loops_per_jiffy

        ``unsigned long loops_per_jiffy = (1<<12);``

        calculated loop count needed to consume one jiffy of time

        **Initialization**

        default: ``(1<<12)``
- name: unsigned_long
  description: test a simple unsigned long variable.
  fname: mock-vars.c
  source: |
    /**
     * var preset_lpj - lpj (loops per jiffy) value set from kernel
     * command line using "lpj=VALUE"
     *
     * See Documentation/admin-guide/kernel-parameters.txt ("lpj=") for details.
     */
    unsigned long preset_lpj;
  expected:
  - man: |
      .TH "var preset_lpj" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      preset_lpj \- lpj (loops per jiffy) value set from kernel command line using "lpj=VALUE"
      .SH SYNOPSIS
      unsigned long preset_lpj;
      .SH "Description"
      See Documentation/admin-guide/kernel-parameters.txt ("lpj=") for details.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: preset_lpj

        ``unsigned long preset_lpj;``

        lpj (loops per jiffy) value set from kernel command line using "lpj=VALUE"

        **Description**

        See Documentation/admin-guide/kernel-parameters.txt ("lpj=") for details.
- name: char_array
  description: test a char array variable
  fname: mock-vars.c
  source: |
    /**
     * var linux_proc_banner - text used from /proc/version file
     *
     * * first %s is sysname (e.g., "Linux")
     * * second %s is release
     * * third %s is version
     */
    char linux_proc_banner[];
  expected:
  - man: |
      .TH "var linux_proc_banner" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      linux_proc_banner \- text used from /proc/version file
      .SH SYNOPSIS
      char linux_proc_banner[];
      .SH "Description"
      .IP \[bu]
      first s is sysname (e.g., "Linux")
      .IP \[bu]
      second s is release
      .IP \[bu]
      third s is version
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: linux_proc_banner

        ``char linux_proc_banner[];``

        text used from /proc/version file

        **Description**

        * first ``s`` is sysname (e.g., "Linux")
        * second ``s`` is release
        * third ``s`` is version
- name: const_char_array
  description: test a const char array variable
  fname: mock-vars.c
  source: |
    /**
     * var linux_banner - Linux boot banner, usually printed at boot time
     */
    const char linux_banner[];
  expected:
  - man: |
      .TH "var linux_banner" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      linux_banner \- Linux boot banner, usually printed at boot time
      .SH SYNOPSIS
      const char linux_banner[];
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: linux_banner

        ``const char linux_banner[];``

        Linux boot banner, usually printed at boot time
- name: static_atomic64_t_var
  description: test a static atomi64_t variable
  fname: mock-vars.c
  source: |
    /**
     * var diskseq - unique sequence number for block device instances
     *
     * Allows userspace to associate uevents to the lifetime of a device
     */
    static atomic64_t diskseq;
  expected:
  - man: |
      .TH "var diskseq" 9 "February 2026"  "" "Kernel API Manual"
      .SH NAME
      diskseq \- unique sequence number for block device instances
      .SH SYNOPSIS
      static atomic64_t diskseq;
      .SH "Description"
      Allows userspace to associate uevents to the lifetime of a device
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock-vars.c\fR
    rst: |
      .. c:macro:: diskseq

        ``static atomic64_t diskseq;``

        unique sequence number for block device instances

        **Description**

        Allows userspace to associate uevents to the lifetime of a device
- name: unsigned_long_on_init
  description: test an unsigned long var at "init" with a different timestamp.
  fname: init/mock-vars.c
  source: |
    /**
     * var rtnl_mutex - historical global lock for networking control operations.
     *
     * @rtnl_mutex is used to serialize rtnetlink requests
     * and protect all kernel internal data structures related to networking.
     *
     * See Documentation/networking/netdevices.rst for details.
     * Often known as the rtnl_lock, although rtnl_lock is a kernel function.
     */
    unsigned long rtnl_mutex;
  expected:
  - man: |
      .TH "var rtnl_mutex" 9 "February 2026"  "init" "Kernel API Manual"
      .SH NAME
      rtnl_mutex \- historical global lock for networking control operations.
      .SH SYNOPSIS
      unsigned long rtnl_mutex;
      .SH "Description"
      \fIrtnl_mutex\fP is used to serialize rtnetlink requests
      and protect all kernel internal data structures related to networking.
      .PP

      See Documentation/networking/netdevices.rst for details.
      Often known as the rtnl_lock, although rtnl_lock is a kernel function.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBinit/mock-vars.c\fR
    rst: |
      .. c:macro:: rtnl_mutex

        ``unsigned long rtnl_mutex;``

      historical global lock for networking control operations.

      **Description**

      **rtnl_mutex** is used to serialize rtnetlink requests
      and protect all kernel internal data structures related to networking.

      See Documentation/networking/netdevices.rst for details.
      Often known as the rtnl_lock, although rtnl_lock is a kernel function.


- name: struct_kcov
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * struct kcov - kcov descriptor (one per opened debugfs file).
     * State transitions of the descriptor:
     *
     *  - initial state after open()
     *  - then there must be a single ioctl(KCOV_INIT_TRACE) call
     *  - then, mmap() call (several calls are allowed but not useful)
     *  - then, ioctl(KCOV_ENABLE, arg), where arg is
     *      KCOV_TRACE_PC - to trace only the PCs
     *      or
     *      KCOV_TRACE_CMP - to trace only the comparison operands
     *  - then, ioctl(KCOV_DISABLE) to disable the task.
     *
     * Enabling/disabling ioctls can be repeated (only one task a time allowed).
     */
    struct kcov {
            /**
             * @refcount: Reference counter. We keep one for:
             *  - opened file descriptor
             *  - task with enabled coverage (we can't unwire it from another task)
             *  - each code section for remote coverage collection
             */
            refcount_t              refcount;
            /**
             * @lock: The lock protects mode, size, area and t.
             */
            spinlock_t              lock;
            /**
             * @mode: the kcov_mode
             */
            enum kcov_mode          mode __guarded_by(&lock);
            /**
             * @size: Size of arena (in long's).
             */
            unsigned int            size __guarded_by(&lock);
            /**
             * @area: Coverage buffer shared with user space.
             */
            void                    *area __guarded_by(&lock);
            /**
             * @t: Task for which we collect coverage, or NULL.
             */
            struct task_struct      *t __guarded_by(&lock);
            /**
             * @remote: Collecting coverage from remote (background) threads.
             */
            bool                    remote;
            /**
             * @remote_size: Size of remote area (in long's).
             */
            unsigned int            remote_size;
            /**
             * @sequence: Sequence is incremented each time kcov is reenabled,
             * used by kcov_remote_stop(), see the comment there.
             */
            int                     sequence;
    };
  expected:
  - man: |
      .TH "struct kcov" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      struct kcov \- kcov descriptor (one per opened debugfs file). State transitions of the descriptor:
      .SH SYNOPSIS
      struct kcov {
      .br
      .BI "    refcount_t refcount;"
      .br
      .BI "    spinlock_t lock;"
      .br
      .BI "    enum kcov_mode          mode;"
      .br
      .BI "    unsigned int            size;"
      .br
      .BI "    void *area;"
      .br
      .BI "    struct task_struct      *t;"
      .br
      .BI "    bool remote;"
      .br
      .BI "    unsigned int            remote_size;"
      .br
      .BI "    int sequence;"
      .br
      .BI "
      };
      .br

      .SH Members
      .IP "refcount" 12
      Reference counter. We keep one for:
      .IP \[bu]
      opened file descriptor
      .IP \[bu]
      task with enabled coverage (we can't unwire it from another task)
      .IP \[bu]
      each code section for remote coverage collection
      .IP "lock" 12
      The lock protects mode, size, area and t.
      .IP "mode" 12
      the kcov_mode
      .IP "size" 12
      Size of arena (in long's).
      .IP "area" 12
      Coverage buffer shared with user space.
      .IP "t" 12
      Task for which we collect coverage, or NULL.
      .IP "remote" 12
      Collecting coverage from remote (background) threads.
      .IP "remote_size" 12
      Size of remote area (in long's).
      .IP "sequence" 12
      Sequence is incremented each time kcov is reenabled,
      used by \fBkcov_remote_stop\fP, see the comment there.
      .SH "Description"
      .IP \[bu]
      initial state after \fBopen\fP
      .IP \[bu]
      then there must be a single ioctl(KCOV_INIT_TRACE) call
      .IP \[bu]
      then, \fBmmap\fP call (several calls are allowed but not useful)
      .IP \[bu]
      then, ioctl(KCOV_ENABLE, arg), where arg is
      KCOV_TRACE_PC - to trace only the PCs
      or
      KCOV_TRACE_CMP - to trace only the comparison operands
      .IP \[bu]
      then, ioctl(KCOV_DISABLE) to disable the task.
      .PP

      Enabling/disabling ioctls can be repeated (only one task a time allowed).
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:struct:: kcov

        kcov descriptor (one per opened debugfs file). State transitions of the descriptor:

      .. container:: kernelindent

        **Definition**::

          struct kcov {
              refcount_t refcount;
              spinlock_t lock;
              enum kcov_mode          mode;
              unsigned int            size;
              void *area;
              struct task_struct      *t;
              bool remote;
              unsigned int            remote_size;
              int sequence;
          };

        **Members**

        ``refcount``
          Reference counter. We keep one for:
           - opened file descriptor
           - task with enabled coverage (we can't unwire it from another task)
           - each code section for remote coverage collection

        ``lock``
          The lock protects mode, size, area and t.

        ``mode``
          the kcov_mode

        ``size``
          Size of arena (in long's).

        ``area``
          Coverage buffer shared with user space.

        ``t``
          Task for which we collect coverage, or NULL.

        ``remote``
          Collecting coverage from remote (background) threads.

        ``remote_size``
          Size of remote area (in long's).

        ``sequence``
          Sequence is incremented each time kcov is reenabled,
          used by kcov_remote_stop(), see the comment there.


       **Description**

       - initial state after open()
       - then there must be a single ioctl(KCOV_INIT_TRACE) call
       - then, mmap() call (several calls are allowed but not useful)
       - then, ioctl(KCOV_ENABLE, arg), where arg is
           KCOV_TRACE_PC - to trace only the PCs
           or
           KCOV_TRACE_CMP - to trace only the comparison operands
       - then, ioctl(KCOV_DISABLE) to disable the task.

       Enabling/disabling ioctls can be repeated (only one task a time allowed).

- name: pool_offset
  description: mock_tests/kdoc-drop-ctx-lock.c line 83
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * var pool_offset - Offset to the unused space in the currently used pool.
     *
     */
    size_t pool_offset __guarded_by(&pool_lock) = DEPOT_POOL_SIZE;
  expected:
  - man: |
      .TH "var pool_offset" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      pool_offset \- Offset to the unused space in the currently used pool.
      .SH SYNOPSIS
      size_t pool_offset __guarded_by(&pool_lock) = DEPOT_POOL_SIZE;
      .SH "Initialization"
      default: DEPOT_POOL_SIZE
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:macro:: pool_offset

        ``size_t pool_offset __guarded_by(&pool_lock) = DEPOT_POOL_SIZE;``

        Offset to the unused space in the currently used pool.

        **Initialization**

        default: ``DEPOT_POOL_SIZE``
- name: free_stacks
  description: mock_tests/kdoc-drop-ctx-lock.c line 88
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * var free_stacks - Freelist of stack records within stack_pools.
     *
     */
    __guarded_by(&pool_lock) LIST_HEAD(free_stacks);
  expected:
  - man: |
      .TH "var free_stacks" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      free_stacks \- Freelist of stack records within stack_pools.
      .SH SYNOPSIS
      __guarded_by(&pool_lock) LIST_HEAD(free_stacks);
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:macro:: free_stacks

        ``__guarded_by(&pool_lock) LIST_HEAD(free_stacks);``

        Freelist of stack records within stack_pools.
- name: stack_pools
  description: mock_tests/kdoc-drop-ctx-lock.c line 94
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * var stack_pools - Array of memory regions that store stack records.
     *
     */
    void **stack_pools __pt_guarded_by(&pool_lock);
  expected:
  - man: |
      .TH "var stack_pools" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      stack_pools \- Array of memory regions that store stack records.
      .SH SYNOPSIS
      void **stack_pools __pt_guarded_by(&pool_lock);
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:macro:: stack_pools

        ``void **stack_pools __pt_guarded_by(&pool_lock);``

        Array of memory regions that store stack records.
- name: prepare_report_consumer
  description: mock_tests/kdoc-drop-ctx-lock.c line 103
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * prepare_report_consumer - prepare the report consumer
     * @flags: flags
     * @ai: not that AI
     * @other_info: yes that
     */
    bool prepare_report_consumer(unsigned long *flags,
                                const struct access_info *ai,
                                struct other_info *other_info)
            __cond_acquires(true, &report_lock)
    {
  expected:
  - man: |
      .TH "prepare_report_consumer" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      prepare_report_consumer \- prepare the report consumer
      .SH SYNOPSIS
      .B "bool" prepare_report_consumer
      .BI "(unsigned long *flags "  ","
      .BI "const struct access_info *ai "  ","
      .BI "struct other_info *other_info "  ");"
      .SH ARGUMENTS
      .IP "flags" 12
      flags
      .IP "ai" 12
      not that AI
      .IP "other_info" 12
      yes that
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: bool prepare_report_consumer (unsigned long *flags, const struct access_info *ai, struct other_info *other_info)

         prepare the report consumer

      .. container:: kernelindent

        **Parameters**

        ``unsigned long *flags``
          flags

        ``const struct access_info *ai``
          not that AI

        ``struct other_info *other_info``
          yes that
- name: tcp_sigpool_start
  description: mock_tests/kdoc-drop-ctx-lock.c line 117
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * tcp_sigpool_start - start a tcp message of @id, using @c
     * @id: TCP message ID
     * @c: the &tcp_sigpool to use
     */
    int tcp_sigpool_start(unsigned int id, struct tcp_sigpool *c) __cond_acquires(0, RCU_BH)
    {
  expected:
  - man: |
      .TH "tcp_sigpool_start" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      tcp_sigpool_start \- start a tcp message of @id, using @c
      .SH SYNOPSIS
      .B "int" tcp_sigpool_start
      .BI "(unsigned int id "  ","
      .BI "struct tcp_sigpool *c "  ");"
      .SH ARGUMENTS
      .IP "id" 12
      TCP message ID
      .IP "c" 12
      the \fItcp_sigpool\fP to use
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: int tcp_sigpool_start (unsigned int id, struct tcp_sigpool *c)

         start a tcp message of **id**, using **c**

      .. container:: kernelindent

        **Parameters**

        ``unsigned int id``
          TCP message ID

        ``struct tcp_sigpool *c``
          the :c:type:`tcp_sigpool` to use
- name: undo_report_consumer
  description: mock_tests/kdoc-drop-ctx-lock.c line 129
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * undo_report_consumer -  teardown a report consumer
     * @flags: those flags
     * @ai: not that AI
     * @other_info: yes that
     */
    bool undo_report_consumer(unsigned long *flags,
                                const struct access_info *ai,
                                struct other_info *other_info)
            __cond_releases(true, &report_lock)
    {
  expected:
  - man: |
      .TH "undo_report_consumer" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      undo_report_consumer \- teardown a report consumer
      .SH SYNOPSIS
      .B "bool" undo_report_consumer
      .BI "(unsigned long *flags "  ","
      .BI "const struct access_info *ai "  ","
      .BI "struct other_info *other_info "  ");"
      .SH ARGUMENTS
      .IP "flags" 12
      those flags
      .IP "ai" 12
      not that AI
      .IP "other_info" 12
      yes that
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: bool undo_report_consumer (unsigned long *flags, const struct access_info *ai, struct other_info *other_info)

         teardown a report consumer

      .. container:: kernelindent

        **Parameters**

        ``unsigned long *flags``
          those flags

        ``const struct access_info *ai``
          not that AI

        ``struct other_info *other_info``
          yes that
- name: debugfs_enter_cancellation
  description: mock_tests/kdoc-drop-ctx-lock.c line 143
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * debugfs_enter_cancellation - begin a cancellation operation on @file
     * @file: the target file
     * @cancellation: the operation to execute
     */
    void debugfs_enter_cancellation(struct file *file,
                                    struct debugfs_cancellation *cancellation) __acquires(cancellation)
    { }
  expected:
  - man: |
      .TH "debugfs_enter_cancellation" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      debugfs_enter_cancellation \- begin a cancellation operation on @file
      .SH SYNOPSIS
      .B "void" debugfs_enter_cancellation
      .BI "(struct file *file "  ","
      .BI "struct debugfs_cancellation *cancellation "  ");"
      .SH ARGUMENTS
      .IP "file" 12
      the target file
      .IP "cancellation" 12
      the operation to execute
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void debugfs_enter_cancellation (struct file *file, struct debugfs_cancellation *cancellation)

         begin a cancellation operation on **file**

      .. container:: kernelindent

        **Parameters**

        ``struct file *file``
          the target file

        ``struct debugfs_cancellation *cancellation``
          the operation to execute
- name: debugfs_leave_cancellation
  description: mock_tests/kdoc-drop-ctx-lock.c line 152
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * debugfs_leave_cancellation - wrapup the cancellation operation on @file
     * @file: the target file
     * @cancellation: the operation to wrapup
     */
    void debugfs_leave_cancellation(struct file *file,
                                    struct debugfs_cancellation *cancellation) __releases(cancellation)
    { }
  expected:
  - man: |
      .TH "debugfs_leave_cancellation" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      debugfs_leave_cancellation \- wrapup the cancellation operation on @file
      .SH SYNOPSIS
      .B "void" debugfs_leave_cancellation
      .BI "(struct file *file "  ","
      .BI "struct debugfs_cancellation *cancellation "  ");"
      .SH ARGUMENTS
      .IP "file" 12
      the target file
      .IP "cancellation" 12
      the operation to wrapup
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void debugfs_leave_cancellation (struct file *file, struct debugfs_cancellation *cancellation)

         wrapup the cancellation operation on **file**

      .. container:: kernelindent

        **Parameters**

        ``struct file *file``
          the target file

        ``struct debugfs_cancellation *cancellation``
          the operation to wrapup
- name: acpi_os_acquire_lock
  description: mock_tests/kdoc-drop-ctx-lock.c line 161
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * acpi_os_acquire_lock - Acquire a spinlock.
     * @lockp: pointer to the spinlock_t.
     */
    acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock lockp)
            __acquires(lockp)
    {
  expected:
  - man: |
      .TH "acpi_os_acquire_lock" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      acpi_os_acquire_lock \- Acquire a spinlock.
      .SH SYNOPSIS
      .B "acpi_cpu_flags" acpi_os_acquire_lock
      .BI "(acpi_spinlock lockp "  ");"
      .SH ARGUMENTS
      .IP "lockp" 12
      pointer to the spinlock_t.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: acpi_cpu_flags acpi_os_acquire_lock (acpi_spinlock lockp)

         Acquire a spinlock.

      .. container:: kernelindent

        **Parameters**

        ``acpi_spinlock lockp``
          pointer to the spinlock_t.
- name: acpi_os_release_lock
  description: mock_tests/kdoc-drop-ctx-lock.c line 172
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * acpi_os_release_lock - Release a spinlock.
     * @lockp: pointer to the spinlock_t.
     * @not_used: these flags are not used.
     */
    void acpi_os_release_lock(acpi_spinlock lockp, acpi_cpu_flags not_used)
            __releases(lockp)
    {
  expected:
  - man: |
      .TH "acpi_os_release_lock" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      acpi_os_release_lock \- Release a spinlock.
      .SH SYNOPSIS
      .B "void" acpi_os_release_lock
      .BI "(acpi_spinlock lockp "  ","
      .BI "acpi_cpu_flags not_used "  ");"
      .SH ARGUMENTS
      .IP "lockp" 12
      pointer to the spinlock_t.
      .IP "not_used" 12
      these flags are not used.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void acpi_os_release_lock (acpi_spinlock lockp, acpi_cpu_flags not_used)

         Release a spinlock.

      .. container:: kernelindent

        **Parameters**

        ``acpi_spinlock lockp``
          pointer to the spinlock_t.

        ``acpi_cpu_flags not_used``
          these flags are not used.
- name: tx
  description: mock_tests/kdoc-drop-ctx-lock.c line 183
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * tx - transmit message ID @id
     * @id: message ID to transmit
     */
    int tx(int id) __must_hold(&txlock)
    {
  expected:
  - man: |
      .TH "tx" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      tx \- transmit message ID @id
      .SH SYNOPSIS
      .B "int" tx
      .BI "(int id "  ");"
      .SH ARGUMENTS
      .IP "id" 12
      message ID to transmit
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: int tx (int id)

         transmit message ID **id**

      .. container:: kernelindent

        **Parameters**

        ``int id``
          message ID to transmit
- name: contend_for_bm
  description: mock_tests/kdoc-drop-ctx-lock.c line 192
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * contend_for_bm - try to become the bus master
     * @card: the &fw_card (describes the bus)
     */
    enum bm_contention_outcome contend_for_bm(struct fw_card *card)
        __must_hold(&card->lock)
    {
  expected:
  - man: |
      .TH "contend_for_bm" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      contend_for_bm \- try to become the bus master
      .SH SYNOPSIS
      .B "enum bm_contention_outcome" contend_for_bm
      .BI "(struct fw_card *card "  ");"
      .SH ARGUMENTS
      .IP "card" 12
      the \fIfw_card\fP (describes the bus)
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: enum bm_contention_outcome contend_for_bm (struct fw_card *card)

         try to become the bus master

      .. container:: kernelindent

        **Parameters**

        ``struct fw_card *card``
          the :c:type:`fw_card` (describes the bus)
- name: prepare_report_producer
  description: mock_tests/kdoc-drop-ctx-lock.c line 202
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * prepare_report_producer - prepare the report producer
     * @flags: still flags
     * @ai: some AI
     * @other_info: Populate @other_info; requires that the provided
     *   @other_info not in use.
     */
    void prepare_report_producer(unsigned long *flags,
                                const struct access_info *ai,
                                struct other_info *other_info)
            __must_not_hold(&report_lock)
    { }
  expected:
  - man: |
      .TH "prepare_report_producer" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      prepare_report_producer \- prepare the report producer
      .SH SYNOPSIS
      .B "void" prepare_report_producer
      .BI "(unsigned long *flags "  ","
      .BI "const struct access_info *ai "  ","
      .BI "struct other_info *other_info "  ");"
      .SH ARGUMENTS
      .IP "flags" 12
      still flags
      .IP "ai" 12
      some AI
      .IP "other_info" 12
      Populate \fIother_info\fP; requires that the provided
      \fIother_info\fP not in use.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void prepare_report_producer (unsigned long *flags, const struct access_info *ai, struct other_info *other_info)

         prepare the report producer

      .. container:: kernelindent

        **Parameters**

        ``unsigned long *flags``
          still flags

        ``const struct access_info *ai``
          some AI

        ``struct other_info *other_info``
          Populate **other_info**; requires that the provided
          **other_info** not in use.
- name: crypto_alg_lookup
  description: mock_tests/kdoc-drop-ctx-lock.c line 215
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * __crypto_alg_lookup() - lookup the algorithm by name/type/mask
     * @name: name to search for
     * @type: type to search for
     * @mask: mask to match
     */
    struct crypto_alg *__crypto_alg_lookup(const char *name, u32 type,
                                                  u32 mask)
            __must_hold_shared(&crypto_alg_sem)
    {
  expected:
  - man: |
      .TH "__crypto_alg_lookup" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      __crypto_alg_lookup \- lookup the algorithm by name/type/mask
      .SH SYNOPSIS
      .B "struct crypto_alg *" __crypto_alg_lookup
      .BI "(const char *name "  ","
      .BI "u32 type "  ","
      .BI "u32 mask "  ");"
      .SH ARGUMENTS
      .IP "name" 12
      name to search for
      .IP "type" 12
      type to search for
      .IP "mask" 12
      mask to match
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: struct crypto_alg * __crypto_alg_lookup (const char *name, u32 type, u32 mask)

         lookup the algorithm by name/type/mask

      .. container:: kernelindent

        **Parameters**

        ``const char *name``
          name to search for

        ``u32 type``
          type to search for

        ``u32 mask``
          mask to match
- name: down_read_trylock
  description: mock_tests/kdoc-drop-ctx-lock.c line 228
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * down_read_trylock - trylock for reading
     * @sem: the semaphore to try to lock
     *
     * Returns: 1 if successful, 0 if contention
     */
    extern int down_read_trylock(struct rw_semaphore *sem) __cond_acquires_shared(true, sem);
  expected:
  - man: |
      .TH "down_read_trylock" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      down_read_trylock \- trylock for reading
      .SH SYNOPSIS
      .B "int" down_read_trylock
      .BI "(struct rw_semaphore *sem "  ");"
      .SH ARGUMENTS
      .IP "sem" 12
      the semaphore to try to lock
      .SH "RETURN"
      1 if successful, 0 if contention
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: int down_read_trylock (struct rw_semaphore *sem)

         trylock for reading

      .. container:: kernelindent

        **Parameters**

        ``struct rw_semaphore *sem``
          the semaphore to try to lock

        **Return**

        1 if successful, 0 if contention
- name: tomoyo_read_lock
  description: mock_tests/kdoc-drop-ctx-lock.c line 236
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * tomoyo_read_lock - Take lock for protecting policy.
     *
     * Returns: index number for tomoyo_read_unlock().
     */
    int tomoyo_read_lock(void)
            __acquires_shared(&tomoyo_ss)
    {
  expected:
  - man: |
      .TH "tomoyo_read_lock" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      tomoyo_read_lock \- Take lock for protecting policy.
      .SH SYNOPSIS
      .B "int" tomoyo_read_lock
      .BI "(void "  ");"
      .SH ARGUMENTS
      .IP "void" 12
      no arguments
      .SH "RETURN"
      index number for \fBtomoyo_read_unlock\fP.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: int tomoyo_read_lock (void)

         Take lock for protecting policy.

      .. container:: kernelindent

        **Parameters**

        ``void``
          no arguments

        **Return**

        index number for tomoyo_read_unlock().
- name: tomoyo_read_unlock
  description: mock_tests/kdoc-drop-ctx-lock.c line 247
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * tomoyo_read_unlock - Release lock for protecting policy.
     *
     * @idx: Index number returned by tomoyo_read_lock().
     */
    void tomoyo_read_unlock(int idx)
            __releases_shared(&tomoyo_ss)
    { }
  expected:
  - man: |
      .TH "tomoyo_read_unlock" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      tomoyo_read_unlock \- Release lock for protecting policy.
      .SH SYNOPSIS
      .B "void" tomoyo_read_unlock
      .BI "(int idx "  ");"
      .SH ARGUMENTS
      .IP "idx" 12
      Index number returned by \fBtomoyo_read_lock\fP.
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void tomoyo_read_unlock (int idx)

         Release lock for protecting policy.

      .. container:: kernelindent

        **Parameters**

        ``int idx``
          Index number returned by tomoyo_read_lock().
- name: c_stop
  description: mock_tests/kdoc-drop-ctx-lock.c line 256
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * c_stop - stop the seq_file iteration
     * @m: the &struct seq_file
     * @p: handle
     */
    void c_stop(struct seq_file *m, void *p)
            __releases_shared(&crypto_alg_sem)
    { }
  expected:
  - man: |
      .TH "c_stop" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      c_stop \- stop the seq_file iteration
      .SH SYNOPSIS
      .B "void" c_stop
      .BI "(struct seq_file *m "  ","
      .BI "void *p "  ");"
      .SH ARGUMENTS
      .IP "m" 12
      the \fIstruct seq_file\fP
      .IP "p" 12
      handle
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void c_stop (struct seq_file *m, void *p)

         stop the seq_file iteration

      .. container:: kernelindent

        **Parameters**

        ``struct seq_file *m``
          the :c:type:`struct seq_file <seq_file>`

        ``void *p``
          handle
- name: spin_lock
  description: mock_tests/kdoc-drop-ctx-lock.c line 265
  fname: mock_tests/kdoc-drop-ctx-lock.c
  source: |
    /**
     * spin_lock - spin until the @lock is acquired
     * @lock: the spinlock
     */
    void spin_lock(spinlock_t *lock)
            __acquires(lock) __no_context_analysis
    { }
  expected:
  - man: |
      .TH "spin_lock" 9 "February 2026"  "mock_tests" "Kernel API Manual"
      .SH NAME
      spin_lock \- spin until the @lock is acquired
      .SH SYNOPSIS
      .B "void" spin_lock
      .BI "(spinlock_t *lock "  ");"
      .SH ARGUMENTS
      .IP "lock" 12
      the spinlock
      .SH "SEE ALSO"
      .PP
      Kernel file \fBmock_tests/kdoc-drop-ctx-lock.c\fR
    rst: |
      .. c:function:: void spin_lock (spinlock_t *lock)

         spin until the **lock** is acquired

      .. container:: kernelindent

        **Parameters**

        ``spinlock_t *lock``
          the spinlock