Print this page
6154 const-ify segment ops structures

@@ -472,11 +472,11 @@
                  * the insertion point is immediately before seg.
                  */
                 if (base + seg->s_size > addr) {
                         if (addr >= base || eaddr > base) {
 #ifdef __sparc
-                                extern struct seg_ops segnf_ops;
+                                extern const struct seg_ops segnf_ops;
 
                                 /*
                                  * no-fault segs must disappear if overlaid.
                                  * XXX need new segment type so
                                  * we don't have to check s_ops

@@ -880,13 +880,10 @@
         struct seg *segsav;
         int as_lock_held;
         klwp_t *lwp = ttolwp(curthread);
         int is_xhat = 0;
         int holding_wpage = 0;
-        extern struct seg_ops   segdev_ops;
-
-
 
         if (as->a_hat != hat) {
                 /* This must be an XHAT then */
                 is_xhat = 1;
 

@@ -2086,11 +2083,11 @@
  * We're lazy and only return one segment at a time.
  */
 int
 as_memory(struct as *as, caddr_t *basep, size_t *lenp)
 {
-        extern struct seg_ops segspt_shmops;    /* needs a header file */
+        extern const struct seg_ops segspt_shmops; /* needs a header file */
         struct seg *seg;
         caddr_t addr, eaddr;
         caddr_t segend;
 
         AS_LOCK_ENTER(as, &as->a_lock, RW_READER);

@@ -2190,11 +2187,11 @@
          * Call the swapout routines of all segments in the address
          * space to do the actual work, accumulating the amount of
          * space reclaimed.
          */
         for (seg = AS_SEGFIRST(as); seg != NULL; seg = AS_SEGNEXT(as, seg)) {
-                struct seg_ops *ov = seg->s_ops;
+                const struct seg_ops *ov = seg->s_ops;
 
                 /*
                  * We have to check to see if the seg has
                  * an ops vector because the seg may have
                  * been in the middle of being set up when

@@ -2630,11 +2627,11 @@
         page_t **pl;
         int error;
         caddr_t eaddr;
         faultcode_t fault_err = 0;
         pgcnt_t pl_off;
-        extern struct seg_ops segspt_shmops;
+        extern const struct seg_ops segspt_shmops;
 
         ASSERT(AS_LOCK_HELD(as, &as->a_lock));
         ASSERT(seg != NULL);
         ASSERT(addr >= seg->s_base && addr < seg->s_base + seg->s_size);
         ASSERT(addr + size > seg->s_base + seg->s_size);