Print this page
OS-2366 ddi_periodic_add(9F) is entirely rubbish

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/startup.c
          +++ new/usr/src/uts/i86pc/os/startup.c
↓ open down ↓ 2237 lines elided ↑ open up ↑
2238 2238          sti();
2239 2239  #if defined(__xpv)
2240 2240          ASSERT(CPU->cpu_m.mcpu_vcpu_info->evtchn_upcall_mask == 0);
2241 2241          xen_late_startup();
2242 2242  #endif
2243 2243  
2244 2244          (void) add_avsoftintr((void *)&softlevel1_hdl, 1, softlevel1,
2245 2245              "softlevel1", NULL, NULL); /* XXX to be moved later */
2246 2246  
2247 2247          /*
2248      -         * Register these software interrupts for ddi timer.
     2248 +         * Register software interrupt handlers for ddi_periodic_add(9F).
2249 2249           * Software interrupts up to the level 10 are supported.
2250 2250           */
2251 2251          for (i = DDI_IPL_1; i <= DDI_IPL_10; i++) {
2252      -                char name[sizeof ("timer_softintr") + 2];
2253      -                (void) sprintf(name, "timer_softintr%02d", i);
     2252 +                /*
     2253 +                 * The constant string "ddi_periodic", below, is only used to
     2254 +                 * print debugging information.  Generating a dynamic string
     2255 +                 * for each soft level is a waste of kernel memory.
     2256 +                 */
2254 2257                  (void) add_avsoftintr((void *)&softlevel_hdl[i-1], i,
2255      -                    (avfunc)timer_softintr, name, (caddr_t)(uintptr_t)i, NULL);
     2258 +                    (avfunc)ddi_periodic_softintr, "ddi_periodic",
     2259 +                    (caddr_t)(uintptr_t)i, NULL);
2256 2260          }
2257 2261  
2258 2262  #if !defined(__xpv)
2259 2263          if (modload("drv", "amd_iommu") < 0) {
2260 2264                  PRM_POINT("No AMD IOMMU present\n");
2261 2265          } else if (ddi_hold_installed_driver(ddi_name_to_major(
2262 2266              "amd_iommu")) == NULL) {
2263 2267                  prom_printf("ERROR: failed to attach AMD IOMMU\n");
2264 2268          }
2265 2269  #endif
↓ open down ↓ 971 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX