1# 2# Copyright (C) 2019 The Android Open-Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17# 18# This file inherits from init.${ro.boot.hardware.platform}.rc plus additional 19# configs only used by XR targets. 20# 21import /vendor/etc/init/hw/init.${ro.boot.hardware.platform}.common.rc 22 23on init 24 # Setup cpusets used by the VR services. 25 mkdir /dev/cpuset/kernel 0750 root system 26 write /dev/cpuset/kernel/cpus 0 27 write /dev/cpuset/kernel/mems 0 28 chown system system /dev/cpuset/kernel/tasks 29 chown system system /dev/cpuset/kernel/cpus 30 chmod 0660 /dev/cpuset/kernel/tasks 31 chmod 0660 /dev/cpuset/kernel/cpus 32 33 mkdir /dev/cpuset/system 0750 root system 34 write /dev/cpuset/system/cpus 0 35 write /dev/cpuset/system/mems 0 36 chown system system /dev/cpuset/system/tasks 37 chmod 0660 /dev/cpuset/system/tasks 38 39 mkdir /dev/cpuset/system/performance 0750 root system 40 write /dev/cpuset/system/performance/cpus 0 41 write /dev/cpuset/system/performance/mems 0 42 chown system system /dev/cpuset/system/performance/tasks 43 chmod 0660 /dev/cpuset/system/performance/tasks 44 45 mkdir /dev/cpuset/system/background 0750 root system 46 write /dev/cpuset/system/background/cpus 0 47 write /dev/cpuset/system/background/mems 0 48 chown system system /dev/cpuset/system/background/tasks 49 chmod 0660 /dev/cpuset/system/background/tasks 50 51 mkdir /dev/cpuset/application 0750 root system 52 write /dev/cpuset/application/cpus 0 53 write /dev/cpuset/application/mems 0 54 chown system system /dev/cpuset/application/tasks 55 chmod 0660 /dev/cpuset/application/tasks 56 57 mkdir /dev/cpuset/application/performance 0750 root system 58 write /dev/cpuset/application/performance/cpus 0 59 write /dev/cpuset/application/performance/mems 0 60 chown system system /dev/cpuset/application/performance/tasks 61 chmod 0660 /dev/cpuset/application/performance/tasks 62 63 mkdir /dev/cpuset/application/background 0750 root system 64 write /dev/cpuset/application/background/cpus 0 65 write /dev/cpuset/application/background/mems 0 66 chown system system /dev/cpuset/application/background/tasks 67 chmod 0660 /dev/cpuset/application/background/tasks 68 69 # Create UDS structure for base VR services. 70 mkdir /dev/socket/pdx 0775 system system 71 mkdir /dev/socket/pdx/system 0775 system system 72 mkdir /dev/socket/pdx/system/buffer_hub 0775 system system 73 mkdir /dev/socket/pdx/system/performance 0775 system system 74 mkdir /dev/socket/pdx/system/vr 0775 system system 75 mkdir /dev/socket/pdx/system/vr/display 0775 system system 76 mkdir /dev/socket/pdx/system/vr/pose 0775 system system 77 mkdir /dev/socket/pdx/system/vr/sensors 0775 system system 78 79on boot 80 # Update DVR cpusets to boot-time values. 81 write /dev/cpuset/kernel/cpus 0-7 82 write /dev/cpuset/system/cpus 0-7 83 write /dev/cpuset/system/performance/cpus 0-7 84 write /dev/cpuset/system/background/cpus 0-7 85 write /dev/cpuset/system/cpus 0-7 86 write /dev/cpuset/application/cpus 0-7 87 write /dev/cpuset/application/performance/cpus 0-7 88 write /dev/cpuset/application/background/cpus 0-7 89 write /dev/cpuset/application/cpus 0-7 90 91on property:sys.boot_completed=1 92 # Update DVR cpusets to runtime values. 93 # Kernel cpuset will be apply on PowerHAL 94 write /dev/cpuset/system/performance/cpus 6-7 95 write /dev/cpuset/system/background/cpus 0-1 96 write /dev/cpuset/system/cpus 0-1,6-7 97 write /dev/cpuset/application/performance/cpus 4-5 98 write /dev/cpuset/application/background/cpus 0-1 99 write /dev/cpuset/application/cpus 0-1,4-5 100