Print this page
    
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/i86pc/ml/comm_page.s
          +++ new/usr/src/uts/i86pc/ml/comm_page.s
   1    1  
   2    2  /*
   3    3   * This file and its contents are supplied under the terms of the
   4    4   * Common Development and Distribution License ("CDDL"), version 1.0.
   5    5   * You may only use this file in accordance with the terms of version
   6    6   * 1.0 of the CDDL.
   7    7   *
   8    8   * A full copy of the text of the CDDL should have accompanied this
   9    9   * source.  A copy of the CDDL is also available via the Internet at
  10   10   * http://www.illumos.org/license/CDDL.
  11   11   */
  12   12  
  13   13  /*
  14   14   * Copyright 2016 Joyent, Inc.
  15   15   */
  16   16  
  17   17  #include <sys/asm_linkage.h>
  18   18  #include <sys/asm_misc.h>
  19   19  #include <sys/param.h>
  20   20  #include <sys/comm_page.h>
  21   21  #include <sys/tsc.h>
  22   22  
  23   23  #if defined(_GENCTF) || defined(__lint)
  24   24  
  25   25  hrtime_t tsc_last;
  26   26  hrtime_t tsc_resume_cap;
  27   27  hrtime_t tsc_hrtime_base;
  28   28  uint32_t tsc_max_delta;
  29   29  volatile uint32_t hres_lock;
  30   30  uint32_t tsc_type;
  31   31  uint32_t nsec_scale;
  32   32  int64_t hrestime_adj;
  33   33  hrtime_t hres_last_tick;
  34   34  uint32_t tsc_ncpu;
  35   35  volatile timestruc_t hrestime;
  36   36  hrtime_t tsc_sync_tick_delta[NCPU];
  37   37  
  38   38  comm_page_t comm_page;
  39   39  
  40   40  #else /* defined(_GENCTF) || defined(__lint) */
  41   41  
  42   42  #include "assym.h"
  43   43  
  44   44  /*
  45   45   * x86 Comm Page
  46   46   *
  47   47   * This is the definition for the comm page on x86.  The purpose of this struct
  48   48   * is to consolidate certain pieces of kernel state into one contiguous section
  49   49   * of memory in order for it to be exposed (read-only) to userspace.  The
  50   50   * struct contents are defined by hand so that member variables will maintain
  51   51   * their original symbols for use throughout the rest of the kernel.  This
  52   52   * layout must exactly match the C definition of comm_page_t.
  53   53   * See: "uts/i86pc/sys/comm_page.h"
  54   54   */
  55   55  
  56   56          .data
  57   57          DGDEF3(comm_page, COMM_PAGE_S_SIZE, 4096)
  58   58          DGDEF2(tsc_last, 8)
  59   59          .fill   1, 8, 0
  60   60          DGDEF2(tsc_hrtime_base, 8)
  61   61          .fill   1, 8, 0
  62   62          DGDEF2(tsc_resume_cap, 8)
  63   63          .fill   1, 8, 0
  64   64          DGDEF2(tsc_type, 4);
  65   65          .fill   1, 4, _CONST(TSC_RDTSC_CPUID)
  66   66          DGDEF2(tsc_max_delta, 4);
  67   67          .fill   1, 4, 0
  68   68          DGDEF2(hres_lock, 4);
  69   69          .fill   1, 4, 0
  70   70          DGDEF2(nsec_scale, 4);
  71   71          .fill   1, 4, 0
  72   72          DGDEF2(hrestime_adj, 8)
  73   73          .fill   1, 8, 0
  74   74          DGDEF2(hres_last_tick, 8)
  75   75          .fill   1, 8, 0
  76   76          DGDEF2(tsc_ncpu, 4)
  77   77          .fill   1, 4, 0
  78   78          /* _cp_pad */
  79   79          .fill   1, 4, 0
  80   80          DGDEF2(hrestime, _MUL(2, 8))
  81   81          .fill   2, 8, 0
  82   82          DGDEF2(tsc_sync_tick_delta, _MUL(NCPU, 8))
  83   83          .fill   _CONST(NCPU), 8, 0
  84   84  
  85   85          /* pad out the rest of the page from the struct end */
  86   86          .fill   _CONST(COMM_PAGE_SIZE - COMM_PAGE_S_SIZE), 1, 0
  87   87  
  88   88  #endif /* defined(_GENCTF) || defined(__lint) */
  
    | 
      ↓ open down ↓ | 
    88 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX