A hydraulic system of a rock drilling rig comprising: at least one hydraulic circuit (CL, OL) provided with a hydraulic power unit (Pu) comprising a hydraulic pump (Hp) driven by means of a motor; at least one hydraulic drilling actuator (Ha) powered by hydraulic pressure and flow generated by the mentioned hydraulic power unit (Pu); wherein the hydraulic system is provided with a safety function feature for limiting features of the input hydraulic fluid directed to the mentioned at least one hydraulic drilling actuator (Ha) for temporarily limiting output performance of the hydraulic drilling actuator (Ha); and the hydraulic system is provided with at least one control unit comprising at least one restricted operating mode serving as the mentioned safety function feature and configured to limit magnitude of output flow of the pumping unit (Pu) whereby motion speed of the hydraulic drilling actuator (Ha) is limited due to received limited magnitude of input flow, characterized in that the hydraulic pump (Hp) is a fixed displacement hydraulic pump driven by means of an electric motor; the electric motor is controlled by means of at least one electrical motor control device (Mc); and the control unit is configured to control the electrical motor control device (Mc) for controlling rotation speed of the electric motor and the hydraulic pump (Hp); wherein the motor is a speed controlled electric motor controlled by means of variable frequency drive serving as the electrical motor control device (Mc) the mentioned variable frequency drive comprises an integrated safety function based on hard wired safety circuit; and the limited output flow of the hydraulic fluid is implemented under control of the control unit in response to the selected restricted operating mode. at least one hydraulic circuit (CL, OL) provided with a hydraulic power unit (Pu) comprising a hydraulic pump (Hp) driven by means of a motor; at least one hydraulic drilling actuator (Ha) powered by hydraulic pressure and flow generated by the mentioned hydraulic power unit (Pu); wherein the hydraulic system is provided with a safety function feature for limiting features of the input hydraulic fluid directed to the mentioned at least one hydraulic drilling actuator (Ha) for temporarily limiting output performance of the hydraulic drilling actuator (Ha); and the hydraulic system is provided with at least one control unit comprising at least one restricted operating mode serving as the mentioned safety function feature and configured to limit magnitude of output flow of the pumping unit (Pu) whereby motion speed of the hydraulic drilling actuator (Ha) is limited due to received limited magnitude of input flow, characterized in that the hydraulic pump (Hp) is a fixed displacement hydraulic pump driven by means of an electric motor; the electric motor is controlled by means of at least one electrical motor control device (Mc); and the control unit is configured to control the electrical motor control device (Mc) for controlling rotation speed of the electric motor and the hydraulic pump (Hp); wherein the motor is a speed controlled electric motor controlled by means of variable frequency drive serving as the electrical motor control device (Mc) the mentioned variable frequency drive comprises an integrated safety function based on hard wired safety circuit; and the limited output flow of the hydraulic fluid is implemented under control of the control unit in response to the selected restricted operating mode.