New/Usr/Src/Cmd/Intrd/Makefile
Total Page:16
File Type:pdf, Size:1020Kb
new/usr/src/cmd/intrd/Makefile 1 ********************************************************** 1267 Thu Jul 11 19:18:53 2013 new/usr/src/cmd/intrd/Makefile XXX Rearchitect and replace interrupt distribution ********************************************************** 1 # 2 # CDDL HEADER START 3 # 4 # The contents of this file are subject to the terms of the 5 # Common Development and Distribution License (the "License"). 6 # You may not use this file except in compliance with the License. 7 # 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 # or http://www.opensolaris.org/os/licensing. 10 # See the License for the specific language governing permissions 11 # and limitations under the License. 12 # 13 # When distributing Covered Code, include this CDDL HEADER in each 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 # If applicable, add the following below this CDDL HEADER, with the 16 # fields enclosed by brackets "[]" replaced with your own identifying 17 # information: Portions Copyright [yyyy] [name of copyright owner] 18 # 19 # CDDL HEADER END 20 # 22 # 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 # Use is subject to license terms. 25 # 26 # Makefile for interrupt distribution daemon 27 # 29 PROG= intrd 29 MANIFEST= intrd.xml 30 SVCMETHOD= svc-intrd 32 include ../Makefile.cmd 34 TARGET= all 36 ROOTMANIFESTDIR= $(ROOTSVCSYSTEM) 38 # install macros and rule 39 # 41 ROOTPROG= $(ROOTLIB)/$(PROG) 42 $(ROOTPROG) := FILEMODE= 555 41 .KEEP_STATE: 43 all: $(PROG) 45 install: all .WAIT $(ROOTMANIFEST) $(ROOTSVCMETHOD) 48 install: all .WAIT $(ROOTPROG) $(ROOTMANIFEST) $(ROOTSVCMETHOD) 47 clean: 49 check: $(CHKMANIFEST) 51 ${ROOTLIB}/%: % 52 ${INS.file} 54 lint: 56 include ../Makefile.targ new/usr/src/cmd/intrd/intrd.xml 1 new/usr/src/cmd/intrd/intrd.xml 2 ********************************************************** 59 type='method' 2189 Thu Jul 11 19:18:53 2013 60 name='stop' new/usr/src/cmd/intrd/intrd.xml 61 exec='/lib/svc/method/svc-intrd stop' XXX Rearchitect and replace interrupt distribution 63 exec=':kill' ********************************************************** 62 timeout_seconds='10' /> 1 <?xml version="1.0"?> 2 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> 64 <property_group name='startd' type='framework'> 3 <!-- 65 <propval name='duration' type='astring' value='transient' /> 4 CDDL HEADER START 66 </property_group> 6 The contents of this file are subject to the terms of the 68 #endif /* ! codereview */ 7 Common Development and Distribution License, Version 1.0 only 69 <stability value='Unstable' /> 8 (the "License"). You may not use this file except in compliance 9 with the License. 71 <template> 72 <common_name> 11 You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 73 <loctext xml:lang='C'> interrupt balancer 12 or http://www.opensolaris.org/os/licensing. 74 </loctext> 13 See the License for the specific language governing permissions 75 </common_name> 14 and limitations under the License. 76 <documentation> 77 <manpage title='intrd' section='1M' 16 When distributing Covered Code, include this CDDL HEADER in each 78 manpath='/usr/share/man' /> 17 file and include the License file at usr/src/OPENSOLARIS.LICENSE. 79 </documentation> 18 If applicable, add the following below this CDDL HEADER, with the 80 </template> 19 fields enclosed by brackets "[]" replaced with your own identifying 81 </service> 20 information: Portions Copyright [yyyy] [name of copyright owner] 83 </service_bundle> 22 CDDL HEADER END 24 Copyright 2005 Sun Microsystems, Inc. All rights reserved. 25 Use is subject to license terms. 27 ident "%Z%%M% %I% %E% SMI" 27 NOTE: This service manifest is not editable; its contents will 28 be overwritten by package or patch operations, including 29 operating system upgrade. Make customizations in a different 30 file. 31 --> 33 <service_bundle type='manifest' name='SUNWckr:intrd'> 35 <service 36 name='system/intrd' 37 type='service' 38 version='1'> 40 <create_default_instance enabled='false' /> 42 <single_instance/> 44 <dependency 45 name='milestone' 46 grouping='require_all' 47 restart_on='none' 48 type='service'> 49 <service_fmri value='svc:/milestone/multi-user' /> 50 </dependency> 52 <exec_method 53 type='method' 54 name='start' 55 exec='/lib/svc/method/svc-intrd start' 57 exec='/lib/svc/method/svc-intrd' 56 timeout_seconds='60' /> 58 <exec_method new/usr/src/cmd/intrd/svc-intrd 1 ********************************************************** 1113 Thu Jul 11 19:18:53 2013 new/usr/src/cmd/intrd/svc-intrd XXX Rearchitect and replace interrupt distribution ********************************************************** 1 #!/sbin/sh 2 # 3 # CDDL HEADER START 4 # 5 # The contents of this file are subject to the terms of the 6 # Common Development and Distribution License, Version 1.0 only 7 # (the "License"). You may not use this file except in compliance 8 # with the License. 9 # 10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11 # or http://www.opensolaris.org/os/licensing. 12 # See the License for the specific language governing permissions 13 # and limitations under the License. 14 # 15 # When distributing Covered Code, include this CDDL HEADER in each 16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17 # If applicable, add the following below this CDDL HEADER, with the 18 # fields enclosed by brackets "[]" replaced with your own identifying 19 # information: Portions Copyright [yyyy] [name of copyright owner] 20 # 21 # CDDL HEADER END 22 # 24 # 25 # Copyright 2005 Sun Microsystems, Inc. All rights reserved. 26 # Use is subject to license terms. 27 # 28 # ident "%Z%%M% %I% %E% SMI" 29 . /lib/svc/share/smf_include.sh 31 # 32 # Main 33 # 34 case "$1" in 35 'start') 36 #/sbin/uadmin 24 1 >/dev/null 2>&1 37 ;; 38 'stop') 39 #/sbin/uadmin 24 0 >/dev/null 2>&1 40 ;; 41 esac; 32 # Don't start intrd if intrd can't be found or if intrd is already running. 43 exit $SMF_EXIT_OK 34 if [ ! -f /usr/lib/intrd ]; then 35 echo "$0: intrd daemon not installed" 36 exit $SMF_EXIT_ERR_CONFIG 37 fi 39 if /usr/bin/pgrep -x -z global intrd >/dev/null; then 40 echo "$0: intrd is already running" 41 exit $SMF_EXIT_ERR_FATAL 42 fi 44 /usr/lib/intrd & new/usr/src/cmd/uadmin/uadmin.c 1 new/usr/src/cmd/uadmin/uadmin.c 2 ********************************************************** 62 int cmd, fcn; 10595 Thu Jul 11 19:18:54 2013 63 uintptr_t mdep = NULL; new/usr/src/cmd/uadmin/uadmin.c 64 sigset_t set; XXX Rearchitect and replace interrupt distribution 65 adt_session_data_t *ah; /* audit session handle */ ********************************************************** 66 adt_event_data_t *event = NULL; /* event to be generated */ 1 /* 67 au_event_t event_id; 2 * CDDL HEADER START 68 enum adt_uadmin_fcn fcn_id; 3 * 4 * The contents of this file are subject to the terms of the 70 if (argc < 3 || argc > 4) { 5 * Common Development and Distribution License (the "License"). 71 (void) fprintf(stderr, Usage, argv[0]); 6 * You may not use this file except in compliance with the License. 72 return (1); 7 * 73 } 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 75 (void) sigfillset(&set); 10 * See the License for the specific language governing permissions 76 (void) sigprocmask(SIG_BLOCK, &set, NULL); 11 * and limitations under the License. 12 * 78 cmd = atoi(argv[1]); 13 * When distributing Covered Code, include this CDDL HEADER in each 79 fcn = atoi(argv[2]); 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 80 if (argc == 4) { /* mdep argument given */ 15 * If applicable, add the following below this CDDL HEADER, with the 81 if (cmd != A_REBOOT && cmd != A_SHUTDOWN && cmd != A_DUMP && 16 * fields enclosed by brackets "[]" replaced with your own identifying 82 cmd != A_FREEZE) { 17 * information: Portions Copyright [yyyy] [name of copyright owner] 83 (void) fprintf(stderr, "%s: mdep argument not " 18 * 84 "allowed for this cmd value\n", argv[0]); 19 * CDDL HEADER END 85 (void) fprintf(stderr, Usage, argv[0]); 20 */ 86 return (1); 21 /* 87 } else { 22 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 88 mdep = (uintptr_t)argv[3]; 23 */ 89 } 90 } 25 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 26 /* All Rights Reserved */ 92 /* set up audit session and event */ 93 if (adt_start_session(&ah, NULL, ADT_USE_PROC_DATA) != 0) { 94 (void) fprintf(stderr, "%s: can't start audit session\n", 95 argv[0]); 30 #include <errno.h> 96 } 31 #include <fcntl.h> 97 switch (cmd) { 32 #include <stdio.h> 98 case A_SHUTDOWN: 33 #include <stdlib.h> 99 event_id = ADT_uadmin_shutdown; 34 #include <string.h> 100 break; 35 #include <strings.h> 101 case A_REBOOT: 36 #include <signal.h> 102 event_id = ADT_uadmin_reboot; 37 #include <unistd.h> 103 break; 38 #ifdef __i386 104 case A_DUMP: 39 #include <libscf_priv.h> 105 event_id = ADT_uadmin_dump; 40 #endif /* __i386 */ 106 break; 107 case A_REMOUNT: 42 #include <bsm/adt.h> 108 event_id = ADT_uadmin_remount; 43 #include <bsm/adt_event.h> 109 break; 110 case A_FREEZE: 45 #include <sys/types.h> 111 event_id = ADT_uadmin_freeze; 46 #include <sys/uadmin.h> 112 break; 47 #include <sys/wait.h> 113 case A_FTRACE: 114 event_id = ADT_uadmin_ftrace; 49 #define SMF_RST "/etc/svc/volatile/resetting" 115 break; 50 #define RETRY_COUNT 15 /* number of 1 sec retries for audit(1M) to complete */ 116 case A_CONFIG: 117 event_id = ADT_uadmin_config; 52 static const char *Usage