repo_name
stringlengths
4
116
path
stringlengths
3
942
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
gokudomatic/godot
scene/resources/multimesh.h
3184
/*************************************************************************/ /* multimesh.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef MULTIMESH_H #define MULTIMESH_H #include "scene/resources/mesh.h" class MultiMesh : public Resource { OBJ_TYPE( MultiMesh, Resource ); RES_BASE_EXTENSION("mmsh"); AABB aabb; Ref<Mesh> mesh; RID multimesh; protected: static void _bind_methods(); void _set_transform_array(const DVector<Vector3>& p_array); DVector<Vector3> _get_transform_array() const; void _set_color_array(const DVector<Color>& p_array); DVector<Color> _get_color_array() const; public: void set_mesh(const Ref<Mesh>& p_mesh); Ref<Mesh> get_mesh() const; void set_instance_count(int p_count); int get_instance_count() const; void set_instance_transform(int p_instance, const Transform& p_transform); Transform get_instance_transform(int p_instance) const; void set_instance_color(int p_instance, const Color& p_color); Color get_instance_color(int p_instance) const; void set_aabb(const AABB& p_aabb); virtual AABB get_aabb() const; void generate_aabb(); virtual RID get_rid() const; MultiMesh(); ~MultiMesh(); }; #endif // MULTI_MESH_H
mit
danwalmsley/Perspex
src/Perspex.HtmlRenderer/Adapters/FontAdapter.cs
2736
// "Therefore those skilled at the unorthodox // are infinite as heaven and earth, // inexhaustible as the great rivers. // When they come to an end, // they begin again, // like the days and months; // they die and are reborn, // like the four seasons." // // - Sun Tsu, // "The Art of War" using Perspex.Media; using TheArtOfDev.HtmlRenderer.Adapters; using TheArtOfDev.HtmlRenderer.Adapters.Entities; namespace TheArtOfDev.HtmlRenderer.Perspex.Adapters { /// <summary> /// Adapter for Perspex Font. /// </summary> internal sealed class FontAdapter : RFont { public RFontStyle Style { get; } #region Fields and Consts /// <summary> /// the size of the font /// </summary> private readonly double _size; /// <summary> /// the vertical offset of the font underline location from the top of the font. /// </summary> private readonly double _underlineOffset = -1; /// <summary> /// Cached font height. /// </summary> private readonly double _height = -1; /// <summary> /// Cached font whitespace width. /// </summary> private double _whitespaceWidth = -1; #endregion /// <summary> /// Init. /// </summary> public FontAdapter(string fontFamily, double size, RFontStyle style) { Style = style; Name = fontFamily; _size = size; //TODO: Somehow get proper line spacing and underlinePosition var lineSpacing = 1; var underlinePosition = 0; _height = 96d / 72d * _size * lineSpacing; _underlineOffset = 96d / 72d * _size * (lineSpacing + underlinePosition); } public string Name { get; set; } public override double Size { get { return _size; } } public override double UnderlineOffset { get { return _underlineOffset; } } public override double Height { get { return _height; } } public override double LeftPadding { get { return _height / 6f; } } public override double GetWhitespaceWidth(RGraphics graphics) { if (_whitespaceWidth < 0) { _whitespaceWidth = graphics.MeasureString(" ", this).Width; } return _whitespaceWidth; } public FontStyle FontStyle => Style.HasFlag(RFontStyle.Italic) ? FontStyle.Italic : FontStyle.Normal; public FontWeight Weight => Style.HasFlag(RFontStyle.Bold) ? FontWeight.Bold : FontWeight.Normal; } }
mit
claudiobm/ClockingIT-In-CapellaDesign
vendor/plugins/test_spec_on_rails/lib/generators/model/templates/unit_test.rb
233
require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' describe "<%= class_name %>", ActiveSupport::TestCase do # Replace this with your real tests. it "should be true" do assert true end end
mit
mandino/hotelmilosantabarbara.com
wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option-wpseo.php
10210
<?php /** * WPSEO plugin file. * * @package WPSEO\Internals\Options */ /** * Option: wpseo. */ class WPSEO_Option_Wpseo extends WPSEO_Option { /** * @var string Option name. */ public $option_name = 'wpseo'; /** * @var array Array of defaults for the option. * Shouldn't be requested directly, use $this->get_defaults(); */ protected $defaults = array( // Non-form fields, set via (ajax) function. 'ms_defaults_set' => false, // Non-form field, should only be set via validation routine. 'version' => '', // Leave default as empty to ensure activation/upgrade works. // Form fields. 'disableadvanced_meta' => true, 'onpage_indexability' => true, 'baiduverify' => '', // Text field. 'googleverify' => '', // Text field. 'msverify' => '', // Text field. 'yandexverify' => '', 'site_type' => '', // List of options. 'has_multiple_authors' => '', 'environment_type' => '', 'content_analysis_active' => true, 'keyword_analysis_active' => true, 'enable_admin_bar_menu' => true, 'enable_cornerstone_content' => true, 'enable_xml_sitemap' => true, 'enable_text_link_counter' => true, 'show_onboarding_notice' => false, 'first_activated_on' => false, 'recalibration_beta' => false, ); /** * @var array Sub-options which should not be overloaded with multi-site defaults. */ public $ms_exclude = array( /* Privacy. */ 'baiduverify', 'googleverify', 'msverify', 'yandexverify', ); /** @var array Possible values for the site_type option. */ protected $site_types = array( '', 'blog', 'shop', 'news', 'smallBusiness', 'corporateOther', 'personalOther', ); /** @var array Possible environment types. */ protected $environment_types = array( '', 'production', 'staging', 'development', ); /** @var array Possible has_multiple_authors options. */ protected $has_multiple_authors_options = array( '', true, false, ); /** * @var string Name for an option higher in the hierarchy to override setting access. */ protected $override_option_name = 'wpseo_ms'; /** * Add the actions and filters for the option. * * @todo [JRF => testers] Check if the extra actions below would run into problems if an option * is updated early on and if so, change the call to schedule these for a later action on add/update * instead of running them straight away. * * @return \WPSEO_Option_Wpseo */ protected function __construct() { parent::__construct(); /* Clear the cache on update/add. */ add_action( 'add_option_' . $this->option_name, array( 'WPSEO_Utils', 'clear_cache' ) ); add_action( 'update_option_' . $this->option_name, array( 'WPSEO_Utils', 'clear_cache' ) ); /** * Filter the `wpseo` option defaults. * * @param array $defaults Array the defaults for the `wpseo` option attributes. */ $this->defaults = apply_filters( 'wpseo_option_wpseo_defaults', $this->defaults ); } /** * Get the singleton instance of this class. * * @return object */ public static function get_instance() { if ( ! ( self::$instance instanceof self ) ) { self::$instance = new self(); } return self::$instance; } /** * Add filters to make sure that the option is merged with its defaults before being returned. * * @return void */ public function add_option_filters() { parent::add_option_filters(); list( $hookname, $callback, $priority ) = $this->get_verify_features_option_filter_hook(); if ( has_filter( $hookname, $callback ) === false ) { add_filter( $hookname, $callback, $priority ); } } /** * Remove the option filters. * Called from the clean_up methods to make sure we retrieve the original old option. * * @return void */ public function remove_option_filters() { parent::remove_option_filters(); list( $hookname, $callback, $priority ) = $this->get_verify_features_option_filter_hook(); remove_filter( $hookname, $callback, $priority ); } /** * Add filters to make sure that the option default is returned if the option is not set. * * @return void */ public function add_default_filters() { parent::add_default_filters(); list( $hookname, $callback, $priority ) = $this->get_verify_features_default_option_filter_hook(); if ( has_filter( $hookname, $callback ) === false ) { add_filter( $hookname, $callback, $priority ); } } /** * Remove the default filters. * Called from the validate() method to prevent failure to add new options. * * @return void */ public function remove_default_filters() { parent::remove_default_filters(); list( $hookname, $callback, $priority ) = $this->get_verify_features_default_option_filter_hook(); remove_filter( $hookname, $callback, $priority ); } /** * Validate the option. * * @param array $dirty New value for the option. * @param array $clean Clean value for the option, normally the defaults. * @param array $old Old value of the option. * * @return array Validated clean value for the option to be saved to the database. */ protected function validate_option( $dirty, $clean, $old ) { foreach ( $clean as $key => $value ) { switch ( $key ) { case 'version': $clean[ $key ] = WPSEO_VERSION; break; /* Verification strings. */ case 'baiduverify': case 'googleverify': case 'msverify': case 'yandexverify': $this->validate_verification_string( $key, $dirty, $old, $clean ); break; /* * Boolean dismiss warnings - not fields - may not be in form * (and don't need to be either as long as the default is false). */ case 'ms_defaults_set': if ( isset( $dirty[ $key ] ) ) { $clean[ $key ] = WPSEO_Utils::validate_bool( $dirty[ $key ] ); } elseif ( isset( $old[ $key ] ) ) { $clean[ $key ] = WPSEO_Utils::validate_bool( $old[ $key ] ); } break; case 'site_type': $clean[ $key ] = $old[ $key ]; if ( isset( $dirty[ $key ] ) && in_array( $dirty[ $key ], $this->site_types, true ) ) { $clean[ $key ] = $dirty[ $key ]; } break; case 'environment_type': $clean[ $key ] = $old[ $key ]; if ( isset( $dirty[ $key ] ) && in_array( $dirty[ $key ], $this->environment_types, true ) ) { $clean[ $key ] = $dirty[ $key ]; } break; case 'has_multiple_authors': $clean[ $key ] = $old[ $key ]; if ( isset( $dirty[ $key ] ) && in_array( $dirty[ $key ], $this->has_multiple_authors_options, true ) ) { $clean[ $key ] = $dirty[ $key ]; } break; case 'first_activated_on': $clean[ $key ] = false; if ( isset( $dirty[ $key ] ) ) { if ( $dirty[ $key ] === false || WPSEO_Utils::validate_int( $dirty[ $key ] ) ) { $clean[ $key ] = $dirty[ $key ]; } } break; /* * Boolean (checkbox) fields. */ /* * Covers: * 'disableadvanced_meta' * 'yoast_tracking' */ default: $clean[ $key ] = ( isset( $dirty[ $key ] ) ? WPSEO_Utils::validate_bool( $dirty[ $key ] ) : false ); break; } } return $clean; } /** * Verifies that the feature variables are turned off if the network is configured so. * * @param mixed $options Value of the option to be returned. Typically an array. * * @return mixed Filtered $options value. */ public function verify_features_against_network( $options = array() ) { if ( ! is_array( $options ) || empty( $options ) ) { return $options; } // For the feature variables, set their values to off in case they are disabled. $feature_vars = array( 'disableadvanced_meta' => false, 'onpage_indexability' => false, 'content_analysis_active' => false, 'keyword_analysis_active' => false, 'enable_admin_bar_menu' => false, 'enable_cornerstone_content' => false, 'enable_xml_sitemap' => false, 'enable_text_link_counter' => false, ); // We can reuse this logic from the base class with the above defaults to parse with the correct feature values. $options = $this->prevent_disabled_options_update( $options, $feature_vars ); return $options; } /** * Gets the filter hook name and callback for adjusting the retrieved option value against the network-allowed features. * * @return array Array where the first item is the hook name, the second is the hook callback, * and the third is the hook priority. */ protected function get_verify_features_option_filter_hook() { return array( "option_{$this->option_name}", array( $this, 'verify_features_against_network' ), 11, ); } /** * Gets the filter hook name and callback for adjusting the default option value against the network-allowed features. * * @return array Array where the first item is the hook name, the second is the hook callback, * and the third is the hook priority. */ protected function get_verify_features_default_option_filter_hook() { return array( "default_option_{$this->option_name}", array( $this, 'verify_features_against_network' ), 11, ); } /** * Clean a given option value. * * @param array $option_value Old (not merged with defaults or filtered) option value to * clean according to the rules for this option. * @param string $current_version Optional. Version from which to upgrade, if not set, * version specific upgrades will be disregarded. * @param array $all_old_option_values Optional. Only used when importing old options to have * access to the real old values, in contrast to the saved ones. * * @return array Cleaned option. */ protected function clean_option( $option_value, $current_version = null, $all_old_option_values = null ) { return $option_value; } }
mit
RallySoftware/eclipselink.runtime
utils/eclipselink.utils.workbench.test/utility/source/org/eclipse/persistence/tools/workbench/test/utility/events/ReflectiveListChangeListenerTests.java
22586
/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation from Oracle TopLink ******************************************************************************/ package org.eclipse.persistence.tools.workbench.test.utility.events; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.eclipse.persistence.tools.workbench.utility.AbstractModel; import org.eclipse.persistence.tools.workbench.utility.ClassTools; import org.eclipse.persistence.tools.workbench.utility.CollectionTools; import org.eclipse.persistence.tools.workbench.utility.events.CollectionChangeListener; import org.eclipse.persistence.tools.workbench.utility.events.ListChangeEvent; import org.eclipse.persistence.tools.workbench.utility.events.ListChangeListener; import org.eclipse.persistence.tools.workbench.utility.events.ReflectiveChangeListener; import org.eclipse.persistence.tools.workbench.utility.iterators.CloneListIterator; public class ReflectiveListChangeListenerTests extends TestCase { public static Test suite() { return new TestSuite(ReflectiveListChangeListenerTests.class); } public ReflectiveListChangeListenerTests(String name) { super(name); } private ListChangeListener buildZeroArgumentListener(Object target) { return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedZeroArgument", "itemRemovedZeroArgument", "itemReplacedZeroArgument", "listChangedZeroArgument"); } private ListChangeListener buildSingleArgumentListener(Object target) { return ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument", "itemRemovedSingleArgument", "itemReplacedSingleArgument", "listChangedSingleArgument"); } public void testItemAddedZeroArgument() { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(this.buildZeroArgumentListener(target)); testModel.addString(string); assertTrue(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemAddedZeroArgumentNamedList() { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target)); testModel.addString(string); assertTrue(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemAddedSingleArgument() { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(this.buildSingleArgumentListener(target)); testModel.addString(string); assertFalse(target.itemAddedZeroArgumentFlag); assertTrue(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemAddedSingleArgumentNamedList() { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target)); testModel.addString(string); assertFalse(target.itemAddedZeroArgumentFlag); assertTrue(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemRemovedZeroArgument() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(this.buildZeroArgumentListener(target)); testModel.removeString(string); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertTrue(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemRemovedZeroArgumentNamedList() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target)); testModel.removeString(string); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertTrue(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemRemovedSingleArgument() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(this.buildSingleArgumentListener(target)); testModel.removeString(string); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertTrue(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemRemovedSingleArgumentNamedList() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target)); testModel.removeString(string); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertTrue(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemReplacedZeroArgument() { TestModel testModel = new TestModel(); String oldString = "foo"; String newString = "bar"; testModel.addString(oldString); Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString); testModel.addListChangeListener(this.buildZeroArgumentListener(target)); testModel.replaceString(oldString, newString); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertTrue(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemReplacedZeroArgumentNamedList() { TestModel testModel = new TestModel(); String oldString = "foo"; String newString = "bar"; testModel.addString(oldString); Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target)); testModel.replaceString(oldString, newString); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertTrue(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemReplacedSingleArgument() { TestModel testModel = new TestModel(); String oldString = "foo"; String newString = "bar"; testModel.addString(oldString); Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString); testModel.addListChangeListener(this.buildSingleArgumentListener(target)); testModel.replaceString(oldString, newString); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertTrue(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testItemReplacedSingleArgumentNamedList() { TestModel testModel = new TestModel(); String oldString = "foo"; String newString = "bar"; testModel.addString(oldString); Target target = new Target(testModel, TestModel.STRINGS_LIST, newString, 0, oldString); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target)); testModel.replaceString(oldString, newString); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertTrue(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testListChangedZeroArgument() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1); testModel.addListChangeListener(this.buildZeroArgumentListener(target)); testModel.replaceAllStrings(new String[] {"bar", "baz"}); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertTrue(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testListChangedZeroArgumentNamedList() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildZeroArgumentListener(target)); testModel.replaceAllStrings(new String[] {"bar", "baz"}); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertTrue(target.listChangedZeroArgumentFlag); assertFalse(target.listChangedSingleArgumentFlag); } public void testListChangedSingleArgument() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1); testModel.addListChangeListener(this.buildSingleArgumentListener(target)); testModel.replaceAllStrings(new String[] {"bar", "baz"}); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertTrue(target.listChangedSingleArgumentFlag); } public void testListChangedSingleArgumentNamedList() { TestModel testModel = new TestModel(); String string = "foo"; testModel.addString(string); Target target = new Target(testModel, TestModel.STRINGS_LIST, null, -1); testModel.addListChangeListener(TestModel.STRINGS_LIST, this.buildSingleArgumentListener(target)); testModel.replaceAllStrings(new String[] {"bar", "baz"}); assertFalse(target.itemAddedZeroArgumentFlag); assertFalse(target.itemAddedSingleArgumentFlag); assertFalse(target.itemRemovedZeroArgumentFlag); assertFalse(target.itemRemovedSingleArgumentFlag); assertFalse(target.itemReplacedZeroArgumentFlag); assertFalse(target.itemReplacedSingleArgumentFlag); assertFalse(target.listChangedZeroArgumentFlag); assertTrue(target.listChangedSingleArgumentFlag); } public void testBogusDoubleArgument1() { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); boolean exCaught = false; try { ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, "listChangedDoubleArgument"); fail("bogus listener: " + listener); } catch (RuntimeException ex) { if (ex.getCause().getClass() == NoSuchMethodException.class) { exCaught = true; } } assertTrue(exCaught); } public void testBogusDoubleArgument2() throws Exception { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); Method method = ClassTools.method(target, "listChangedDoubleArgument", new Class[] {ListChangeEvent.class, Object.class}); boolean exCaught = false; try { ListChangeListener listener = ReflectiveChangeListener.buildListChangeListener(target, method); fail("bogus listener: " + listener); } catch (RuntimeException ex) { if (ex.getMessage().equals(method.toString())) { exCaught = true; } } assertTrue(exCaught); } public void testListenerMismatch() { TestModel testModel = new TestModel(); String string = "foo"; Target target = new Target(testModel, TestModel.STRINGS_LIST, string, 0); // build a LIST change listener and hack it so we // can add it as a COLLECTION change listener Object listener = ReflectiveChangeListener.buildListChangeListener(target, "itemAddedSingleArgument"); testModel.addCollectionChangeListener((CollectionChangeListener) listener); boolean exCaught = false; try { testModel.changeCollection(); fail("listener mismatch: " + listener); } catch (IllegalArgumentException ex) { exCaught = true; } assertTrue(exCaught); } private class TestModel extends AbstractModel { private List strings = new ArrayList(); public static final String STRINGS_LIST = "strings"; TestModel() { super(); } ListIterator strings() { return new CloneListIterator(this.strings); } void addString(String string) { this.addItemToList(string, this.strings, STRINGS_LIST); } void removeString(String string) { this.removeItemFromList(this.strings.indexOf(string), this.strings, STRINGS_LIST); } void replaceString(String oldString, String newString) { this.setItemInList(this.strings.indexOf(oldString), newString, this.strings, STRINGS_LIST); } void replaceAllStrings(String[] newStrings) { this.strings.clear(); CollectionTools.addAll(this.strings, newStrings); this.fireListChanged(STRINGS_LIST); } void changeCollection() { this.fireCollectionChanged("bogus collection"); } } private class Target { TestModel testModel; String listName; String string; int index; String replacedString; boolean itemAddedZeroArgumentFlag = false; boolean itemAddedSingleArgumentFlag = false; boolean itemRemovedZeroArgumentFlag = false; boolean itemRemovedSingleArgumentFlag = false; boolean itemReplacedZeroArgumentFlag = false; boolean itemReplacedSingleArgumentFlag = false; boolean listChangedZeroArgumentFlag = false; boolean listChangedSingleArgumentFlag = false; Target(TestModel testModel, String listName, String string, int index) { super(); this.testModel = testModel; this.listName = listName; this.string = string; this.index = index; } Target(TestModel testModel, String listName, String string, int index, String replacedString) { this(testModel, listName, string, index); this.replacedString = replacedString; } void itemAddedZeroArgument() { this.itemAddedZeroArgumentFlag = true; } void itemAddedSingleArgument(ListChangeEvent e) { this.itemAddedSingleArgumentFlag = true; assertSame(this.testModel, e.getSource()); assertEquals(this.listName, e.getListName()); assertEquals(this.string, e.items().next()); assertEquals(this.index, e.getIndex()); } void itemRemovedZeroArgument() { this.itemRemovedZeroArgumentFlag = true; } void itemRemovedSingleArgument(ListChangeEvent e) { this.itemRemovedSingleArgumentFlag = true; assertSame(this.testModel, e.getSource()); assertEquals(this.listName, e.getListName()); assertEquals(this.string, e.items().next()); assertEquals(this.index, e.getIndex()); } void itemReplacedZeroArgument() { this.itemReplacedZeroArgumentFlag = true; } void itemReplacedSingleArgument(ListChangeEvent e) { this.itemReplacedSingleArgumentFlag = true; assertSame(this.testModel, e.getSource()); assertEquals(this.listName, e.getListName()); assertEquals(this.string, e.items().next()); assertEquals(this.replacedString, e.replacedItems().next()); assertEquals(this.index, e.getIndex()); } void listChangedZeroArgument() { this.listChangedZeroArgumentFlag = true; } void listChangedSingleArgument(ListChangeEvent e) { this.listChangedSingleArgumentFlag = true; assertSame(this.testModel, e.getSource()); assertEquals(this.listName, e.getListName()); assertFalse(e.items().hasNext()); assertEquals(this.index, e.getIndex()); } void listChangedDoubleArgument(ListChangeEvent e, Object o) { fail("bogus event: " + e); } } }
epl-1.0
bartlomiej-laczkowski/che
wsmaster/che-core-api-machine-shared/src/main/java/org/eclipse/che/api/machine/shared/dto/MachineConfigDto.java
2478
/******************************************************************************* * Copyright (c) 2012-2017 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ package org.eclipse.che.api.machine.shared.dto; import org.eclipse.che.api.core.factory.FactoryParameter; import org.eclipse.che.api.core.model.machine.MachineConfig; import org.eclipse.che.api.core.rest.shared.dto.Hyperlinks; import org.eclipse.che.api.core.rest.shared.dto.Link; import org.eclipse.che.dto.shared.DTO; import java.util.List; import java.util.Map; import static org.eclipse.che.api.core.factory.FactoryParameter.Obligation.MANDATORY; import static org.eclipse.che.api.core.factory.FactoryParameter.Obligation.OPTIONAL; /** * @author Alexander Garagatyi */ @DTO public interface MachineConfigDto extends MachineConfig, Hyperlinks { @Override @FactoryParameter(obligation = OPTIONAL) String getName(); void setName(String name); MachineConfigDto withName(String name); @Override @FactoryParameter(obligation = MANDATORY) MachineSourceDto getSource(); void setSource(MachineSourceDto source); MachineConfigDto withSource(MachineSourceDto source); @Override @FactoryParameter(obligation = MANDATORY) boolean isDev(); void setDev(boolean dev); MachineConfigDto withDev(boolean dev); @Override @FactoryParameter(obligation = MANDATORY) String getType(); void setType(String type); MachineConfigDto withType(String type); @Override @FactoryParameter(obligation = OPTIONAL) MachineLimitsDto getLimits(); void setLimits(MachineLimitsDto limits); MachineConfigDto withLimits(MachineLimitsDto limits); @Override List<ServerConfDto> getServers(); void setServers(List<ServerConfDto> servers); MachineConfigDto withServers(List<ServerConfDto> servers); @Override Map<String, String> getEnvVariables(); void setEnvVariables(Map<String, String> envVariables); MachineConfigDto withEnvVariables(Map<String, String> envVariables); @Override MachineConfigDto withLinks(List<Link> links); }
epl-1.0
RallySoftware/eclipselink.runtime
utils/eclipselink.utils.workbench.test/mappingsplugin/source/org/eclipse/persistence/tools/workbench/test/mappingsmodel/query/MWUserDefinedQueryKeyTests.java
2104
/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation from Oracle TopLink ******************************************************************************/ package org.eclipse.persistence.tools.workbench.test.mappingsmodel.query; import org.eclipse.persistence.tools.workbench.test.mappingsmodel.ModelProblemsTestCase; import org.eclipse.persistence.tools.workbench.mappingsmodel.ProblemConstants; import org.eclipse.persistence.tools.workbench.mappingsmodel.db.MWColumn; import org.eclipse.persistence.tools.workbench.mappingsmodel.descriptor.relational.MWUserDefinedQueryKey; import junit.framework.Test; import junit.framework.TestSuite; public class MWUserDefinedQueryKeyTests extends ModelProblemsTestCase { public static Test suite() { return new TestSuite(MWUserDefinedQueryKeyTests.class); } /** * Constructor for MWQueryableTests. * @param name */ public MWUserDefinedQueryKeyTests(String name){ super(name); } public void testFieldExistsProblem() { String problem = ProblemConstants.DESCRIPTOR_QUERY_KEY_NO_COLUMN_SPECIFIED; MWUserDefinedQueryKey qKey = getPersonDescriptor().addQueryKey("qKey", (MWColumn)getPersonDescriptor().getPrimaryTable().columns().next()); assertTrue("The query key should not have the problem: " + problem, !hasProblem(problem, getPersonDescriptor())); qKey.setColumn(null); assertTrue("The query key should have the problem: " + problem, hasProblem(problem, getPersonDescriptor())); } }
epl-1.0
RallySoftware/eclipselink.runtime
jpa/org.eclipse.persistence.jpa.jpql/src/org/eclipse/persistence/jpa/jpql/parser/FunctionsReturningNumericsBNF.java
3120
/******************************************************************************* * Copyright (c) 2006, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation * ******************************************************************************/ package org.eclipse.persistence.jpa.jpql.parser; /** * The query BNF for a function expression returning a numeric value. * <p> * JPA 1.0: * <div><b>BNF:</b> <code>functions_returning_numerics::= LENGTH(string_primary) | * LOCATE(string_primary, string_primary[, simple_arithmetic_expression]) | * ABS(simple_arithmetic_expression) | SQRT(simple_arithmetic_expression) | * MOD(simple_arithmetic_expression, simple_arithmetic_expression) | * SIZE(collection_valued_path_expression)</code><p></div> * * JPA 2.0: * <div><b>BNF:</b> <code>functions_returning_numerics::= LENGTH(string_primary) | * LOCATE(string_primary, string_primary[, simple_arithmetic_expression]) | * ABS(simple_arithmetic_expression) | SQRT(simple_arithmetic_expression) | * MOD(simple_arithmetic_expression, simple_arithmetic_expression) | * SIZE(collection_valued_path_expression) | * INDEX(identification_variable)</code><p></div> * * @version 2.4 * @since 2.3 * @author Pascal Filion */ @SuppressWarnings("nls") public final class FunctionsReturningNumericsBNF extends JPQLQueryBNF { /** * The unique identifier of this BNF rule. */ public static final String ID = "functions_returning_numerics"; /** * Creates a new <code>FunctionsReturningNumericsBNF</code>. */ public FunctionsReturningNumericsBNF() { super(ID); } /** * {@inheritDoc} */ @Override protected void initialize() { super.initialize(); registerExpressionFactory(LengthExpressionFactory.ID); registerExpressionFactory(LocateExpressionFactory.ID); registerExpressionFactory(AbsExpressionFactory.ID); registerExpressionFactory(SqrtExpressionFactory.ID); registerExpressionFactory(ModExpressionFactory.ID); registerExpressionFactory(SizeExpressionFactory.ID); } }
epl-1.0
gameduell/eclipselink.runtime
foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/exceptions/i18n/JPQLExceptionResource.java
8445
/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Oracle - initial API and implementation from Oracle TopLink ******************************************************************************/ package org.eclipse.persistence.exceptions.i18n; import java.util.ListResourceBundle; /** * INTERNAL: * English ResourceBundle for EJBQLException. * */ public class JPQLExceptionResource extends ListResourceBundle { static final Object[][] contents = { { "8001", "Syntax Recognition Problem parsing the query [{0}]. The parser returned the following [{1}]." }, { "8002", "General Problem parsing the query [{0}]. The parser returned the following [{1}]." }, { "8003", "The class [{0}] was not found. The parser returned the following [{1}]." }, { "8004", "Error compiling the query [{0}], line {1}, column {2}: unknown identification variable [{3}]. The FROM clause of the query does not declare an identification variable [{3}]." }, { "8005", "Error compiling the query [{0}]. A problem was encountered resolving the class name - The class [{1}] was not found." }, { "8006", "Error compiling the query [{0}]. A problem was encountered resolving the class name - The descriptor for [{1}] was not found." }, { "8007", "Error compiling the query [{0}]. A problem was encountered resolving the class name - The mapping for [{1}] was not found." }, { "8008", "Error compiling the query [{0}]. A problem was encountered building the query expression - The expressionBuilder for [{1}] was not found." }, { "8009", "Problem compiling the query [{0}]. The expression [{1}] is currently not supported." }, { "8010", "General Problem parsing the query [{0}]." }, { "8011", "Error compiling the query [{0}], line {1}, column {2}: invalid collection member declaration [{3}], expected collection valued association field." }, { "8012", "Problem compiling the query [{0}]. Not yet implemented: {1}." }, { "8013", "Error compiling the query [{0}], line {1}, column {2}: constructor class [{3}] not found." }, { "8014", "Error compiling the query [{0}], line {1}, column {2}: invalid SIZE argument [{3}], expected collection valued association field." }, { "8015", "Error compiling the query [{0}], line {1}, column {2}: invalid enum literal, the enum type {3} does not have an enum literal {4}." }, { "8016", "Error compiling the query [{0}], line {1}, column {2}: invalid SELECT expression [{3}] for query with grouping [{4}]. Only aggregates, GROUP BY items or constructor expressions of these are allowed in the SELECT clause of a GROUP BY query." }, { "8017", "Error compiling the query [{0}], line {1}, column {2}: invalid HAVING expression [{3}] for query with grouping [{4}]. The HAVING clause must specify search conditions over the grouping items or aggregate functions that apply to grouping items." }, { "8018", "Error compiling the query [{0}], line {1}, column {2}: invalid multiple use of parameter [{3}] assuming different parameter types [{4}] and [{5}]." }, { "8019", "Error compiling the query [{0}], line {1}, column {2}: multiple declaration of identification variable [{3}], previously declared as [{4} {3}]." }, { "8020", "Error compiling the query [{0}], line {1}, column {2}: invalid {3} function argument [{4}], expected argument of type [{5}]." }, { "8021", "Error compiling the query [{0}], line {1}, column {2}: invalid ORDER BY item [{3}] of type [{4}], expected expression of an orderable type." }, { "8022", "Error compiling the query [{0}], line {1}, column {2}: invalid {3} expression argument [{4}], expected argument of type [{5}]." }, { "8023", "Syntax error parsing the query [{0}]." }, { "8024", "Syntax error parsing the query [{0}], line {1}, column {2}: syntax error at [{3}]." }, { "8025", "Syntax error parsing the query [{0}], line {1}, column {2}: unexpected token [{3}]." }, { "8026", "Syntax error parsing the query [{0}], line {1}, column {2}: unexpected char [{3}]." }, { "8027", "Syntax error parsing the query [{0}], line {1}, column {2}: expected char [{3}], found [{4}]." }, { "8028", "Syntax error parsing the query [{0}], line {1}, column {2}: unexpected end of query." }, { "8029", "Error compiling the query [{0}], line {1}, column {2}: invalid navigation expression [{3}], cannot navigate expression [{4}] of type [{5}] inside a query." }, { "8030", "Error compiling the query [{0}], line {1}, column {2}: unknown state or association field [{3}] of class [{4}]." }, { "8031", "Error compiling the query [{0}], line {1}, column {2}: {3} of embedded entity {4} is not supported." }, { "8032", "Error compiling the query [{0}], line {1}, column {2}: invalid access of attribute [{3}] in SET clause target [{4}], only state fields and single valued association fields may be updated in a SET clause." }, { "8033", "Error compiling the query [{0}], line {1}, column {2}: invalid navigation expression [{3}], cannot navigate association field [{4}] in the SET clause target." }, { "8034", "Error compiling the query [{0}]. Unknown entity type [{1}]." }, { "8035", "Error compiling the query [{0}], line {1}, column {2}: invalid enum equal expression, cannot compare enum value of type [{3}} with a non enum value of type [{4}]." }, { "8036", "Error compiling the query [{0}], line {1}, column {2}: invalid navigation expression [{3}], cannot navigate collection valued association field [{4}]." }, { "8037", "Error compiling the query [{0}], line {1}, column {2}: Unknown entity type [{3}]." }, { "8038", "Error compiling the query [{0}], line {1}, column {2}: a problem was encountered resolving the class name - The class [{3}] was not found." }, { "8039", "Error compiling the query [{0}], line {1}, column {2}: Variable {3} a not a map and a map key is being requested from it." }, { "8040", "Error compiling the query [{0}], line {1}, column {2}: Alias {3} is used in the ORDER BY clause, but not defined in the query." }, { "8041", "Error compiling the query [{0}], line {1}, column {2}: Index may only be used on a variable and it is being called on non-variable {3}." } }; /** * Return the lookup table. */ protected Object[][] getContents() { return contents; } }
epl-1.0
gameduell/eclipselink.runtime
foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlCustomizer.java
1534
/******************************************************************************* * Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 * which accompanies this distribution. * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * dmccann - August 6/2009 - 2.0 - Initial implementation ******************************************************************************/ package org.eclipse.persistence.oxm.annotations; import java.lang.annotation.Retention; import java.lang.annotation.Target; import org.eclipse.persistence.config.DescriptorCustomizer; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * The XmlCustomizer annotation is used to specify a class that implements the * org.eclipse.persistence.config.DescriptorCustomizer * interface and is to run against a class descriptor after all metadata * processing has been completed. */ @Target({TYPE}) @Retention(RUNTIME) public @interface XmlCustomizer { /** * (Required) Defines the name of the descriptor customizer that should be * applied to this classes descriptor. */ Class<? extends DescriptorCustomizer> value(); }
epl-1.0
lfit/totpcgi
conf/templates/login.html
2073
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Example Company Google Authenticator provisioning</title> <link href="${css_root}provisioning.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="mainwindow" class="login"> <div id="title">Example Company Ltd</div> <div id="mainarea"> <div class="message"> Please log in to obtain your new Google Authenticator secret. </div> <form id="login_form" name="login_form" action="$action_url" method="post"> <table border="0" align="center"> <tr> <td class="fieldname"> <label for="username">Username:</label> </td> <td> <input type="text" id="username" name="username" class="inputfield"/> </td> </tr> <tr> <td class="fieldname"> <label for="pincode">Password:</label> </td> <td> <input type="password" id="pincode" name="pincode" class="inputfield"/> </td> </tr> <tr> <td class="fieldname"></td> <td> <input type="submit" value="Submit &raquo;"/> </td> </tr> </table> </form> </div> <div id="copyright"> Copyright &copy; 2012 by Example Company Ltd </div> </div> </body> </html>
gpl-2.0
epicsdeb/rtems-gdb
gdb/testsuite/gdb.base/cursal.c
865
/* Copyright 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ void func2 () { int v2 = 2; } void func1 () { func2 (); } int main () { int v0 = 0; func1 (); }
gpl-2.0
CG77/ezpublish-legacy
kernel/role/edit.php
30498
<?php /** * @copyright Copyright (C) eZ Systems AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. * @version 2014.11.1 * @package kernel */ $tpl = eZTemplate::factory(); $Module = $Params['Module']; $roleID = $Params['RoleID']; $ini = eZINI::instance( 'module.ini' ); $modules = $ini->variable( 'ModuleSettings', 'ModuleList' ); sort( $modules ); $role = eZRole::fetch( 0, $roleID ); if ( $role === null ) { $role = eZRole::fetch( $roleID ); if ( $role ) { if ( $role->attribute( 'version' ) == '0' ) { $temporaryRole = $role->createTemporaryVersion(); unset( $role ); $role = $temporaryRole; } } else { return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' ); } } $http = eZHTTPTool::instance(); $tpl->setVariable( 'module', $Module ); $role->turnOffCaching(); $tpl->setVariable( 'role', $role ); $Module->setTitle( 'Edit ' . $role->attribute( 'name' ) ); if ( $http->hasPostVariable( 'NewName' ) && $role->attribute( 'name' ) != $http->postVariable( 'NewName' ) ) { $role->setAttribute( 'name' , $http->postVariable( 'NewName' ) ); $role->store(); // Set flag for audit. If true audit will be processed $http->setSessionVariable( 'RoleWasChanged', true ); } $showModules = true; $showFunctions = false; $showLimitations = false; $noFunctions = false; $noLimitations = false; if ( $http->hasPostVariable( 'Apply' ) ) { $originalRole = eZRole::fetch( $role->attribute( 'version' ) ); $originalRoleName = $originalRole->attribute( 'name' ); $originalRoleID = $originalRole->attribute( 'id' ); // Who changes which role(s) should be logged. if ( $http->hasSessionVariable( 'RoleWasChanged' ) and $http->sessionVariable( 'RoleWasChanged' ) === true ) { eZAudit::writeAudit( 'role-change', array( 'Role ID' => $originalRoleID, 'Role name' => $originalRoleName, 'Comment' => 'Changed the current role: kernel/role/edit.php' ) ); $http->removeSessionVariable( 'RoleWasChanged' ); } $originalRole->revertFromTemporaryVersion(); eZContentCacheManager::clearAllContentCache(); $Module->redirectTo( $Module->functionURI( 'view' ) . '/' . $originalRoleID . '/'); /* Clean up policy cache */ eZUser::cleanupCache(); } if ( $http->hasPostVariable( 'Discard' ) ) { $http->removeSessionVariable( 'RoleWasChanged' ); $role = eZRole::fetch( $roleID ) ; $originalRole = eZRole::fetch( $role->attribute( 'version') ); $role->removeThis(); if ( $originalRole != null && $originalRole->attribute( 'is_new' ) == 1 ) { $originalRole->remove(); } $Module->redirectTo( $Module->functionURI( 'list' ) . '/' ); } if ( $http->hasPostVariable( 'ChangeRoleName' ) ) { $role->setAttribute( 'name', $http->postVariable( 'NewName' ) ); // Set flag for audit. If true audit will be processed $http->setSessionVariable( 'RoleWasChanged', true ); } if ( $http->hasPostVariable( 'AddModule' ) ) { if ( $http->hasPostVariable( 'Modules' ) ) $currentModule = $http->postVariable( 'Modules' ); else if ( $http->hasPostVariable( 'CurrentModule' ) ) $currentModule = $http->postVariable( 'CurrentModule' ); $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => '*' ) ); } if ( $http->hasPostVariable( 'AddFunction' ) ) { $currentModule = $http->postVariable( 'CurrentModule' ); $currentFunction = $http->postVariable( 'ModuleFunction' ); eZDebugSetting::writeDebug( 'kernel-role-edit', $currentModule, 'currentModule'); $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => $currentFunction ) ); } if ( $http->hasPostVariable( 'AddLimitation' ) ) { $policy = false; if ( $http->hasSessionVariable( 'BrowsePolicyID' ) ) { $hasNodeLimitation = false; $policy = eZPolicy::fetch( $http->sessionVariable( 'BrowsePolicyID' ) ); if ( $policy ) { $limitationList = eZPolicyLimitation::fetchByPolicyID( $policy->attribute( 'id' ) ); foreach ( $limitationList as $limitation ) { $limitationID = $limitation->attribute( 'id' ); $limitationIdentifier = $limitation->attribute( 'identifier' ); if ( $limitationIdentifier != 'Node' and $limitationIdentifier != 'Subtree' ) eZPolicyLimitation::removeByID( $limitationID ); if ( $limitationIdentifier == 'Node' ) { $nodeLimitationValues = eZPolicyLimitationValue::fetchList( $limitationID ); if ( $nodeLimitationValues != null ) $hasNodeLimitation = true; else eZPolicyLimitation::removeByID( $limitationID ); } if ( $limitationIdentifier == 'Subtree' ) { $nodeLimitationValues = eZPolicyLimitationValue::fetchList( $limitationID ); if ( $nodeLimitationValues == null ) eZPolicyLimitation::removeByID( $limitationID ); } } // if ( !$hasNodeLimitation ) { $currentModule = $http->postVariable( 'CurrentModule' ); $currentFunction = $http->postVariable( 'CurrentFunction' ); $mod = eZModule::exists( $currentModule ); $functions = $mod->attribute( 'available_functions' ); $currentFunctionLimitations = $functions[ $currentFunction ]; foreach ( $currentFunctionLimitations as $functionLimitation ) { if ( $http->hasPostVariable( $functionLimitation['name'] ) and $functionLimitation['name'] != 'Node' and $functionLimitation['name'] != 'Subtree' ) { $limitationValues = $http->postVariable( $functionLimitation['name'] ); if ( !in_array( '-1', $limitationValues ) ) { $policyLimitation = eZPolicyLimitation::createNew( $policy->attribute('id'), $functionLimitation['name'] ); foreach ( $limitationValues as $limitationValue ) { eZPolicyLimitationValue::createNew( $policyLimitation->attribute( 'id' ), $limitationValue ); } } } } } } } if ( !$policy ) { $currentModule = $http->postVariable( 'CurrentModule' ); $currentFunction = $http->postVariable( 'CurrentFunction' ); $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => '' ) ); $mod = eZModule::exists( $currentModule ); $functions = $mod->attribute( 'available_functions' ); $currentFunctionLimitations = $functions[ $currentFunction ]; eZDebugSetting::writeDebug( 'kernel-role-edit', $currentFunctionLimitations, 'currentFunctionLimitations' ); $db = eZDB::instance(); $db->begin(); foreach ( $currentFunctionLimitations as $functionLimitation ) { if ( $http->hasPostVariable( $functionLimitation['name'] ) ) { $limitationValues = $http->postVariable( $functionLimitation['name'] ); eZDebugSetting::writeDebug( 'kernel-role-edit', $limitationValues, 'limitationValues' ); if ( !in_array('-1', $limitationValues ) ) { $policyLimitation = eZPolicyLimitation::createNew( $policy->attribute('id'), $functionLimitation['name'] ); foreach ( $limitationValues as $limitationValue ) { eZPolicyLimitationValue::createNew( $policyLimitation->attribute( 'id' ), $limitationValue ); } } } } $db->commit(); } } if ( $http->hasPostVariable( 'RemovePolicy' ) ) { $policyID = $http->postVariable( 'RolePolicy' ) ; eZDebugSetting::writeDebug( 'kernel-role-edit', $policyID, 'trying to remove policy' ); eZPolicy::removeByID( $policyID ); // Set flag for audit. If true audit will be processed $http->setSessionVariable( 'RoleWasChanged', true ); } if ( $http->hasPostVariable( 'RemovePolicies' ) and $http->hasPostVariable( 'DeleteIDArray' ) ) { $db = eZDB::instance(); $db->begin(); foreach( $http->postVariable( 'DeleteIDArray' ) as $deleteID) { eZDebugSetting::writeDebug( 'kernel-role-edit', $deleteID, 'trying to remove policy' ); eZPolicy::removeByID( $deleteID ); } $db->commit(); // Set flag for audit. If true audit will be processed $http->setSessionVariable( 'RoleWasChanged', true ); } if ( $http->hasPostVariable( 'CustomFunction' ) ) { if ( $http->hasPostVariable( 'Modules' ) ) $currentModule = $http->postVariable( 'Modules' ); else if ( $http->hasPostVariable( 'CurrentModule' ) ) $currentModule = $http->postVariable( 'CurrentModule' ); if ( $currentModule != '*' ) { $mod = eZModule::exists( $currentModule ); $functions = $mod->attribute( 'available_functions' ); $functionNames = array_keys( $functions ); } else { $functionNames = array(); } $showModules = false; $showFunctions = true; if ( count( $functionNames ) < 1 ) { $showModules = true; $showFunctions = false; $showLimitations = false; $noFunctions = true; } $tpl->setVariable( 'current_module', $currentModule ); $tpl->setVariable( 'functions', $functionNames ); $tpl->setVariable( 'no_functions', $noFunctions ); $Module->setTitle( 'Edit ' . $role->attribute( 'name' ) ); $Result = array(); $Result['path'] = array( array( 'url' => false , 'text' => ezpI18n::tr( 'kernel/role', 'Create new policy, step 2: select function' ) ) ); $Result['content'] = $tpl->fetch( 'design:role/createpolicystep2.tpl' ); return; } if ( $http->hasPostVariable( 'DiscardFunction' ) ) { $showModules = true; $showFunctions = false; } if ( $http->hasPostVariable( 'SelectButton' ) or $http->hasPostVariable( 'BrowseCancelButton' ) or $http->hasPostVariable( 'Limitation' ) or $http->hasPostVariable( 'SelectedNodeIDArray' ) or $http->hasPostVariable( 'BrowseLimitationNodeButton' ) or $http->hasPostVariable( 'DeleteNodeButton' ) or $http->hasPostVariable( 'BrowseLimitationSubtreeButton' ) or $http->hasPostVariable( 'DeleteSubtreeButton' ) ) { $db = eZDB::instance(); $db->begin(); if ( $http->hasPostVariable( 'DeleteNodeButton' ) and $http->hasSessionVariable( 'BrowsePolicyID' ) ) { if ( $http->hasPostVariable( 'DeleteNodeIDArray' ) ) { $deletedIDList = $http->postVariable( 'DeleteNodeIDArray' ); foreach ( $deletedIDList as $deletedID ) { eZPolicyLimitationValue::removeByValue( $deletedID, $http->sessionVariable( 'BrowsePolicyID' ) ); } } } if ( $http->hasPostVariable( 'DeleteSubtreeButton' ) and $http->hasSessionVariable( 'BrowsePolicyID' ) ) { if ( $http->hasPostVariable( 'DeleteSubtreeIDArray' ) ) { $deletedIDList = $http->postVariable( 'DeleteSubtreeIDArray' ); foreach ( $deletedIDList as $deletedID ) { $subtree = eZContentObjectTreeNode::fetch( $deletedID , false, false); $path = $subtree['path_string']; eZPolicyLimitationValue::removeByValue( $path, $http->sessionVariable( 'BrowsePolicyID' ) ); } } } if ( $http->hasPostVariable( 'Limitation' ) and $http->hasSessionVariable( 'BrowsePolicyID' ) ) $http->removeSessionVariable( 'BrowsePolicyID' ); if ( $http->hasSessionVariable( 'BrowseCurrentModule' ) ) $currentModule = $http->sessionVariable( 'BrowseCurrentModule' ); if ( $http->hasPostVariable( 'CurrentModule' ) ) $currentModule = $http->postVariable( 'CurrentModule' ); $mod = eZModule::exists( $currentModule ); $functions = $mod->attribute( 'available_functions' ); $functionNames = array_keys( $functions ); $showModules = false; $showFunctions = false; $showLimitations = true; $nodeList = array(); $nodeIDList = array(); $subtreeList = array(); $subtreeIDList = array(); // Check for temporary node and subtree policy limitation if ( $http->hasSessionVariable( 'BrowsePolicyID' ) ) { $policyID = $http->sessionVariable( 'BrowsePolicyID' ); // Fetch node limitations $nodeLimitation = eZPolicyLimitation::fetchByIdentifier( $policyID, 'Node' ); if ( $nodeLimitation != null ) { $nodeLimitationID = $nodeLimitation->attribute('id'); $nodeLimitationValues = eZPolicyLimitationValue::fetchList( $nodeLimitationID ); foreach ( $nodeLimitationValues as $nodeLimitationValue ) { $nodeID = $nodeLimitationValue->attribute( 'value' ); $nodeIDList[] = $nodeID; $node = eZContentObjectTreeNode::fetch( $nodeID ); $nodeList[] = $node; } } // Fetch subtree limitations $subtreeLimitation = eZPolicyLimitation::fetchByIdentifier( $policyID, 'Subtree' ); if ( $subtreeLimitation != null ) { $subtreeLimitationID = $subtreeLimitation->attribute('id'); $subtreeLimitationValues = eZPolicyLimitationValue::fetchList( $subtreeLimitationID ); foreach ( $subtreeLimitationValues as $subtreeLimitationValue ) { $subtreePath = $subtreeLimitationValue->attribute( 'value' ); $subtreeObject = eZContentObjectTreeNode::fetchByPath( $subtreePath ); if ( $subtreeObject ) { $subtreeID = $subtreeObject->attribute( 'node_id' ); $subtreeIDList[] = $subtreeID; $subtree = eZContentObjectTreeNode::fetch( $subtreeID ); $subtreeList[] = $subtree; } } } } if ( $http->hasSessionVariable( 'BrowseCurrentFunction' ) ) $currentFunction = $http->sessionVariable( 'BrowseCurrentFunction' ); if ( $http->hasPostVariable( 'CurrentFunction' ) ) $currentFunction = $http->postVariable( 'CurrentFunction' ); if ( $http->hasPostVariable( 'ModuleFunction' ) ) $currentFunction = $http->postVariable( 'ModuleFunction' ); $currentFunctionLimitations = array(); foreach( $functions[ $currentFunction ] as $key => $limitation ) { if( count( $limitation[ 'values' ] == 0 ) && array_key_exists( 'class', $limitation ) ) { $obj = new $limitation['class']( array() ); $limitationValueList = call_user_func_array ( array( $obj , $limitation['function']) , $limitation['parameter'] ); $limitationValueArray = array(); foreach( $limitationValueList as $limitationValue ) { $limitationValuePair = array(); $limitationValuePair['Name'] = $limitationValue[ 'name' ]; $limitationValuePair['value'] = $limitationValue[ 'id' ]; $limitationValueArray[] = $limitationValuePair; } $limitation[ 'values' ] = $limitationValueArray; } $currentFunctionLimitations[ $key ] = $limitation; } if ( count( $currentFunctionLimitations ) < 1 ) { $showModules = false; $showFunctions = true; $showLimitations = false; $noLimitations = true; } if ( $http->hasPostVariable( 'BrowseLimitationSubtreeButton' ) || $http->hasPostVariable( 'BrowseLimitationNodeButton' ) ) { // Store other limitations if ( $http->hasSessionVariable( 'BrowsePolicyID' ) ) { $policy = eZPolicy::fetch( $http->sessionVariable( 'BrowsePolicyID' ) ); $limitationList = eZPolicyLimitation::fetchByPolicyID( $policy->attribute( 'id' ) ); foreach ( $limitationList as $limitation ) { $limitationID = $limitation->attribute( 'id' ); $limitationIdentifier = $limitation->attribute( 'identifier' ); if ( $limitationIdentifier != 'Node' and $limitationIdentifier != 'Subtree' ) eZPolicyLimitation::removeByID( $limitationID ); } foreach ( $currentFunctionLimitations as $functionLimitation ) { if ( $http->hasPostVariable( $functionLimitation['name'] ) and $functionLimitation['name'] != 'Node' and $functionLimitation['name'] != 'Subtree' ) { $limitationValues = $http->postVariable( $functionLimitation['name'] ); eZDebugSetting::writeDebug( 'kernel-role-edit', $limitationValues, 'limitationValues'); if ( !in_array('-1', $limitationValues ) ) { $policyLimitation = eZPolicyLimitation::createNew( $policy->attribute('id'), $functionLimitation['name'] ); foreach ( $limitationValues as $limitationValue ) { eZPolicyLimitationValue::createNew( $policyLimitation->attribute( 'id' ), $limitationValue ); } } } } } else { $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => '') ); $http->setSessionVariable( 'BrowsePolicyID', $policy->attribute('id') ); foreach ( $currentFunctionLimitations as $functionLimitation ) { if ( $http->hasPostVariable( $functionLimitation['name'] )) { $limitationValues = $http->postVariable( $functionLimitation['name'] ); eZDebugSetting::writeDebug( 'kernel-role-edit', $limitationValues, 'limitationValues'); if ( !in_array( '-1', $limitationValues ) ) { $policyLimitation = eZPolicyLimitation::createNew( $policy->attribute('id'), $functionLimitation['name'] ); eZDebugSetting::writeDebug( 'kernel-role-edit', $policyLimitation, 'policyLimitationCreated' ); foreach ( $limitationValues as $limitationValue ) { eZPolicyLimitationValue::createNew( $policyLimitation->attribute( 'id' ), $limitationValue ); } } } } } $db->commit(); $http->setSessionVariable( 'BrowseCurrentModule', $currentModule ); $http->setSessionVariable( 'BrowseCurrentFunction', $currentFunction ); if ( $http->hasPostVariable( 'BrowseLimitationSubtreeButton' ) ) { eZContentBrowse::browse( array( 'action_name' => 'FindLimitationSubtree', 'from_page' => '/role/edit/' . $roleID . '/' ), $Module ); } elseif ( $http->hasPostVariable( 'BrowseLimitationNodeButton' ) ) { eZContentBrowse::browse( array( 'action_name' => 'FindLimitationNode', 'from_page' => '/role/edit/' . $roleID . '/' ), $Module ); } return; } if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) and $http->postVariable( 'BrowseActionName' ) == 'FindLimitationNode' and !$http->hasPostVariable( 'BrowseCancelButton' ) ) { $selectedNodeIDList = $http->postVariable( 'SelectedNodeIDArray' ); if ( $http->hasSessionVariable( 'BrowsePolicyID' ) ) { $policy = eZPolicy::fetch( $http->sessionVariable( 'BrowsePolicyID' ) ); $limitationList = eZPolicyLimitation::fetchByPolicyID( $policy->attribute( 'id' ) ); // Remove other limitations. When the policy is applied to node, no other constraints needed. // Removes limitations only from a DropList if it is specified in the module. if ( isset( $currentFunctionLimitations['Node']['DropList'] ) ) { $dropList = $currentFunctionLimitations['Node']['DropList']; foreach ( $limitationList as $limitation ) { $limitationID = $limitation->attribute( 'id' ); $limitationIdentifier = $limitation->attribute( 'identifier' ); if ( in_array( $limitationIdentifier, $dropList ) ) { eZPolicyLimitation::removeByID( $limitationID ); } } } else { foreach ( $limitationList as $limitation ) { $limitationID = $limitation->attribute( 'id' ); $limitationIdentifier = $limitation->attribute( 'identifier' ); if ( $limitationIdentifier != 'Node' and $limitationIdentifier != 'Subtree' ) eZPolicyLimitation::removeByID( $limitationID ); } } } else { $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => '') ); $http->setSessionVariable( 'BrowsePolicyID', $policy->attribute('id') ); } $nodeLimitation = eZPolicyLimitation::fetchByIdentifier( $policy->attribute('id'), 'Node' ); if ( $nodeLimitation == null ) $nodeLimitation = eZPolicyLimitation::createNew( $policy->attribute('id'), 'Node' ); foreach ( $selectedNodeIDList as $nodeID ) { if ( !in_array( $nodeID, $nodeIDList ) ) { $nodeLimitationValue = eZPolicyLimitationValue::createNew( $nodeLimitation->attribute( 'id' ), $nodeID ); $node = eZContentObjectTreeNode::fetch( $nodeID ); $nodeList[] = $node; } } } if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) and $http->postVariable( 'BrowseActionName' ) == 'FindLimitationSubtree' and !$http->hasPostVariable( 'BrowseCancelButton' ) ) { $selectedSubtreeIDList = $http->postVariable( 'SelectedNodeIDArray' ); if ( $http->hasSessionVariable( 'BrowsePolicyID' ) ) { $policy = eZPolicy::fetch( $http->sessionVariable( 'BrowsePolicyID' ) ); } else { $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => '') ); $http->setSessionVariable( 'BrowsePolicyID', $policy->attribute('id') ); } $subtreeLimitation = eZPolicyLimitation::fetchByIdentifier( $policy->attribute('id'), 'Subtree' ); if ( $subtreeLimitation == null ) $subtreeLimitation = eZPolicyLimitation::createNew( $policy->attribute('id'), 'Subtree' ); foreach ( $selectedSubtreeIDList as $nodeID ) { if ( !in_array( $nodeID, $subtreeIDList ) ) { $subtree = eZContentObjectTreeNode::fetch( $nodeID ); $pathString = $subtree->attribute( 'path_string' ); $policyLimitationValue = eZPolicyLimitationValue::createNew( $subtreeLimitation->attribute( 'id' ), $pathString ); $subtreeList[] = $subtree; } } } if ( $http->hasPostVariable( 'Limitation' ) && count( $currentFunctionLimitations ) == 0 ) { $currentModule = $http->postVariable( 'CurrentModule' ); $currentFunction = $http->postVariable( 'ModuleFunction' ); eZDebugSetting::writeDebug( 'kernel-role-edit', $currentModule, 'currentModule' ); $policy = eZPolicy::createNew( $roleID, array( 'ModuleName'=> $currentModule, 'FunctionName' => $currentFunction ) ); } else { $db->commit(); $currentLimitationList = array(); foreach ( $currentFunctionLimitations as $currentFunctionLimitation ) { $limitationName = $currentFunctionLimitation['name']; $currentLimitationList[$limitationName] = '-1'; } if ( isset( $policyID ) ) { $limitationList = eZPolicyLimitation::fetchByPolicyID( $policyID ); foreach ( $limitationList as $limitation ) { $limitationID = $limitation->attribute( 'id' ); $limitationIdentifier = $limitation->attribute( 'identifier' ); $limitationValues = eZPolicyLimitationValue::fetchList( $limitationID ); $valueList = array(); foreach ( $limitationValues as $limitationValue ) { $value = $limitationValue->attribute( 'value' ); $valueList[] = $value; } $currentLimitationList[$limitationIdentifier] = $valueList; } } $tpl->setVariable( 'current_function', $currentFunction ); $tpl->setVariable( 'function_limitations', $currentFunctionLimitations ); $tpl->setVariable( 'no_limitations', $noLimitations ); $tpl->setVariable( 'current_module', $currentModule ); $tpl->setVariable( 'functions', $functionNames ); $tpl->setVariable( 'node_list', $nodeList ); $tpl->setVariable( 'subtree_list', $subtreeList ); $tpl->setVariable( 'current_limitation_list', $currentLimitationList ); $Result = array(); $Result['path'] = array( array( 'url' => false , 'text' => ezpI18n::tr( 'kernel/role', 'Create new policy, step three: set function limitations' ) ) ); $Result['content'] = $tpl->fetch( 'design:role/createpolicystep3.tpl' ); return; } $db->commit(); } if ( $http->hasPostVariable( 'DiscardLimitation' ) || $http->hasPostVariable( 'Step2') ) { $currentModule = $http->postVariable( 'CurrentModule' ); $mod = eZModule::exists( $currentModule ); $functions = $mod->attribute( 'available_functions' ); $functionNames = array_keys( $functions ); $showModules = false; $showFunctions = true; $tpl->setVariable( 'current_module', $currentModule ); $tpl->setVariable( 'functions', $functionNames ); $tpl->setVariable( 'no_functions', false ); $Result = array(); $Result['path'] = array( array( 'url' => false , 'text' => ezpI18n::tr( 'kernel/role', 'Create new policy, step two: select function' ) ) ); $Result['content'] = $tpl->fetch( 'design:role/createpolicystep2.tpl' ); return; } if ( $http->hasPostVariable( 'CreatePolicy' ) || $http->hasPostVariable( 'Step1' ) ) { // Set flag for audit. If true audit will be processed $http->setSessionVariable( 'RoleWasChanged', true ); $Module->setTitle( 'Edit ' . $role->attribute( 'name' ) ); $tpl->setVariable( 'modules', $modules ); $moduleList = array(); foreach( $modules as $module ) { $moduleList[] = eZModule::exists( $module ); } $tpl->setVariable( 'module_list', $moduleList ); $tpl->setVariable( 'role', $role ); $tpl->setVariable( 'module', $Module ); $Result = array(); $Result['path'] = array( array( 'url' => false , 'text' => ezpI18n::tr( 'kernel/role', 'Create new policy, step one: select module' ) ) ); $Result['content'] = $tpl->fetch( 'design:role/createpolicystep1.tpl' ); return; } // Set flag for audit. If true audit will be processed // Cancel button was pressed if ( $http->hasPostVariable( 'CancelPolicyButton' ) ) $http->setSessionVariable( 'RoleWasChanged', false ); $policies = $role->attribute( 'policies' ); $tpl->setVariable( 'no_functions', $noFunctions ); $tpl->setVariable( 'no_limitations', $noLimitations ); $tpl->setVariable( 'show_modules', $showModules ); $tpl->setVariable( 'show_limitations', $showLimitations ); $tpl->setVariable( 'show_functions', $showFunctions ); $tpl->setVariable( 'policies', $policies ); $tpl->setVariable( 'modules', $modules ); $tpl->setVariable( 'module', $Module ); $tpl->setVariable( 'role', $role ); $tpl->setVariable( 'step', 0 ); $Module->setTitle( 'Edit ' . $role->attribute( 'name' ) ); $Result = array(); $Result['path'] = array( array( 'text' => 'Role', 'url' => 'role/list' ), array( 'text' => $role->attribute( 'name' ), 'url' => false ) ); $Result['content'] = $tpl->fetch( 'design:role/edit.tpl' ); ?>
gpl-2.0
allgood2386/lexrants-me
core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
4512
<?php /** * @file * Contains \Drupal\user\Form\UserPasswordForm. */ namespace Drupal\user\Form; use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem; use Drupal\Core\Form\FormBase; use Drupal\Core\Language\Language; use Drupal\Core\Language\LanguageManager; use Drupal\user\UserStorageControllerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides a user password reset form. */ class UserPasswordForm extends FormBase { /** * The user storage controller. * * @var \Drupal\user\UserStorageControllerInterface */ protected $userStorageController; /** * The language manager. * * @var \Drupal\Core\Language\LanguageManager */ protected $languageManager; /** * Constructs a UserPasswordForm object. * * @param \Drupal\user\UserStorageControllerInterface $user_storage_controller * The user storage controller. * @param \Drupal\Core\Language\LanguageManager $language_manager * The language manager. */ public function __construct(UserStorageControllerInterface $user_storage_controller, LanguageManager $language_manager) { $this->userStorageController = $user_storage_controller; $this->languageManager = $language_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('entity.manager')->getStorageController('user'), $container->get('language_manager') ); } /** * {@inheritdoc} */ public function getFormId() { return 'user_pass'; } /** * {@inheritdoc} * * @param \Symfony\Component\HttpFoundation\Request $request * The request object. */ public function buildForm(array $form, array &$form_state) { $form['name'] = array( '#type' => 'textfield', '#title' => $this->t('Username or e-mail address'), '#size' => 60, '#maxlength' => max(USERNAME_MAX_LENGTH, EMAIL_MAX_LENGTH), '#required' => TRUE, '#attributes' => array( 'autocorrect' => 'off', 'autocapitalize' => 'off', 'spellcheck' => 'false', 'autofocus' => 'autofocus', ), ); // Allow logged in users to request this also. $user = $this->currentUser(); if ($user->isAuthenticated()) { $form['name']['#type'] = 'value'; $form['name']['#value'] = $user->getEmail(); $form['mail'] = array( '#prefix' => '<p>', '#markup' => $this->t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the e-mail.', array('%email' => $user->getEmail())), '#suffix' => '</p>', ); } else { $form['name']['#default_value'] = $this->getRequest()->query->get('name'); } $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => $this->t('E-mail new password')); return $form; } /** * {@inheritdoc} */ public function validateForm(array &$form, array &$form_state) { $name = trim($form_state['values']['name']); // Try to load by email. $users = $this->userStorageController->loadByProperties(array('mail' => $name, 'status' => '1')); if (empty($users)) { // No success, try to load by name. $users = $this->userStorageController->loadByProperties(array('name' => $name, 'status' => '1')); } $account = reset($users); if ($account && $account->id()) { form_set_value(array('#parents' => array('account')), $account, $form_state); } else { $this->setFormError('name', $form_state, $this->t('Sorry, %name is not recognized as a username or an e-mail address.', array('%name' => $name))); } } /** * {@inheritdoc} */ public function submitForm(array &$form, array &$form_state) { $langcode = $this->languageManager->getCurrentLanguage()->id; $account = $form_state['values']['account']; // Mail one time login URL and instructions using current language. $mail = _user_mail_notify('password_reset', $account, $langcode); if (!empty($mail)) { watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->getUsername(), '%email' => $account->getEmail())); drupal_set_message($this->t('Further instructions have been sent to your e-mail address.')); } $form_state['redirect_route']['route_name'] = 'user.page'; } }
gpl-2.0
mischief/systemd-coreos
src/test/test-pty.c
4202
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. Copyright 2014 David Herrmann <dh.herrmann@gmail.com> systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <errno.h> #include <locale.h> #include <string.h> #include <sys/wait.h> #include <unistd.h> #include "pty.h" #include "util.h" #include "signal-util.h" static const char sndmsg[] = "message\n"; static const char rcvmsg[] = "message\r\n"; static char rcvbuf[128]; static size_t rcvsiz = 0; static sd_event *event; static void run_child(Pty *pty) { ssize_t r, l; char buf[512]; r = read(0, buf, sizeof(buf)); assert_se((size_t)r == strlen(sndmsg)); assert_se(!strncmp(buf, sndmsg, r)); l = write(1, buf, r); assert_se(l == r); } static int pty_fn(Pty *pty, void *userdata, unsigned int ev, const void *ptr, size_t size) { switch (ev) { case PTY_DATA: assert_se(rcvsiz < strlen(rcvmsg) * 2); assert_se(rcvsiz + size < sizeof(rcvbuf)); memcpy(&rcvbuf[rcvsiz], ptr, size); rcvsiz += size; if (rcvsiz >= strlen(rcvmsg) * 2) { assert_se(rcvsiz == strlen(rcvmsg) * 2); assert_se(!memcmp(rcvbuf, rcvmsg, strlen(rcvmsg))); assert_se(!memcmp(&rcvbuf[strlen(rcvmsg)], rcvmsg, strlen(rcvmsg))); } break; case PTY_HUP: /* This is guaranteed to appear _after_ the input queues are * drained! */ assert_se(rcvsiz == strlen(rcvmsg) * 2); break; case PTY_CHILD: /* this may appear at any time */ break; default: assert_se(0); break; } /* if we got HUP _and_ CHILD, exit */ if (pty_get_fd(pty) < 0 && pty_get_child(pty) < 0) sd_event_exit(event, 0); return 0; } static void run_parent(Pty *pty) { int r; /* write message to pty, ECHO mode guarantees that we get it back * twice: once via ECHO, once from the run_child() fn */ assert_se(pty_write(pty, sndmsg, strlen(sndmsg)) >= 0); r = sd_event_loop(event); assert_se(r >= 0); } static void test_pty(void) { pid_t pid; Pty *pty = NULL; rcvsiz = 0; zero(rcvbuf); assert_se(sd_event_default(&event) >= 0); pid = pty_fork(&pty, event, pty_fn, NULL, 80, 25); assert_se(pid >= 0); if (pid == 0) { /* child */ run_child(pty); exit(0); } /* parent */ run_parent(pty); /* Make sure the PTY recycled the child; yeah, this is racy if the * PID was already reused; but that seems fine for a test. */ assert_se(waitpid(pid, NULL, WNOHANG) < 0 && errno == ECHILD); pty_unref(pty); sd_event_unref(event); } int main(int argc, char *argv[]) { unsigned int i; log_parse_environment(); log_open(); assert_se(sigprocmask_many(SIG_BLOCK, SIGCHLD, -1) >= 0); /* Oh, there're ugly races in the TTY layer regarding HUP vs IN. Turns * out they appear only 10% of the time. I fixed all of them and * don't see them, anymore. But lets be safe and run this 1000 times * so we catch any new ones, in case they appear again. */ for (i = 0; i < 1000; ++i) test_pty(); return 0; }
gpl-2.0
Luckynumberseven/project2
wp-content/plugins/frontend-uploader/lib/php/class-html-helper.php
6132
<?php /** * This is a helper class for WordPress that allows format HTML tags, including inputs, textareas, etc * * @author Rinat Khaziev * @version 0.1 */ class Html_Helper { function __construct() { } /** * Render multiple choice checkboxes * * @param string $name * @param string $description * @param array $data */ function checkboxes( $name = '', $description = '', $data = array(), $checked = array() ) { if ( $name != '' ) { $name = filter_var( $name, FILTER_SANITIZE_STRING ); if ( $description ); echo $this->element( 'p', __( $description ) ); echo '<input type="hidden" name="' . esc_attr( $name ) .'" value="" />'; foreach ( (array) $data as $item ) { $is_checked_attr = in_array( $item, (array) $checked ) ? ' checked="true" ' : ''; $item = filter_var( $item, FILTER_SANITIZE_STRING ); echo '<div class="sm-input-wrapper">'; echo '<input type="checkbox" name="' . esc_attr( $name ) . '[]" value="' . esc_attr( $item ) . '" id="' .esc_attr( $name ) . esc_attr( $item ) . '" ' . $is_checked_attr . ' />'; echo '<label for="' .esc_attr( $name ) . esc_attr( $item ) . '">' . esc_attr ( $item ) . '</label>'; echo '</div>'; } } } function _checkbox( $name = '', $description = '', $value = '', $atts, $checked = array() ) { // Generate unique id to make label clickable $rnd_id = uniqid( 'uniq-label-id-' ); return '<div class="checkbox-option-wrapper"><input type="checkbox" id="' . esc_attr( $rnd_id ) . '" value="'. esc_attr( $value ) . '" name="' . esc_attr( $name ) . '" '.$this->_format_attributes( $atts ) . ' /><label for="' . esc_attr( $rnd_id ) . '">' . esc_html ($description ) . '</label></div>'; } function _radio( $name = '', $description = '', $value = '', $atts, $checked = array() ) { // Generate unique id to make label clickable $rnd_id = uniqid( 'uniq-label-id-' ); return '<div class="checkbox-option-wrapper"><input type="radio" id="' . esc_attr( $rnd_id ) . '" value="'. esc_attr( $value ) . '" name="' . esc_attr( $name ) . '" '.$this->_format_attributes( $atts ) . ' /><label for="' . esc_attr( $rnd_id ) . '">' . esc_html ($description ) . '</label></div>'; } /** * This method supports unlimited arguments, * each argument represents html value */ function table_row() { $data = func_get_args(); $ret = ''; foreach ( $data as $cell ) $ret .= $this->element( 'td', $cell, null, false ); return "<tr>" . $ret . "</tr>\n"; } /** * easy wrapper method * * @param unknown $type (select|input) * @param string $name * @param mixed $data */ function input( $type, $name, $data = null, $attrs = array() ) { switch ( $type ) { case 'select': return $this->_select( $name, $data, $attrs ); break; case 'text': case 'hidden': case 'submit': case 'file': case 'checkbox': return $this->_text( $name, $type, $data, $attrs ) ; break; case 'radio': return $this->_radio( $name, $data, $attrs ) ; default: return; } } /** * This is a private method to render inputs * * @access private */ function _text( $name = '', $type='text', $data = '', $attrs = array() ) { return '<input type="' . esc_attr( $type ) . '" value="'. esc_attr( $data ) . '" name="' . esc_attr( $name ) . '" '.$this->_format_attributes( $attrs ) . ' />'; } /** * * * @access private */ function _select( $name, $data = array(), $attrs ) { $ret = ''; foreach ( (array) $data as $key => $value ) { $attrs_to_pass = array( 'value' => $key ); if ( isset( $attrs[ 'default' ] ) && $key == $attrs[ 'default' ] ) $attrs_to_pass[ 'selected' ] = 'selected'; $ret .= $this->element( 'option', $value, $attrs_to_pass, false ); } return '<select name="' . esc_attr( $name ) . '">' . $ret . '</select>'; } function table_head( $data = array(), $params = null ) { echo '<table><thead>'; foreach ( $data as $th ) { echo '<th>' . esc_html( $th ) . '</th>'; } echo '</thead><tbody>'; } function table_foot() { echo '</tbody></table>'; } function form_start( $attrs = array() ) { echo '<form' . $this->_format_attributes( $attrs ) .'>'; } function form_end() { echo '</form>'; } /** * Renders html element * * @param string $tag one of allowed tags * @param string content innerHTML content of tag * @param array $params additional attributes * @param bool $escape escape innerHTML or not, defaults to true * @return string rendered html tag */ function element( $tag, $content, $params = array(), $escape = true ) { $allowed = apply_filters( 'hh_allowed_html_elements' , array( 'div', 'p', 'span', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'td', 'option', 'label', 'textarea', 'select', 'option' ) ); $attr_string = $this->_format_attributes( $params ); if ( in_array( $tag, $allowed ) ) return "<{$tag} {$attr_string}>" . ( $escape ? esc_html ( $content ) : $content ) . "</{$tag}>"; } /** * Formats and returns string of allowed html attrs * * @param array $attrs * @return string attributes */ function _format_attributes( $attrs = array() ) { $attr_string = ''; foreach ( (array) $attrs as $attr => $value ) { if ( in_array( $attr, $this->_allowed_html_attrs() ) ) $attr_string .= " {$attr}='" . esc_attr ( $value ) . "'"; } return $attr_string; } /** * Validates and returns url as A HTML element * * @param string $url any valid url * @param string $title * @param unknown $params array of html attributes * @return string html link */ function a( $url, $title = '', $params = array() ) { $attr_string = $this->_format_attributes( $params ); if ( filter_var( trim( $url ), FILTER_VALIDATE_URL ) ) return '<a href="' . esc_url( trim( $url ) ) . '" ' . $attr_string . '>' . ( $title != '' ? esc_html ( $title ) : esc_url( trim( $url ) ) ) . '</a>'; } /** * Returns allowed HTML attributes */ function _allowed_html_attrs() { return apply_filters( 'hh_allowed_html_attributes', array( 'href', 'class', 'id', 'value', 'action', 'name', 'method', 'selected', 'checked', 'for', 'multiple' ) ); } }
gpl-2.0
spinlockirqsave/linux_kernels
arch/mips/arc/cmdline.c
1252
/* * cmdline.c: Kernel command line creation using ARCS argc/argv. * * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * * $Id: cmdline.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $ */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/string.h> #include <asm/sgialib.h> #include <asm/bootinfo.h> /* #define DEBUG_CMDLINE */ char arcs_cmdline[CL_SIZE]; char * __init prom_getcmdline(void) { return &(arcs_cmdline[0]); } static char *ignored[] = { "ConsoleIn=", "ConsoleOut=", "SystemPartition=", "OSLoader=", "OSLoadPartition=", "OSLoadFilename=" }; #define NENTS(foo) ((sizeof((foo)) / (sizeof((foo[0]))))) void __init prom_init_cmdline(void) { char *cp; int actr, i; actr = 1; /* Always ignore argv[0] */ cp = &(arcs_cmdline[0]); while(actr < prom_argc) { for(i = 0; i < NENTS(ignored); i++) { int len = strlen(ignored[i]); if(!strncmp(prom_argv[actr], ignored[i], len)) goto pic_cont; } /* Ok, we want it. */ strcpy(cp, prom_argv[actr]); cp += strlen(prom_argv[actr]); *cp++ = ' '; pic_cont: actr++; } if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */ --cp; *cp = '\0'; #ifdef DEBUG_CMDLINE prom_printf("prom_init_cmdline: %s\n", &(arcs_cmdline[0])); #endif }
gpl-2.0
david-strejc/octopus
components/com_easyblog/themes/nomad/blog.item.photo.php
5596
<?php /** * @package EasyBlog * @copyright Copyright (C) 2010 Stack Ideas Private Limited. All rights reserved. * @license GNU/GPL, see LICENSE.php * * EasyBlog is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ defined('_JEXEC') or die('Restricted access'); ?> <!-- Post item wrapper --> <div id="entry-<?php echo $row->id; ?>" class="blog-post micro-photo clearfix prel<?php echo (!empty($row->team)) ? ' teamblog-post' : '' ;?>" itemscope itemtype="http://schema.org/Blog"> <div class="blog-post-in"> <div class="blog-head"> <!-- @template: Admin tools --> <?php echo $this->fetch( 'blog.admin.tool.php' , array( 'row' => $row ) ); ?> <?php if( $system->config->get( 'layout_avatar' ) && $this->getParam( 'show_avatar_frontpage' ) ){ ?> <!-- @template: Avatar --> <?php echo $this->fetch( 'blog.avatar.php' , array( 'row' => $row ) ); ?> <?php } ?> <div class="blog-head-in"> <!-- Post title --> <div class="blog-photo"> <h2 id="title-<?php echo $row->id; ?>" class="blog-title<?php echo ($row->isFeatured) ? ' featured' : '';?> rip mbs" itemprop="name"> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>" title="<?php echo $this->escape( $row->title );?>" itemprop="url"><?php echo $row->title; ?></a> <?php if( $row->isFeatured ) { ?> <!-- Show a featured tag if the entry is featured --> <sup class="tag-featured"><?php echo Jtext::_('COM_EASYBLOG_FEATURED_FEATURED'); ?></sup> <?php } ?> </h2> </div> <!-- Post metadata --> <?php echo $this->fetch( 'blog.meta.php' , array( 'row' => $row, 'postedText' => JText::_( 'COM_EASYBLOG_PHOTO_UPLOADED' ) ) ); ?> </div> <div class="clear"></div> </div> <!-- Content wrappings --> <div class="blog-content clearfix"> <!-- @Trigger onAfterDisplayTitle --> <?php echo $row->event->afterDisplayTitle; ?> <!-- Post content --> <div class="blog-text clearfix prel"> <!-- @Trigger: onBeforeDisplayContent --> <?php echo $row->event->beforeDisplayContent; ?> <!-- Load social buttons --> <?php if( in_array( $system->config->get( 'main_socialbutton_position' ) , array( 'top' , 'left' , 'right' ) ) ){ ?> <?php echo EasyBlogHelper::showSocialButton( $row , true ); ?> <?php } ?> <!-- Photo items --> <?php if( $row->images ){ ?> <?php foreach( $row->images as $image ){ ?> <p class="photo-source"> <span> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$row->id); ?>"><img src="<?php echo $image;?>" /></a> </span> </p> <?php } ?> <?php } ?> <!-- Post content --> <?php echo $row->text; ?> <!-- @Trigger: onAfterDisplayContent --> <?php echo $row->event->afterDisplayContent; ?> <!-- Copyright text --> <?php if( $system->config->get( 'layout_copyrights' ) && !empty($row->copyrights) ) { ?> <?php echo $this->fetch( 'blog.copyright.php' , array( 'row' => $row ) ); ?> <?php } ?> <!-- Maps --> <?php if( $system->config->get( 'main_locations_blog_frontpage' ) ){ ?> <?php echo EasyBlogHelper::getHelper( 'Maps' )->getHTML( true , $row->address, $row->latitude , $row->longitude , $system->config->get( 'main_locations_blog_map_width') , $system->config->get( 'main_locations_blog_map_height' ), JText::sprintf( 'COM_EASYBLOG_LOCATIONS_BLOG_POSTED_FROM' , $row->address ), 'post_map_canvas_' . $row->id );?> <?php } ?> </div> <?php if( $this->getParam( 'show_last_modified' ) ){ ?> <!-- Modified date --> <span class="blog-modified-date"> <?php echo JText::_( 'COM_EASYBLOG_LAST_MODIFIED' ); ?> <?php echo JText::_( 'COM_EASYBLOG_ON' ); ?> <time datetime="<?php echo $this->formatDate( '%Y-%m-%d' , $row->modified ); ?>"> <span><?php echo $this->formatDate( $system->config->get('layout_dateformat') , $row->modified ); ?></span> </time> </span> <?php } ?> <?php if( $this->getparam( 'show_tags' , true ) && $this->getParam( 'show_tags_frontpage' , true ) ){ ?> <?php echo $this->fetch( 'tags.item.php' , array( 'tags' => $row->tags ) ); ?> <?php } ?> <!-- Load bottom social buttons --> <?php if( $system->config->get( 'main_socialbutton_position' ) == 'bottom' ){ ?> <?php echo EasyBlogHelper::showSocialButton( $row , true ); ?> <?php } ?> <!-- Standard facebook like button needs to be at the bottom --> <?php if( $system->config->get('main_facebook_like') && $system->config->get('main_facebook_like_layout') == 'standard' && $system->config->get( 'integrations_facebook_show_in_listing') ) : ?> <?php echo $this->fetch( 'facebook.standard.php' , array( 'facebook' => $row->facebookLike ) ); ?> <?php endif; ?> <?php if( $system->config->get( 'layout_showcomment' ) && EasyBlogHelper::getHelper( 'Comment')->isBuiltin() ){ ?> <!-- Recent comment listings on the frontpage --> <?php echo $this->fetch( 'blog.item.comment.list.php' , array( 'row' => $row ) ); ?> <?php } ?> </div> <!-- Bottom metadata --> <?php echo $this->fetch( 'blog.meta.bottom.php' , array( 'row' => $row ) ); ?> </div> </div>
gpl-2.0
slade87/ALE21-Kernel
drivers/hisi/modem_hi6xxx/oam/comm/acore/om/uttest_omappoutside.cpp
2725
#include "gtest/gtest.h" #include "llt_mockcpp.h" #include <stdio.h> #include <stdlib.h> //½¨ÒéÕâÑùÒýÓ㬱ÜÃâÏÂÃæÓùؼü×ÖʱÐèÒª¼Óǰ׺ testing:: using namespace testing; #ifdef __cplusplus extern "C" { #endif extern unsigned int uttest_OM_AcpuCallBackMsgProc_case1(void); extern unsigned int uttest_OM_AcpuCallBackMsgProc_case2(void); extern unsigned int uttest_OM_AcpuCallBackMsgProc_case3(void); extern unsigned int uttest_OM_AcpuCallBackMsgProc_case4(void); extern unsigned int uttest_OM_AcpuCallBackFidInit_case1(void); extern unsigned int uttest_OM_AcpuCallBackFidInit_case2(void); extern unsigned int uttest_OM_AcpuCallBackFidInit_case3(void); extern void OM_Log1(char *cFileName, unsigned int ulLineNum, unsigned int enModuleId, unsigned int enSubModId, unsigned int enLevel, char *pcString, int lPara1); extern unsigned int VOS_RegisterPIDInfo(unsigned int ulPID, void* pfnInitFun, void* pfnMsgFun); extern unsigned int VOS_RegisterMsgTaskPrio(unsigned int ulFID, unsigned int TaskPrio); #ifdef __cplusplus } #endif #ifndef VOS_OK #define VOS_OK 0 #endif #ifndef VOS_ERR #define VOS_ERR 1 #endif TEST(OM_AcpuCallBackMsgProc1, UT) { MOCKER(OM_Log1) .expects(once()); uttest_OM_AcpuCallBackMsgProc_case1(); GlobalMockObject::reset(); } TEST(OM_AcpuCallBackMsgProc2, UT) { MOCKER(OM_Log1) .expects(once()); uttest_OM_AcpuCallBackMsgProc_case2(); GlobalMockObject::reset(); } TEST(OM_AcpuCallBackMsgProc3, UT) { MOCKER(OM_Log1) .expects(once()); uttest_OM_AcpuCallBackMsgProc_case3(); GlobalMockObject::reset(); } TEST(OM_AcpuCallBackMsgProc4, UT) { uttest_OM_AcpuCallBackMsgProc_case4(); } TEST(OM_AcpuCallBackFidInit1, UT) { MOCKER(VOS_RegisterPIDInfo) .stubs() .will(returnValue(VOS_ERR)); EXPECT_EQ(VOS_OK, uttest_OM_AcpuCallBackFidInit_case1()); GlobalMockObject::reset(); } TEST(OM_AcpuCallBackFidInit2, UT) { MOCKER(VOS_RegisterPIDInfo) .stubs() .will(returnValue((unsigned int)VOS_OK)); MOCKER(VOS_RegisterMsgTaskPrio) .stubs() .will(returnValue((unsigned int)VOS_ERR)); EXPECT_EQ(VOS_OK, uttest_OM_AcpuCallBackFidInit_case2()); GlobalMockObject::reset(); } TEST(OM_AcpuCallBackFidInit3, UT) { MOCKER(VOS_RegisterPIDInfo) .stubs() .will(returnValue((unsigned int)VOS_OK)); MOCKER(VOS_RegisterMsgTaskPrio) .stubs() .will(returnValue((unsigned int)VOS_OK)); EXPECT_EQ(VOS_OK, uttest_OM_AcpuCallBackFidInit_case3()); GlobalMockObject::reset(); }
gpl-2.0
echeese/Quakespasm-OpenVR
Quake/net_wipx.h
1899
/* Copyright (C) 1996-2001 Id Software, Inc. Copyright (C) 2010-2014 QuakeSpasm developers This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __NET_WINIPX_H #define __NET_WINIPX_H sys_socket_t WIPX_Init (void); void WIPX_Shutdown (void); void WIPX_Listen (qboolean state); sys_socket_t WIPX_OpenSocket (int port); int WIPX_CloseSocket (sys_socket_t socketid); int WIPX_Connect (sys_socket_t socketid, struct qsockaddr *addr); sys_socket_t WIPX_CheckNewConnections (void); int WIPX_Read (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr); int WIPX_Write (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr); int WIPX_Broadcast (sys_socket_t socketid, byte *buf, int len); const char *WIPX_AddrToString (struct qsockaddr *addr); int WIPX_StringToAddr (const char *string, struct qsockaddr *addr); int WIPX_GetSocketAddr (sys_socket_t socketid, struct qsockaddr *addr); int WIPX_GetNameFromAddr (struct qsockaddr *addr, char *name); int WIPX_GetAddrFromName (const char *name, struct qsockaddr *addr); int WIPX_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); int WIPX_GetSocketPort (struct qsockaddr *addr); int WIPX_SetSocketPort (struct qsockaddr *addr, int port); #endif /* __NET_WINIPX_H */
gpl-2.0
zrafa/linuxkernel
linux-2.6.17.new/include/asm-arm/hardirq.h
715
#ifndef __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H #include <linux/config.h> #include <linux/cache.h> #include <linux/threads.h> #include <asm/irq.h> typedef struct { unsigned int __softirq_pending; unsigned int local_timer_irqs; } ____cacheline_aligned irq_cpustat_t; #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ #if NR_IRQS > 256 #define HARDIRQ_BITS 9 #else #define HARDIRQ_BITS 8 #endif /* * The hardirq mask has to be large enough to have space * for potentially all IRQ sources in the system nesting * on a single CPU: */ #if (1 << HARDIRQ_BITS) < NR_IRQS # error HARDIRQ_BITS is too low! #endif #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 #endif /* __ASM_HARDIRQ_H */
gpl-2.0
dilawar/sesc
src_without_LF/libpower/cacti/cacti_setup.cpp
23999
/* SESC: Super ESCalar simulator Copyright (C) 2005 University of California, Santa Cruz Contributed by Jose Renau This file is part of SESC. SESC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. SESC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SESC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <ctype.h> #include <math.h> //#include "nanassert.h" //#include "Snippets.h" //#include "SescConf.h" #include "nanassert.h" #include "SescConf.h" #include "Snippets.h" extern "C" { #include "cacti42_areadef.h" #include "cacti_interface.h" #include "cacti42_def.h" #include "cacti42_io.h" } #ifdef SESC_SESCTHERM #include "ThermTrace.h" ThermTrace *sescTherm=0; #endif /*------------------------------------------------------------------------------*/ #include <vector> static double tech; static int res_memport; static double wattch2cactiFactor = 1; double getEnergy(int size ,int bsize ,int assoc ,int rdPorts ,int wrPorts ,int subBanks ,int useTag ,int bits ,xcacti_flp *xflp ); double getEnergy(const char *,xcacti_flp *); //extern "C" void output_data(result_type *result, arearesult_type *arearesult, // area_type *arearesult_subbanked, // parameter_type *parameters, double *NSubbanks); /* extern "C" void output_data(result_type *result, arearesult_type *arearesult, parameter_type *parameters); extern "C" total_result_type cacti_interface( int cache_size, int line_size, int associativity, int rw_ports, int excl_read_ports, int excl_write_ports, int single_ended_read_ports, int banks, double tech_node, int output_width, int specific_tag, int tag_width, int access_mode, int pure_sram); extern "C" void xcacti_power_flp(const result_type *result, const arearesult_type *arearesult, const area_type *arearesult_subbanked, const parameter_type *parameters, xcacti_flp *xflp); */ void iterate(); int getInstQueueSize(const char* proc) { // get the clusters int min = SescConf->getRecordMin(proc,"cluster") ; int max = SescConf->getRecordMax(proc,"cluster") ; int total = 0; int num = 0; for(int i = min ; i <= max ; i++){ const char* cc = SescConf->getCharPtr(proc,"cluster",i) ; if(SescConf->checkInt(cc,"winSize")){ int sz = SescConf->getInt(cc,"winSize") ; total += sz; num++; } } // check if(!num){ fprintf(stderr,"no clusters\n"); exit(-1); } return total/num; } #ifdef SESC_SESCTHERM static void update_layout_bank(const char *blockName, xcacti_flp *xflp, const ThermTrace::FLPUnit *flp) { double dx; double dy; double a; // +------------------------------+ // | bank ctrl | // +------------------------------+ // | tag | de | data | // | array | co | array | // | | de | | // +------------------------------+ // | tag_ctrl | data_ctrl | // +------------------------------+ const char *flpSec = SescConf->getCharPtr("","floorplan"); size_t max = SescConf->getRecordMax(flpSec,"blockDescr"); max++; char cadena[1024]; //-------------------------------- // Find top block bank_ctrl dy = flp->delta_y*(xflp->bank_ctrl_a/xflp->total_a); if (xflp->bank_ctrl_e) { // Only if bankCtrl consumes energy sprintf(cadena, "%sBankCtrl %g %g %g %g", blockName, flp->delta_x, dy, flp->x, flp->y); SescConf->updateRecord(flpSec, "blockDescr", strdup(cadena) , max); sprintf(cadena,"%sBankCtrlEnergy", blockName); SescConf->updateRecord(flpSec, "blockMatch", strdup(cadena) , max); max++; } double tag_start_y = dy + flp->y; //-------------------------------- // Find lower blocks tag_ctrl and data_ctrl dy = flp->delta_y*((3*xflp->tag_ctrl_a+3*xflp->data_ctrl_a)/xflp->total_a); a = xflp->tag_ctrl_a+xflp->data_ctrl_a; dx = flp->delta_x*(xflp->tag_ctrl_a/a); double tag_end_y = flp->y+flp->delta_y-dy; if (xflp->tag_array_e) { // Only if tag consumes energy sprintf(cadena,"%sTagCtrl %g %g %g %g", blockName, dx/3, dy, flp->x+dx/3, tag_end_y); SescConf->updateRecord(flpSec, "blockDescr", strdup(cadena) , max); sprintf(cadena,"%sTagCtrlEnergy", blockName); SescConf->updateRecord(flpSec, "blockMatch", strdup(cadena) , max); max++; } sprintf(cadena,"%sDataCtrl %g %g %g %g", blockName, (flp->delta_x-dx)/3, dy, flp->x+dx+(flp->delta_x-dx)/3, tag_end_y); SescConf->updateRecord(flpSec, "blockDescr", strdup(cadena) , max); sprintf(cadena,"%sDataCtrlEnergy", blockName); SescConf->updateRecord(flpSec, "blockMatch", strdup(cadena) , max); max++; //-------------------------------- // Find middle blocks tag array, decode, and data array a = xflp->tag_array_a+xflp->data_array_a+xflp->decode_a; dy = tag_end_y - tag_start_y; if (xflp->tag_array_e) { dx = flp->delta_x*(xflp->tag_array_a/a); sprintf(cadena, "%sTagArray %g %g %g %g", blockName, dx, dy, flp->x, tag_start_y); SescConf->updateRecord(flpSec, "blockDescr", strdup(cadena) , max); sprintf(cadena,"%sTagArrayEnergy", blockName); SescConf->updateRecord(flpSec, "blockMatch", strdup(cadena) , max); max++; } double x = flp->x + dx; dx = flp->delta_x*((xflp->decode_a)/a); sprintf(cadena, "%sDecode %g %g %g %g", blockName, dx, dy, x, tag_start_y); SescConf->updateRecord(flpSec, "blockDescr", strdup(cadena) , max); sprintf(cadena,"%sDecodeEnergy", blockName); SescConf->updateRecord(flpSec, "blockMatch", strdup(cadena) , max); max++; dx = flp->delta_x*((xflp->data_array_a)/a); sprintf(cadena, "%sDataArray %g %g %g %g", blockName, dx, dy, flp->x+flp->delta_x-dx, tag_start_y); SescConf->updateRecord(flpSec, "blockDescr", strdup(cadena) , max); sprintf(cadena,"%sDataArrayEnergy", blockName); SescConf->updateRecord(flpSec, "blockMatch", strdup(cadena) , max); max++; } static void update_sublayout(const char *blockName, xcacti_flp *xflp, const ThermTrace::FLPUnit *flp, int id) { if(id==1) { update_layout_bank(blockName,xflp,flp); }else if ((id % 2) == 0) { // even number ThermTrace::FLPUnit flp1 = *flp; ThermTrace::FLPUnit flp2 = *flp; if (flp->delta_x > flp->delta_y) { // x-axe is bigger flp1.delta_x = flp->delta_x/2; flp2.delta_x = flp->delta_x/2; flp2.x = flp->x+flp->delta_x/2; }else{ // y-axe is bigger flp1.delta_y = flp->delta_x/2; flp2.delta_y = flp->delta_y/2; flp2.y = flp->y + flp->delta_y/2; } update_sublayout(blockName, xflp, &flp1, id/2); update_sublayout(blockName, xflp, &flp2, id/2); }else{ MSG("Invalid number of banks to partition. Please use power of two"); exit(-1); I(0); // In } } void update_layout(const char *blockName, xcacti_flp *xflp) { const ThermTrace::FLPUnit *flp = sescTherm->findBlock(blockName); I(flp); if (flp == 0) { MSG("Error: blockName[%s] not found in blockDescr",blockName); exit(-1); return; // no match found } update_sublayout(blockName, xflp, flp, xflp->NSubbanks*xflp->assoc); } #endif void iterate() { std::vector<char *> sections; std::vector<char *>::iterator it; SescConf->getAllSections(sections) ; char line[100] ; for(it = sections.begin();it != sections.end(); it++) { const char *block = *it; if (!SescConf->checkCharPtr(block,"deviceType")) continue; const char *name = SescConf->getCharPtr(block,"deviceType") ; if(strcasecmp(name,"vbus")==0){ SescConf->updateRecord(block,"busEnergy",0.0) ; // FIXME: compute BUS energy }else if (strcasecmp(name,"niceCache") == 0) { // No energy for ideal caches (DRAM bank) SescConf->updateRecord(block, "RdHitEnergy" ,0.0); SescConf->updateRecord(block, "RdMissEnergy" ,0.0); SescConf->updateRecord(block, "WrHitEnergy" ,0.0); SescConf->updateRecord(block, "WrMissEnergy" ,0.0); }else if(strstr(name,"cache") || strstr(name,"tlb") || strstr(name,"mem") || strstr(name,"dir") || !strcmp(name,"revLVIDTable") ) { xcacti_flp xflp; double eng = getEnergy(block, &xflp); #ifdef SESC_SESCTHERM2 if (SescConf->checkCharPtr(block,"blockName")) { const char *blockName = SescConf->getCharPtr(block,"blockName"); MSG("%s (block=%s) has blockName %s",name, block, blockName); update_layout(blockName, &xflp); } #else // write it SescConf->updateRecord(block, "RdHitEnergy" ,eng); SescConf->updateRecord(block, "RdMissEnergy" ,eng * 2); // Rd miss + lineFill SescConf->updateRecord(block, "WrHitEnergy" ,eng); SescConf->updateRecord(block, "WrMissEnergy" ,eng * 2); // Wr miss + lineFill #endif } } } char * strfy(int v){ char *t = new char[10] ; sprintf(t,"%d",v); return t ; } char *strfy(double v){ char *t = new char[10] ; sprintf(t,"%lf",v); return t ; } double getEnergy(int size ,int bsize ,int assoc ,int rdPorts ,int wrPorts ,int subBanks ,int useTag ,int bits ,xcacti_flp *xflp ) { int nsets = size/(bsize*assoc); int fully_assoc, associativity; int rwPorts = 0; double ret; if (nsets == 0) { printf("Invalid cache parameters size[%d], bsize[%d], assoc[%d]\n", size, bsize, assoc); exit(0); } if (subBanks == 0) { printf("Invalid cache subbanks parameters\n"); exit(0); } if ((size/subBanks)<64) { printf("size %d: subBanks %d: assoc %d : nset %d\n",size,subBanks,assoc,nsets); size =64*subBanks; } if (rdPorts>1) { wrPorts = rdPorts-2; rdPorts = 2; } if ((rdPorts+wrPorts+rwPorts) < 1) { rdPorts = 0; wrPorts = 0; rwPorts = 1; } if (bsize*8 < bits) bsize = bits/8; BITOUT = bits; if (size == bsize * assoc) { fully_assoc = 1; }else{ fully_assoc = 0; } size = roundUpPower2(size); if (fully_assoc) { associativity = size/bsize; }else{ associativity = assoc; } if (associativity >= 32) associativity = size/bsize; nsets = size/(bsize*associativity); total_result_type result2; printf("\n\n\n########################################################"); printf("\nInput to Cacti_Interface..."); printf("\n size = %d, bsize = %d, assoc = %d, rports = %d, wports = %d", size, bsize, associativity, rdPorts, wrPorts); printf("\n subBanks = %d, tech = %f, bits = %d", subBanks, tech, bits); result2 = cacti_interface(size, bsize, associativity, rwPorts, rdPorts, wrPorts, 0, subBanks, tech, bits, 0, 0, // custom tag 0, useTag); #ifdef DEBUG //output_data(&result,&arearesult,&arearesult_subbanked,&parameters); output_data(&result2.result,&result2.area,&result2.params); #endif //xcacti_power_flp(&result,&arearesult,&arearesult_subbanked,&parameters, xflp); xcacti_power_flp(&result2.result, &result2.area, &result2.arearesult_subbanked, &result2.params, xflp); //return wattch2cactiFactor * 1e9*(result.total_power_without_routing/subBanks + result.total_routing_power); return wattch2cactiFactor * 1e9*(result2.result.total_power_without_routing.readOp.dynamic / subBanks + result2.result.total_routing_power.readOp.dynamic); } double getEnergy(const char *section, xcacti_flp *xflp) { // set the input int cache_size = SescConf->getInt(section,"size") ; int block_size = SescConf->getInt(section,"bsize") ; int assoc = SescConf->getInt(section,"assoc") ; int write_ports = 0 ; int read_ports = SescConf->getInt(section,"numPorts"); int readwrite_ports = 1; int subbanks = 1; int bits = 32; if(SescConf->checkInt(section,"subBanks")) subbanks = SescConf->getInt(section,"subBanks"); if(SescConf->checkInt(section,"bits")) bits = SescConf->getInt(section,"bits"); printf("Module [%s]...\n", section); return getEnergy(cache_size ,block_size ,assoc ,read_ports ,readwrite_ports ,subbanks ,1 ,bits ,xflp); } void processBranch(const char *proc) { // FIXME: add thermal block to branch predictor // get the branch const char* bpred = SescConf->getCharPtr(proc,"bpred") ; // get the type const char* type = SescConf->getCharPtr(bpred,"type") ; xcacti_flp xflp; double bpred_power=0; // switch based on the type if(!strcmp(type,"Taken") || !strcmp(type,"Oracle") || !strcmp(type,"NotTaken") || !strcmp(type,"Static")) { // No tables bpred_power= 0; }else if(!strcmp(type,"2bit")) { int size = SescConf->getInt(bpred,"size") ; // 32 = 8bytes line * 4 predictions per byte (assume 2bit counter) bpred_power = getEnergy(size/32, 8, 1, 1, 0, 1, 0, 8, &xflp); bpred_power= 0; }else if(!strcmp(type,"2level")) { int size = SescConf->getInt(bpred,"l2size") ; // 32 = 8bytes line * 4 predictions per byte (assume 2bit counter) bpred_power = getEnergy(size/32, 8, 1, 1, 0, 1, 0, 8, &xflp); }else if(!strcmp(type,"ogehl")) { int mTables = SescConf->getInt(bpred,"mtables") ; int size = SescConf->getInt(bpred,"tsize") ; I(0); // 32 = 8bytes line * 4 predictions per byte (assume 2bit counter) bpred_power = getEnergy(size/32, 8, 1, 1, 0, 1, 0, 8, &xflp) * mTables; }else if(!strcmp(type,"hybrid")) { int size = SescConf->getInt(bpred,"localSize") ; // 32 = 8bytes line * 4 predictions per byte (assume 2bit counter) bpred_power = getEnergy(size/32, 8, 1, 1, 0, 1, 0, 8, &xflp); #ifdef SESC_SESCTHERM2 // FIXME: update layout #endif size = SescConf->getInt(bpred,"metaSize"); // 32 = 8bytes line * 4 predictions per byte (assume 2bit counter) bpred_power += getEnergy(size/32, 8, 1, 1, 0, 1, 0, 8, &xflp); }else{ MSG("Unknown energy for branch predictor type [%s]", type); exit(-1); } #ifdef SESC_SESCTHERM2 // FIXME: partition energies per structure const char *bpredBlockName = SescConf->getCharPtr(bpred, "blockName"); update_layout(bpredBlockName, &xflp); #else SescConf->updateRecord(proc,"bpredEnergy",bpred_power) ; #endif int btbSize = SescConf->getInt(bpred,"btbSize"); int btbAssoc = SescConf->getInt(bpred,"btbAssoc"); double btb_power = 0; if (btbSize) { btb_power = getEnergy(btbSize*8, 8, btbAssoc, 1, 0, 1, 1, 64, &xflp); #ifdef SESC_SESCTHERM2 // FIXME: partition energies per structure update_layout(bpredBlockName, &xflp); #else SescConf->updateRecord(proc,"btbEnergy",btb_power) ; #endif }else{ SescConf->updateRecord(proc,"btbEnergy",0.0) ; } double ras_power =0; int ras_size = SescConf->getInt(bpred,"rasSize"); if (ras_size) { ras_power = getEnergy(ras_size*8, 8, 1, 1, 0, 1, 0, 64, &xflp); #ifdef SESC_SESCTHERM2 // FIXME: partition energies per structure (all bpred may share a block) update_layout(bpredBlockName, &xflp); #else SescConf->updateRecord(proc,"rasEnergy",ras_power) ; #endif }else{ SescConf->updateRecord(proc,"rasEnergy",0.0) ; } } void processorCore() { const char *proc = SescConf->getCharPtr("","cpucore",0) ; fprintf(stderr,"proc = [%s]\n",proc); xcacti_flp xflp; //---------------------------------------------- // Branch Predictor processBranch(proc); //---------------------------------------------- // Register File int issueWidth= SescConf->getInt(proc,"issueWidth"); int size = SescConf->getInt(proc,"intRegs"); int banks = 1; int rdPorts = 2*issueWidth; int wrPorts = issueWidth; int bits = 32; int bytes = 8; if(SescConf->checkInt(proc,"bits")) { bits = SescConf->getInt(proc,"bits"); bytes = bits/8; if (bits*8 != bytes) { fprintf(stderr,"Not valid number of bits for the processor core [%d]\n",bits); exit(-2); } } if(SescConf->checkInt(proc,"intRegBanks")) banks = SescConf->getInt(proc,"intRegBanks"); if(SescConf->checkInt(proc,"intRegRdPorts")) rdPorts = SescConf->getInt(proc,"intRegRdPorts"); if(SescConf->checkInt(proc,"intRegWrPorts")) wrPorts = SescConf->getInt(proc,"intRegWrPorts"); double regEnergy = getEnergy(size*bytes, bytes, 1, rdPorts, wrPorts, banks, 0, bits, &xflp); printf("\nRegister [%d bytes] banks[%d] ports[%d] Energy[%g]\n" ,size*bytes, banks, rdPorts+wrPorts, regEnergy); #ifdef SESC_SESCTHERM2 const char *blockName = SescConf->getCharPtr(proc,"IntRegBlockName"); I(blockName); update_layout(blockName, &xflp); blockName = SescConf->getCharPtr(proc,"fpRegBlockName"); I(blockName); update_layout(blockName , &xflp); // FIXME: different energy for FP register #else SescConf->updateRecord(proc,"wrRegEnergy",regEnergy); SescConf->updateRecord(proc,"rdRegEnergy",regEnergy); #endif //---------------------------------------------- // Load/Store Queue size = SescConf->getInt(proc,"maxLoads"); banks = 1; rdPorts = res_memport; wrPorts = res_memport; if(SescConf->checkInt(proc,"lsqBanks")) banks = SescConf->getInt(proc,"lsqBanks"); regEnergy = getEnergy(size*2*bytes,2*bytes,size,rdPorts,wrPorts,banks,1, 2*bits, &xflp); #ifdef SESC_SESCTHERM2 // FIXME: partition energies per structure blockName = SescConf->getCharPtr(proc,"LSQBlockName"); I(blockName); update_layout(lsqBlockName, &xflp); #else SescConf->updateRecord(proc,"ldqRdWrEnergy",regEnergy); #endif printf("\nLoad Queue [%d bytes] banks[%d] ports[%d] Energy[%g]\n" ,size*2*bytes, banks, 2*res_memport, regEnergy); size = SescConf->getInt(proc,"maxStores"); regEnergy = getEnergy(size*4*bytes,4*bytes,size,rdPorts,wrPorts,banks,1, 2*bits, &xflp); #ifdef SESC_SESCTHERM2 // FIXME: partition energies per structure blockName = SescConf->getCharPtr(proc,"LSQBlockName"); I(blockName); update_layout(lsqBlockName, &xflp); #else SescConf->updateRecord(proc,"stqRdWrEnergy",regEnergy); #endif printf("\nStore Queue [%d bytes] banks[%d] ports[%d] Energy[%g]\n" ,size*4*bytes, banks, 2*res_memport, regEnergy); #ifdef SESC_INORDER size = size/4; regEnergy = getEnergy(size*4*bytes,4*bytes,size,rdPorts,wrPorts,banks,1, 2*bits, &xflp); printf("\nStore Inorder Queue [%d bytes] banks[%d] ports[%d] Energy[%g]\n" ,size*4*bytes, banks, 2*res_memport, regEnergy); SescConf->updateRecord(proc,"stqRdWrEnergyInOrder",regEnergy); #ifdef SESC_SESCTHERM I(0); exit(-1); // Not supported #endif #endif //---------------------------------------------- // Reorder Buffer size = SescConf->getInt(proc,"robSize"); banks = size/64; if (banks == 0) { banks = 1; }else{ banks = roundUpPower2(banks); } // Retirement should hit another bank rdPorts = 1; // continuous possitions wrPorts = 1; regEnergy = getEnergy(size*2,2*issueWidth,1,rdPorts,wrPorts,banks,0,16*issueWidth, &xflp); #ifdef SESC_SESCTHERM2 const char *blockName = SescConf->getCharPtr(proc,"robBlockName"); I(blockName); update_layout(blockName, &xflp); // FIXME: partition energies per structure #else SescConf->updateRecord(proc,"robEnergy",regEnergy); #endif printf("\nROB [%d bytes] banks[%d] ports[%d] Energy[%g]\n",size*2, banks, 2*rdPorts, regEnergy); //---------------------------------------------- // Rename Table { double bitsPerEntry = log(SescConf->getInt(proc,"intRegs"))/log(2); size = roundUpPower2(static_cast<unsigned int>(32*bitsPerEntry/8)); banks = 1; rdPorts = 2*issueWidth; wrPorts = issueWidth; regEnergy = getEnergy(size,1,1,rdPorts,wrPorts,banks,0,1, &xflp); #ifdef SESC_SESCTHERM2 update_layout("IntRAT", &xflp); //FIXME: create a IntRATblockName // FIXME: partition energies per structure #endif printf("\nrename [%d bytes] banks[%d] Energy[%g]\n",size, banks, regEnergy); regEnergy += getEnergy(size,1,1,rdPorts/2+1,wrPorts/2+1,banks,0,1, &xflp); #ifdef SESC_SESCTHERM2 update_layout("IntRAT", &xflp); // FIXME: partition energies per structure #else // unified FP+Int RAT energy counter SescConf->updateRecord(proc,"renameEnergy",regEnergy); #endif } //---------------------------------------------- // Window Energy & Window + DDIS { int min = SescConf->getRecordMin(proc,"cluster") ; int max = SescConf->getRecordMax(proc,"cluster") ; I(min==0); for(int i = min ; i <= max ; i++) { const char *cluster = SescConf->getCharPtr(proc,"cluster",i) ; // TRADITIONAL COLLAPSING ISSUE LOGIC // Recalculate windowRdWrEnergy using CACTI (keep select and wake) size = SescConf->getInt(cluster,"winSize"); banks = 1; rdPorts = SescConf->getInt(cluster,"wakeUpNumPorts"); wrPorts = issueWidth; int robSize = SescConf->getInt(proc,"robSize"); float entryBits = 4*(log(robSize)/log(2)); // src1, src2, dest, instID entryBits += 7; // opcode entryBits += 1; // ready bit int tableBits = static_cast<int>(entryBits * size); int tableBytes; if (tableBits < 8) { tableBits = 8; tableBytes = 1; }else{ tableBytes = tableBits/8; } int assoc= roundUpPower2(static_cast<unsigned int>(entryBits/8)); tableBytes = roundUpPower2(tableBytes); regEnergy = getEnergy(tableBytes,tableBytes/assoc,assoc,rdPorts,wrPorts,banks,1,static_cast<int>(entryBits), &xflp); printf("\nWindow [%d bytes] assoc[%d] banks[%d] ports[%d] Energy[%g]\n" ,tableBytes, assoc, banks, rdPorts+wrPorts, regEnergy); #ifdef SESC_SESCTHERM2 const char *blockName = SescConf->getCharPtr(cluster,"blockName"); I(blockName); update_layout(blockName, &xflp); #else // unified FP+Int RAT energy counter SescConf->updateRecord(cluster,"windowRdWrEnergy" ,regEnergy,0); #endif } } } void cacti_setup() { const char *technology = SescConf->getCharPtr("","technology"); fprintf(stderr,"technology = [%s]\n",technology); tech = SescConf->getInt(technology,"tech"); fprintf(stderr, "tech : %9.0fnm\n" , tech); tech /= 1000; #ifdef SESC_SESCTHERM sescTherm = new ThermTrace(0); // No input trace, just read conf #endif const char *proc = SescConf->getCharPtr("","cpucore",0); const char *l1Cache = SescConf->getCharPtr(proc,"dataSource"); const char *l1CacheSpace = strstr(l1Cache," "); char *l1Section = strdup(l1Cache); if (l1CacheSpace) l1Section[l1CacheSpace - l1Cache] = 0; res_memport = SescConf->getInt(l1Section,"numPorts"); xcacti_flp xflp; double l1Energy = getEnergy(l1Section, &xflp); double WattchL1Energy = SescConf->getDouble("","wattchDataCacheEnergy"); if (WattchL1Energy) { wattch2cactiFactor = WattchL1Energy/l1Energy; fprintf(stderr,"wattch2cacti Factor %g\n", wattch2cactiFactor); }else{ fprintf(stderr,"-----WARNING: No wattch correction factor\n"); } processorCore(); iterate(); }
gpl-2.0
bmerry/casacore
tables/DataMan/TiledFileAccess.h
9226
//# TiledFileAccess.h: Tiled access to an array in a file //# Copyright (C) 2001,2002 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# $Id$ #ifndef TABLES_TILEDFILEACCESS_H #define TABLES_TILEDFILEACCESS_H //# Includes #include <casacore/casa/aips.h> #include <casacore/tables/DataMan/TSMCube.h> #include <casacore/tables/DataMan/TSMOption.h> #include <casacore/casa/Utilities/DataType.h> namespace casacore { //# NAMESPACE CASACORE - BEGIN //# Forward Declarations class TiledFileHelper; class Slicer; // <summary> // Tiled access to an array in a file. // </summary> // <use visibility=export> // <reviewed reviewer="" date="" tests="tTiledFileAccess.cc"> // </reviewed> // <prerequisite> //# Classes you should understand before using this one. // <li> Description of Tiled Storage Manager in module file // <linkto module=Tables:TiledStMan>Tables.h</linkto> // <li> <linkto class=ROTiledStManAccessor>ROTiledStManAccessor</linkto> // for a discussion of the maximum cache size // </prerequisite> // <synopsis> // TiledFileAccess is a class that makes it possible to access // an arbitrary array in a file using the tiled storage manager classes. // It can handle arrays of any type supported by the tiled storage // managers. The array can be in big or little endian canonical format. // <p> // See <linkto class=ROTiledStManAccessor>ROTiledStManAccessor</linkto> // for a more detailed discussion. // </synopsis> // <motivation> // This class makes it possible to access an image in a FITS file. // </motivation> // <example> // <srcblock> // // Define the object which also opens the file. // // The (float) array starts at offset 2880. // TiledFileAccess tfa ("fits.file", 2880, IPosition(2,512,512), // IPosition(2,512,1), TpFloat); // // Get all the data. // Array<Float> data = tfa.getFloat (Slicer(IPosition(2,0,0), tfa.shape())); // </srcblock> // </example> //# <todo asof="$DATE:$"> //# A List of bugs, limitations, extensions or planned refinements. //# </todo> class TiledFileAccess { public: // Create a TiledFileAccess object. // The data is assumed to be in local canonical format // (thus big endian on e.g. SUN and little endian on e.g. PC). // The TSMOption determines how the file is accessed. TiledFileAccess (const String& fileName, Int64 fileOffset, const IPosition& shape, const IPosition& tileShape, DataType dataType, const TSMOption& = TSMOption(), Bool writable=False); // Create a TiledFileAccess object. // The endian format of the data is explicitly given. TiledFileAccess (const String& fileName, Int64 fileOffset, const IPosition& shape, const IPosition& tileShape, DataType dataType, const TSMOption&, Bool writable, Bool bigEndian); ~TiledFileAccess(); // Is the file writable? Bool isWritable() const { return itsWritable; } DataType dataType() const { return itsDataType; } // Get part of the array. // The Array object is resized if needed. // <group> Array<Bool> getBool (const Slicer& section); Array<uChar> getUChar (const Slicer& section); Array<Short> getShort (const Slicer& section); Array<Int> getInt (const Slicer& section); Array<Float> getFloat (const Slicer& section); Array<Double> getDouble (const Slicer& section); Array<Complex> getComplex (const Slicer& section); Array<DComplex> getDComplex (const Slicer& section); void get (Array<Bool>&, const Slicer& section); void get (Array<uChar>&, const Slicer& section); void get (Array<Short>&, const Slicer& section); void get (Array<Int>&, const Slicer& section); void get (Array<Float>&, const Slicer& section); void get (Array<Double>&, const Slicer& section); void get (Array<Complex>&, const Slicer& section); void get (Array<DComplex>&, const Slicer& section); // </group> // Get the array and scale/offset the data using the given values. // It is meant for FITS, so for now they can only be used for TpUChar, TpShort // or TpInt TiledFileAccess objects. // A deleteValue is set to a NaN without being scaled. // <group> Array<Float> getFloat (const Slicer& section, Float scale, Float offset, uChar deleteValue, Bool examineForDeleteValues=True); Array<Float> getFloat (const Slicer& section, Float scale, Float offset, Short deleteValue, Bool examineForDeleteValues=True); Array<Float> getFloat (const Slicer& section, Float scale, Float offset, Int deleteValue, Bool examineForDeleteValues=True); void get (Array<Float>&, const Slicer& section, Float scale, Float offset, uChar deleteValue, Bool examineForDeleteValues=True); void get (Array<Float>&, const Slicer& section, Float scale, Float offset, Short deleteValue, Bool examineForDeleteValues=True); void get (Array<Float>&, const Slicer& section, Float scale, Float offset, Int deleteValue, Bool examineForDeleteValues=True); // </group> // Put part of the array. // <group> void put (const Array<Bool>&, const Slicer& section); void put (const Array<uChar>&, const Slicer& section); void put (const Array<Short>&, const Slicer& section); void put (const Array<Int>&, const Slicer& section); void put (const Array<Float>&, const Slicer& section); void put (const Array<Double>&, const Slicer& section); void put (const Array<Complex>&, const Slicer& section); void put (const Array<DComplex>&, const Slicer& section); // </group> // Flush the cache. void flush() { itsCube->flushCache(); } // Empty the cache. // It will flush the cache as needed and remove all buckets from it // resulting in a possibly large drop in memory used. // It'll also clear the <src>userSetCache_p</src> flag. void clearCache() { itsCube->emptyCache(); } // Show the cache statistics. void showCacheStatistics (ostream& os) const { itsCube->showCacheStatistics (os); } // Get the shape of the array. const IPosition& shape() const { return itsCube->cubeShape(); } // Get the shape of the tiles. const IPosition& tileShape() const { return itsCube->tileShape(); } // Set the maximum cache size (in bytes). // 0 means no maximum. void setMaximumCacheSize (uInt nbytes); // Get the maximum cache size (in bytes). uInt maximumCacheSize() const; // Get the current cache size (in buckets). uInt cacheSize() const { return itsCube->cacheSize(); } // Set the cache size using the given access pattern. // <group> void setCacheSize (const IPosition& sliceShape, const IPosition& axisPath, Bool forceSmaller=True) { itsCube->setCacheSize (sliceShape, IPosition(), IPosition(), axisPath, forceSmaller, True); } void setCacheSize (const IPosition& sliceShape, const IPosition& windowStart, const IPosition& windowLength, const IPosition& axisPath, Bool forceSmaller=True) { itsCube->setCacheSize (sliceShape, windowStart, windowLength, axisPath, forceSmaller, True); } // </group> // Set the cache size for accessing the data. // When the give cache size exceeds the maximum cache size with more // than 10%, the maximum cache size is used instead. // <br>When forceSmaller is False, the cache is not resized when the // new size is smaller. void setCacheSize (uInt nbuckets, Bool forceSmaller=True) { itsCube->setCacheSize (nbuckets, forceSmaller, True); } // Make a tile shape from the array shape to fit as closely as possible // the number of pixels in the tile. static IPosition makeTileShape (const IPosition& arrayShape, uInt nrPixelsPerTile = 32768); private: // Forbid copy constructor and assignment. // <group> TiledFileAccess (const TiledFileAccess&); TiledFileAccess& operator= (const TiledFileAccess&); // </group> TSMCube* itsCube; TiledFileHelper* itsTSM; uInt itsLocalPixelSize; Bool itsWritable; DataType itsDataType; }; } //# NAMESPACE CASACORE - END #endif
gpl-2.0
rinrin-/cygwin-alternative
winsup/cygwin/include/cygwin/stat.h
2279
/* cygwin/stat.h Copyright 2002, 2007, 2010 Red Hat Inc. Written by Corinna Vinschen <corinna@vinschen.de> This file is part of Cygwin. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ #ifndef _CYGWIN_STAT_H #define _CYGWIN_STAT_H #ifdef __cplusplus extern "C" { #endif #if defined (__INSIDE_CYGWIN__) || defined (_COMPILING_NEWLIB) struct __stat32 { __dev16_t st_dev; __ino32_t st_ino; mode_t st_mode; nlink_t st_nlink; __uid16_t st_uid; __gid16_t st_gid; __dev16_t st_rdev; _off_t st_size; timestruc_t st_atim; timestruc_t st_mtim; timestruc_t st_ctim; blksize_t st_blksize; __blkcnt32_t st_blocks; long st_spare4[2]; }; struct __stat64 { __dev32_t st_dev; __ino64_t st_ino; mode_t st_mode; nlink_t st_nlink; __uid32_t st_uid; __gid32_t st_gid; __dev32_t st_rdev; _off64_t st_size; timestruc_t st_atim; timestruc_t st_mtim; timestruc_t st_ctim; blksize_t st_blksize; __blkcnt64_t st_blocks; timestruc_t st_birthtim; }; extern int fstat64 (int fd, struct __stat64 *buf); extern int stat64 (const char *file_name, struct __stat64 *buf); extern int lstat64 (const char *file_name, struct __stat64 *buf); #endif struct stat { dev_t st_dev; ino_t st_ino; mode_t st_mode; nlink_t st_nlink; uid_t st_uid; gid_t st_gid; dev_t st_rdev; off_t st_size; timestruc_t st_atim; timestruc_t st_mtim; timestruc_t st_ctim; blksize_t st_blksize; blkcnt_t st_blocks; timestruc_t st_birthtim; }; #define st_atime st_atim.tv_sec #define st_mtime st_mtim.tv_sec #define st_ctime st_ctim.tv_sec #define st_birthtime st_birthtim.tv_sec /* POSIX IPC objects are not implemented as distinct file types, so the below macros have to return 0. The expression is supposed to catch illegal usage with non-stat parameters. */ #define S_TYPEISMQ(buf) ((void)(buf)->st_mode,0) #define S_TYPEISSEM(buf) ((void)(buf)->st_mode,0) #define S_TYPEISSHM(buf) ((void)(buf)->st_mode,0) #ifdef __cplusplus } #endif #endif /* _CYGWIN_STAT_H */
gpl-2.0
rlane/dpdk
drivers/net/fm10k/fm10k_rxtx_vec.c
24513
/*- * BSD LICENSE * * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <inttypes.h> #include <rte_ethdev.h> #include <rte_common.h> #include "fm10k.h" #include "base/fm10k_type.h" #include <tmmintrin.h> #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wcast-qual" #endif static void fm10k_reset_tx_queue(struct fm10k_tx_queue *txq); /* Handling the offload flags (olflags) field takes computation * time when receiving packets. Therefore we provide a flag to disable * the processing of the olflags field when they are not needed. This * gives improved performance, at the cost of losing the offload info * in the received packet */ #ifdef RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE /* Vlan present flag shift */ #define VP_SHIFT (2) /* L3 type shift */ #define L3TYPE_SHIFT (4) /* L4 type shift */ #define L4TYPE_SHIFT (7) static inline void fm10k_desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts) { __m128i ptype0, ptype1, vtag0, vtag1; union { uint16_t e[4]; uint64_t dword; } vol; const __m128i pkttype_msk = _mm_set_epi16( 0x0000, 0x0000, 0x0000, 0x0000, PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT); /* mask everything except rss type */ const __m128i rsstype_msk = _mm_set_epi16( 0x0000, 0x0000, 0x0000, 0x0000, 0x000F, 0x000F, 0x000F, 0x000F); /* map rss type to rss hash flag */ const __m128i rss_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, 0, PKT_RX_RSS_HASH, 0, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, 0); ptype0 = _mm_unpacklo_epi16(descs[0], descs[1]); ptype1 = _mm_unpacklo_epi16(descs[2], descs[3]); vtag0 = _mm_unpackhi_epi16(descs[0], descs[1]); vtag1 = _mm_unpackhi_epi16(descs[2], descs[3]); ptype0 = _mm_unpacklo_epi32(ptype0, ptype1); ptype0 = _mm_and_si128(ptype0, rsstype_msk); ptype0 = _mm_shuffle_epi8(rss_flags, ptype0); vtag1 = _mm_unpacklo_epi32(vtag0, vtag1); vtag1 = _mm_srli_epi16(vtag1, VP_SHIFT); vtag1 = _mm_and_si128(vtag1, pkttype_msk); vtag1 = _mm_or_si128(ptype0, vtag1); vol.dword = _mm_cvtsi128_si64(vtag1); rx_pkts[0]->ol_flags = vol.e[0]; rx_pkts[1]->ol_flags = vol.e[1]; rx_pkts[2]->ol_flags = vol.e[2]; rx_pkts[3]->ol_flags = vol.e[3]; } static inline void fm10k_desc_to_pktype_v(__m128i descs[4], struct rte_mbuf **rx_pkts) { __m128i l3l4type0, l3l4type1, l3type, l4type; union { uint16_t e[4]; uint64_t dword; } vol; /* L3 pkt type mask Bit4 to Bit6 */ const __m128i l3type_msk = _mm_set_epi16( 0x0000, 0x0000, 0x0000, 0x0000, 0x0070, 0x0070, 0x0070, 0x0070); /* L4 pkt type mask Bit7 to Bit9 */ const __m128i l4type_msk = _mm_set_epi16( 0x0000, 0x0000, 0x0000, 0x0000, 0x0380, 0x0380, 0x0380, 0x0380); /* convert RRC l3 type to mbuf format */ const __m128i l3type_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RTE_PTYPE_L3_IPV6_EXT, RTE_PTYPE_L3_IPV6, RTE_PTYPE_L3_IPV4_EXT, RTE_PTYPE_L3_IPV4, 0); /* Convert RRC l4 type to mbuf format l4type_flags shift-left 8 bits * to fill into8 bits length. */ const __m128i l4type_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, RTE_PTYPE_TUNNEL_GENEVE >> 8, RTE_PTYPE_TUNNEL_NVGRE >> 8, RTE_PTYPE_TUNNEL_VXLAN >> 8, RTE_PTYPE_TUNNEL_GRE >> 8, RTE_PTYPE_L4_UDP >> 8, RTE_PTYPE_L4_TCP >> 8, 0); l3l4type0 = _mm_unpacklo_epi16(descs[0], descs[1]); l3l4type1 = _mm_unpacklo_epi16(descs[2], descs[3]); l3l4type0 = _mm_unpacklo_epi32(l3l4type0, l3l4type1); l3type = _mm_and_si128(l3l4type0, l3type_msk); l4type = _mm_and_si128(l3l4type0, l4type_msk); l3type = _mm_srli_epi16(l3type, L3TYPE_SHIFT); l4type = _mm_srli_epi16(l4type, L4TYPE_SHIFT); l3type = _mm_shuffle_epi8(l3type_flags, l3type); /* l4type_flags shift-left for 8 bits, need shift-right back */ l4type = _mm_shuffle_epi8(l4type_flags, l4type); l4type = _mm_slli_epi16(l4type, 8); l3l4type0 = _mm_or_si128(l3type, l4type); vol.dword = _mm_cvtsi128_si64(l3l4type0); rx_pkts[0]->packet_type = vol.e[0]; rx_pkts[1]->packet_type = vol.e[1]; rx_pkts[2]->packet_type = vol.e[2]; rx_pkts[3]->packet_type = vol.e[3]; } #else #define fm10k_desc_to_olflags_v(desc, rx_pkts) do {} while (0) #define fm10k_desc_to_pktype_v(desc, rx_pkts) do {} while (0) #endif int __attribute__((cold)) fm10k_rx_vec_condition_check(struct rte_eth_dev *dev) { #ifndef RTE_LIBRTE_IEEE1588 struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; struct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf; #ifndef RTE_FM10K_RX_OLFLAGS_ENABLE /* whithout rx ol_flags, no VP flag report */ if (rxmode->hw_vlan_extend != 0) return -1; #endif /* no fdir support */ if (fconf->mode != RTE_FDIR_MODE_NONE) return -1; /* - no csum error report support * - no header split support */ if (rxmode->hw_ip_checksum == 1 || rxmode->header_split == 1) return -1; return 0; #else RTE_SET_USED(dev); return -1; #endif } int __attribute__((cold)) fm10k_rxq_vec_setup(struct fm10k_rx_queue *rxq) { uintptr_t p; struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */ mb_def.nb_segs = 1; /* data_off will be ajusted after new mbuf allocated for 512-byte * alignment. */ mb_def.data_off = RTE_PKTMBUF_HEADROOM; mb_def.port = rxq->port_id; rte_mbuf_refcnt_set(&mb_def, 1); /* prevent compiler reordering: rearm_data covers previous fields */ rte_compiler_barrier(); p = (uintptr_t)&mb_def.rearm_data; rxq->mbuf_initializer = *(uint64_t *)p; return 0; } static inline void fm10k_rxq_rearm(struct fm10k_rx_queue *rxq) { int i; uint16_t rx_id; volatile union fm10k_rx_desc *rxdp; struct rte_mbuf **mb_alloc = &rxq->sw_ring[rxq->rxrearm_start]; struct rte_mbuf *mb0, *mb1; __m128i head_off = _mm_set_epi64x( RTE_PKTMBUF_HEADROOM + FM10K_RX_DATABUF_ALIGN - 1, RTE_PKTMBUF_HEADROOM + FM10K_RX_DATABUF_ALIGN - 1); __m128i dma_addr0, dma_addr1; /* Rx buffer need to be aligned with 512 byte */ const __m128i hba_msk = _mm_set_epi64x(0, UINT64_MAX - FM10K_RX_DATABUF_ALIGN + 1); rxdp = rxq->hw_ring + rxq->rxrearm_start; /* Pull 'n' more MBUFs into the software ring */ if (rte_mempool_get_bulk(rxq->mp, (void *)mb_alloc, RTE_FM10K_RXQ_REARM_THRESH) < 0) { dma_addr0 = _mm_setzero_si128(); /* Clean up all the HW/SW ring content */ for (i = 0; i < RTE_FM10K_RXQ_REARM_THRESH; i++) { mb_alloc[i] = &rxq->fake_mbuf; _mm_store_si128((__m128i *)&rxdp[i].q, dma_addr0); } rte_eth_devices[rxq->port_id].data->rx_mbuf_alloc_failed += RTE_FM10K_RXQ_REARM_THRESH; return; } /* Initialize the mbufs in vector, process 2 mbufs in one loop */ for (i = 0; i < RTE_FM10K_RXQ_REARM_THRESH; i += 2, mb_alloc += 2) { __m128i vaddr0, vaddr1; uintptr_t p0, p1; mb0 = mb_alloc[0]; mb1 = mb_alloc[1]; /* Flush mbuf with pkt template. * Data to be rearmed is 6 bytes long. * Though, RX will overwrite ol_flags that are coming next * anyway. So overwrite whole 8 bytes with one load: * 6 bytes of rearm_data plus first 2 bytes of ol_flags. */ p0 = (uintptr_t)&mb0->rearm_data; *(uint64_t *)p0 = rxq->mbuf_initializer; p1 = (uintptr_t)&mb1->rearm_data; *(uint64_t *)p1 = rxq->mbuf_initializer; /* load buf_addr(lo 64bit) and buf_physaddr(hi 64bit) */ vaddr0 = _mm_loadu_si128((__m128i *)&mb0->buf_addr); vaddr1 = _mm_loadu_si128((__m128i *)&mb1->buf_addr); /* convert pa to dma_addr hdr/data */ dma_addr0 = _mm_unpackhi_epi64(vaddr0, vaddr0); dma_addr1 = _mm_unpackhi_epi64(vaddr1, vaddr1); /* add headroom to pa values */ dma_addr0 = _mm_add_epi64(dma_addr0, head_off); dma_addr1 = _mm_add_epi64(dma_addr1, head_off); /* Do 512 byte alignment to satisfy HW requirement, in the * meanwhile, set Header Buffer Address to zero. */ dma_addr0 = _mm_and_si128(dma_addr0, hba_msk); dma_addr1 = _mm_and_si128(dma_addr1, hba_msk); /* flush desc with pa dma_addr */ _mm_store_si128((__m128i *)&rxdp++->q, dma_addr0); _mm_store_si128((__m128i *)&rxdp++->q, dma_addr1); /* enforce 512B alignment on default Rx virtual addresses */ mb0->data_off = (uint16_t)(RTE_PTR_ALIGN((char *)mb0->buf_addr + RTE_PKTMBUF_HEADROOM, FM10K_RX_DATABUF_ALIGN) - (char *)mb0->buf_addr); mb1->data_off = (uint16_t)(RTE_PTR_ALIGN((char *)mb1->buf_addr + RTE_PKTMBUF_HEADROOM, FM10K_RX_DATABUF_ALIGN) - (char *)mb1->buf_addr); } rxq->rxrearm_start += RTE_FM10K_RXQ_REARM_THRESH; if (rxq->rxrearm_start >= rxq->nb_desc) rxq->rxrearm_start = 0; rxq->rxrearm_nb -= RTE_FM10K_RXQ_REARM_THRESH; rx_id = (uint16_t)((rxq->rxrearm_start == 0) ? (rxq->nb_desc - 1) : (rxq->rxrearm_start - 1)); /* Update the tail pointer on the NIC */ FM10K_PCI_REG_WRITE(rxq->tail_ptr, rx_id); } void __attribute__((cold)) fm10k_rx_queue_release_mbufs_vec(struct fm10k_rx_queue *rxq) { const unsigned mask = rxq->nb_desc - 1; unsigned i; if (rxq->sw_ring == NULL || rxq->rxrearm_nb >= rxq->nb_desc) return; /* free all mbufs that are valid in the ring */ for (i = rxq->next_dd; i != rxq->rxrearm_start; i = (i + 1) & mask) rte_pktmbuf_free_seg(rxq->sw_ring[i]); rxq->rxrearm_nb = rxq->nb_desc; /* set all entries to NULL */ memset(rxq->sw_ring, 0, sizeof(rxq->sw_ring[0]) * rxq->nb_desc); } static inline uint16_t fm10k_recv_raw_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts, uint8_t *split_packet) { volatile union fm10k_rx_desc *rxdp; struct rte_mbuf **mbufp; uint16_t nb_pkts_recd; int pos; struct fm10k_rx_queue *rxq = rx_queue; uint64_t var; __m128i shuf_msk; __m128i dd_check, eop_check; uint16_t next_dd; next_dd = rxq->next_dd; /* Just the act of getting into the function from the application is * going to cost about 7 cycles */ rxdp = rxq->hw_ring + next_dd; _mm_prefetch((const void *)rxdp, _MM_HINT_T0); /* See if we need to rearm the RX queue - gives the prefetch a bit * of time to act */ if (rxq->rxrearm_nb > RTE_FM10K_RXQ_REARM_THRESH) fm10k_rxq_rearm(rxq); /* Before we start moving massive data around, check to see if * there is actually a packet available */ if (!(rxdp->d.staterr & FM10K_RXD_STATUS_DD)) return 0; /* Vecotr RX will process 4 packets at a time, strip the unaligned * tails in case it's not multiple of 4. */ nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_FM10K_DESCS_PER_LOOP); /* 4 packets DD mask */ dd_check = _mm_set_epi64x(0x0000000100000001LL, 0x0000000100000001LL); /* 4 packets EOP mask */ eop_check = _mm_set_epi64x(0x0000000200000002LL, 0x0000000200000002LL); /* mask to shuffle from desc. to mbuf */ shuf_msk = _mm_set_epi8( 7, 6, 5, 4, /* octet 4~7, 32bits rss */ 15, 14, /* octet 14~15, low 16 bits vlan_macip */ 13, 12, /* octet 12~13, 16 bits data_len */ 0xFF, 0xFF, /* skip high 16 bits pkt_len, zero out */ 13, 12, /* octet 12~13, low 16 bits pkt_len */ 0xFF, 0xFF, /* skip high 16 bits pkt_type */ 0xFF, 0xFF /* Skip pkt_type field in shuffle operation */ ); /* Cache is empty -> need to scan the buffer rings, but first move * the next 'n' mbufs into the cache */ mbufp = &rxq->sw_ring[next_dd]; /* A. load 4 packet in one loop * [A*. mask out 4 unused dirty field in desc] * B. copy 4 mbuf point from swring to rx_pkts * C. calc the number of DD bits among the 4 packets * [C*. extract the end-of-packet bit, if requested] * D. fill info. from desc to mbuf */ for (pos = 0, nb_pkts_recd = 0; pos < nb_pkts; pos += RTE_FM10K_DESCS_PER_LOOP, rxdp += RTE_FM10K_DESCS_PER_LOOP) { __m128i descs0[RTE_FM10K_DESCS_PER_LOOP]; __m128i pkt_mb1, pkt_mb2, pkt_mb3, pkt_mb4; __m128i zero, staterr, sterr_tmp1, sterr_tmp2; __m128i mbp1, mbp2; /* two mbuf pointer in one XMM reg. */ /* B.1 load 1 mbuf point */ mbp1 = _mm_loadu_si128((__m128i *)&mbufp[pos]); /* Read desc statuses backwards to avoid race condition */ /* A.1 load 4 pkts desc */ descs0[3] = _mm_loadu_si128((__m128i *)(rxdp + 3)); /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1); /* B.1 load 1 mbuf point */ mbp2 = _mm_loadu_si128((__m128i *)&mbufp[pos+2]); descs0[2] = _mm_loadu_si128((__m128i *)(rxdp + 2)); /* B.1 load 2 mbuf point */ descs0[1] = _mm_loadu_si128((__m128i *)(rxdp + 1)); descs0[0] = _mm_loadu_si128((__m128i *)(rxdp)); /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos+2], mbp2); /* avoid compiler reorder optimization */ rte_compiler_barrier(); if (split_packet) { rte_prefetch0(&rx_pkts[pos]->cacheline1); rte_prefetch0(&rx_pkts[pos + 1]->cacheline1); rte_prefetch0(&rx_pkts[pos + 2]->cacheline1); rte_prefetch0(&rx_pkts[pos + 3]->cacheline1); } /* D.1 pkt 3,4 convert format from desc to pktmbuf */ pkt_mb4 = _mm_shuffle_epi8(descs0[3], shuf_msk); pkt_mb3 = _mm_shuffle_epi8(descs0[2], shuf_msk); /* C.1 4=>2 filter staterr info only */ sterr_tmp2 = _mm_unpackhi_epi32(descs0[3], descs0[2]); /* C.1 4=>2 filter staterr info only */ sterr_tmp1 = _mm_unpackhi_epi32(descs0[1], descs0[0]); /* set ol_flags with vlan packet type */ fm10k_desc_to_olflags_v(descs0, &rx_pkts[pos]); /* D.1 pkt 1,2 convert format from desc to pktmbuf */ pkt_mb2 = _mm_shuffle_epi8(descs0[1], shuf_msk); pkt_mb1 = _mm_shuffle_epi8(descs0[0], shuf_msk); /* C.2 get 4 pkts staterr value */ zero = _mm_xor_si128(dd_check, dd_check); staterr = _mm_unpacklo_epi32(sterr_tmp1, sterr_tmp2); /* D.3 copy final 3,4 data to rx_pkts */ _mm_storeu_si128((void *)&rx_pkts[pos+3]->rx_descriptor_fields1, pkt_mb4); _mm_storeu_si128((void *)&rx_pkts[pos+2]->rx_descriptor_fields1, pkt_mb3); /* C* extract and record EOP bit */ if (split_packet) { __m128i eop_shuf_mask = _mm_set_epi8( 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x04, 0x0C, 0x00, 0x08 ); /* and with mask to extract bits, flipping 1-0 */ __m128i eop_bits = _mm_andnot_si128(staterr, eop_check); /* the staterr values are not in order, as the count * count of dd bits doesn't care. However, for end of * packet tracking, we do care, so shuffle. This also * compresses the 32-bit values to 8-bit */ eop_bits = _mm_shuffle_epi8(eop_bits, eop_shuf_mask); /* store the resulting 32-bit value */ *(int *)split_packet = _mm_cvtsi128_si32(eop_bits); split_packet += RTE_FM10K_DESCS_PER_LOOP; /* zero-out next pointers */ rx_pkts[pos]->next = NULL; rx_pkts[pos + 1]->next = NULL; rx_pkts[pos + 2]->next = NULL; rx_pkts[pos + 3]->next = NULL; } /* C.3 calc available number of desc */ staterr = _mm_and_si128(staterr, dd_check); staterr = _mm_packs_epi32(staterr, zero); /* D.3 copy final 1,2 data to rx_pkts */ _mm_storeu_si128((void *)&rx_pkts[pos+1]->rx_descriptor_fields1, pkt_mb2); _mm_storeu_si128((void *)&rx_pkts[pos]->rx_descriptor_fields1, pkt_mb1); fm10k_desc_to_pktype_v(descs0, &rx_pkts[pos]); /* C.4 calc avaialbe number of desc */ var = __builtin_popcountll(_mm_cvtsi128_si64(staterr)); nb_pkts_recd += var; if (likely(var != RTE_FM10K_DESCS_PER_LOOP)) break; } /* Update our internal tail pointer */ rxq->next_dd = (uint16_t)(rxq->next_dd + nb_pkts_recd); rxq->next_dd = (uint16_t)(rxq->next_dd & (rxq->nb_desc - 1)); rxq->rxrearm_nb = (uint16_t)(rxq->rxrearm_nb + nb_pkts_recd); return nb_pkts_recd; } /* vPMD receive routine * * Notice: * - don't support ol_flags for rss and csum err */ uint16_t fm10k_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { return fm10k_recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL); } static inline uint16_t fm10k_reassemble_packets(struct fm10k_rx_queue *rxq, struct rte_mbuf **rx_bufs, uint16_t nb_bufs, uint8_t *split_flags) { struct rte_mbuf *pkts[RTE_FM10K_MAX_RX_BURST]; /*finished pkts*/ struct rte_mbuf *start = rxq->pkt_first_seg; struct rte_mbuf *end = rxq->pkt_last_seg; unsigned pkt_idx, buf_idx; for (buf_idx = 0, pkt_idx = 0; buf_idx < nb_bufs; buf_idx++) { if (end != NULL) { /* processing a split packet */ end->next = rx_bufs[buf_idx]; start->nb_segs++; start->pkt_len += rx_bufs[buf_idx]->data_len; end = end->next; if (!split_flags[buf_idx]) { /* it's the last packet of the set */ start->hash = end->hash; start->ol_flags = end->ol_flags; pkts[pkt_idx++] = start; start = end = NULL; } } else { /* not processing a split packet */ if (!split_flags[buf_idx]) { /* not a split packet, save and skip */ pkts[pkt_idx++] = rx_bufs[buf_idx]; continue; } end = start = rx_bufs[buf_idx]; } } /* save the partial packet for next time */ rxq->pkt_first_seg = start; rxq->pkt_last_seg = end; memcpy(rx_bufs, pkts, pkt_idx * (sizeof(*pkts))); return pkt_idx; } /* * vPMD receive routine that reassembles scattered packets * * Notice: * - don't support ol_flags for rss and csum err * - nb_pkts > RTE_FM10K_MAX_RX_BURST, only scan RTE_FM10K_MAX_RX_BURST * numbers of DD bit */ uint16_t fm10k_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct fm10k_rx_queue *rxq = rx_queue; uint8_t split_flags[RTE_FM10K_MAX_RX_BURST] = {0}; unsigned i = 0; /* Split_flags only can support max of RTE_FM10K_MAX_RX_BURST */ nb_pkts = RTE_MIN(nb_pkts, RTE_FM10K_MAX_RX_BURST); /* get some new buffers */ uint16_t nb_bufs = fm10k_recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts, split_flags); if (nb_bufs == 0) return 0; /* happy day case, full burst + no packets to be joined */ const uint64_t *split_fl64 = (uint64_t *)split_flags; if (rxq->pkt_first_seg == NULL && split_fl64[0] == 0 && split_fl64[1] == 0 && split_fl64[2] == 0 && split_fl64[3] == 0) return nb_bufs; /* reassemble any packets that need reassembly*/ if (rxq->pkt_first_seg == NULL) { /* find the first split flag, and only reassemble then*/ while (i < nb_bufs && !split_flags[i]) i++; if (i == nb_bufs) return nb_bufs; } return i + fm10k_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i, &split_flags[i]); } static const struct fm10k_txq_ops vec_txq_ops = { .reset = fm10k_reset_tx_queue, }; void __attribute__((cold)) fm10k_txq_vec_setup(struct fm10k_tx_queue *txq) { txq->ops = &vec_txq_ops; } int __attribute__((cold)) fm10k_tx_vec_condition_check(struct fm10k_tx_queue *txq) { /* Vector TX can't offload any features yet */ if ((txq->txq_flags & FM10K_SIMPLE_TX_FLAG) != FM10K_SIMPLE_TX_FLAG) return -1; return 0; } static inline void vtx1(volatile struct fm10k_tx_desc *txdp, struct rte_mbuf *pkt, uint64_t flags) { __m128i descriptor = _mm_set_epi64x(flags << 56 | pkt->vlan_tci << 16 | pkt->data_len, MBUF_DMA_ADDR(pkt)); _mm_store_si128((__m128i *)txdp, descriptor); } static inline void vtx(volatile struct fm10k_tx_desc *txdp, struct rte_mbuf **pkt, uint16_t nb_pkts, uint64_t flags) { int i; for (i = 0; i < nb_pkts; ++i, ++txdp, ++pkt) vtx1(txdp, *pkt, flags); } static inline int __attribute__((always_inline)) fm10k_tx_free_bufs(struct fm10k_tx_queue *txq) { struct rte_mbuf **txep; uint8_t flags; uint32_t n; uint32_t i; int nb_free = 0; struct rte_mbuf *m, *free[RTE_FM10K_TX_MAX_FREE_BUF_SZ]; /* check DD bit on threshold descriptor */ flags = txq->hw_ring[txq->next_dd].flags; if (!(flags & FM10K_TXD_FLAG_DONE)) return 0; n = txq->rs_thresh; /* First buffer to free from S/W ring is at index * next_dd - (rs_thresh-1) */ txep = &txq->sw_ring[txq->next_dd - (n - 1)]; m = __rte_pktmbuf_prefree_seg(txep[0]); if (likely(m != NULL)) { free[0] = m; nb_free = 1; for (i = 1; i < n; i++) { m = __rte_pktmbuf_prefree_seg(txep[i]); if (likely(m != NULL)) { if (likely(m->pool == free[0]->pool)) free[nb_free++] = m; else { rte_mempool_put_bulk(free[0]->pool, (void *)free, nb_free); free[0] = m; nb_free = 1; } } } rte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free); } else { for (i = 1; i < n; i++) { m = __rte_pktmbuf_prefree_seg(txep[i]); if (m != NULL) rte_mempool_put(m->pool, m); } } /* buffers were freed, update counters */ txq->nb_free = (uint16_t)(txq->nb_free + txq->rs_thresh); txq->next_dd = (uint16_t)(txq->next_dd + txq->rs_thresh); if (txq->next_dd >= txq->nb_desc) txq->next_dd = (uint16_t)(txq->rs_thresh - 1); return txq->rs_thresh; } static inline void __attribute__((always_inline)) tx_backlog_entry(struct rte_mbuf **txep, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { int i; for (i = 0; i < (int)nb_pkts; ++i) txep[i] = tx_pkts[i]; } uint16_t fm10k_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) { struct fm10k_tx_queue *txq = (struct fm10k_tx_queue *)tx_queue; volatile struct fm10k_tx_desc *txdp; struct rte_mbuf **txep; uint16_t n, nb_commit, tx_id; uint64_t flags = FM10K_TXD_FLAG_LAST; uint64_t rs = FM10K_TXD_FLAG_RS | FM10K_TXD_FLAG_LAST; int i; /* cross rx_thresh boundary is not allowed */ nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh); if (txq->nb_free < txq->free_thresh) fm10k_tx_free_bufs(txq); nb_commit = nb_pkts = (uint16_t)RTE_MIN(txq->nb_free, nb_pkts); if (unlikely(nb_pkts == 0)) return 0; tx_id = txq->next_free; txdp = &txq->hw_ring[tx_id]; txep = &txq->sw_ring[tx_id]; txq->nb_free = (uint16_t)(txq->nb_free - nb_pkts); n = (uint16_t)(txq->nb_desc - tx_id); if (nb_commit >= n) { tx_backlog_entry(txep, tx_pkts, n); for (i = 0; i < n - 1; ++i, ++tx_pkts, ++txdp) vtx1(txdp, *tx_pkts, flags); vtx1(txdp, *tx_pkts++, rs); nb_commit = (uint16_t)(nb_commit - n); tx_id = 0; txq->next_rs = (uint16_t)(txq->rs_thresh - 1); /* avoid reach the end of ring */ txdp = &(txq->hw_ring[tx_id]); txep = &txq->sw_ring[tx_id]; } tx_backlog_entry(txep, tx_pkts, nb_commit); vtx(txdp, tx_pkts, nb_commit, flags); tx_id = (uint16_t)(tx_id + nb_commit); if (tx_id > txq->next_rs) { txq->hw_ring[txq->next_rs].flags |= FM10K_TXD_FLAG_RS; txq->next_rs = (uint16_t)(txq->next_rs + txq->rs_thresh); } txq->next_free = tx_id; FM10K_PCI_REG_WRITE(txq->tail_ptr, txq->next_free); return nb_pkts; } static void __attribute__((cold)) fm10k_reset_tx_queue(struct fm10k_tx_queue *txq) { static const struct fm10k_tx_desc zeroed_desc = {0}; struct rte_mbuf **txe = txq->sw_ring; uint16_t i; /* Zero out HW ring memory */ for (i = 0; i < txq->nb_desc; i++) txq->hw_ring[i] = zeroed_desc; /* Initialize SW ring entries */ for (i = 0; i < txq->nb_desc; i++) txe[i] = NULL; txq->next_dd = (uint16_t)(txq->rs_thresh - 1); txq->next_rs = (uint16_t)(txq->rs_thresh - 1); txq->next_free = 0; txq->nb_used = 0; /* Always allow 1 descriptor to be un-allocated to avoid * a H/W race condition */ txq->nb_free = (uint16_t)(txq->nb_desc - 1); FM10K_PCI_REG_WRITE(txq->tail_ptr, 0); }
gpl-2.0
laitianli/kernel-change_linux-2.6.18
net/sunrpc/auth_gss/gss_krb5_mech.c
6847
/* * linux/net/sunrpc/gss_krb5_mech.c * * Copyright (c) 2001 The Regents of the University of Michigan. * All rights reserved. * * Andy Adamson <andros@umich.edu> * J. Bruce Fields <bfields@umich.edu> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/sunrpc/auth.h> #include <linux/sunrpc/gss_krb5.h> #include <linux/sunrpc/xdr.h> #include <linux/crypto.h> #ifdef RPC_DEBUG # define RPCDBG_FACILITY RPCDBG_AUTH #endif static const void * simple_get_bytes(const void *p, const void *end, void *res, int len) { const void *q = (const void *)((const char *)p + len); if (unlikely(q > end || q < p)) return ERR_PTR(-EFAULT); memcpy(res, p, len); return q; } static const void * simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res) { const void *q; unsigned int len; p = simple_get_bytes(p, end, &len, sizeof(len)); if (IS_ERR(p)) return p; q = (const void *)((const char *)p + len); if (unlikely(q > end || q < p)) return ERR_PTR(-EFAULT); res->data = kmalloc(len, GFP_KERNEL); if (unlikely(res->data == NULL)) return ERR_PTR(-ENOMEM); memcpy(res->data, p, len); res->len = len; return q; } static inline const void * get_key(const void *p, const void *end, struct crypto_tfm **res) { struct xdr_netobj key; int alg, alg_mode; char *alg_name; p = simple_get_bytes(p, end, &alg, sizeof(alg)); if (IS_ERR(p)) goto out_err; p = simple_get_netobj(p, end, &key); if (IS_ERR(p)) goto out_err; switch (alg) { case ENCTYPE_DES_CBC_RAW: alg_name = "des"; alg_mode = CRYPTO_TFM_MODE_CBC; break; default: printk("gss_kerberos_mech: unsupported algorithm %d\n", alg); goto out_err_free_key; } if (!(*res = crypto_alloc_tfm(alg_name, alg_mode))) { printk("gss_kerberos_mech: unable to initialize crypto algorithm %s\n", alg_name); goto out_err_free_key; } if (crypto_cipher_setkey(*res, key.data, key.len)) { printk("gss_kerberos_mech: error setting key for crypto algorithm %s\n", alg_name); goto out_err_free_tfm; } kfree(key.data); return p; out_err_free_tfm: crypto_free_tfm(*res); out_err_free_key: kfree(key.data); p = ERR_PTR(-EINVAL); out_err: return p; } static int gss_import_sec_context_kerberos(const void *p, size_t len, struct gss_ctx *ctx_id) { const void *end = (const void *)((const char *)p + len); struct krb5_ctx *ctx; if (!(ctx = kzalloc(sizeof(*ctx), GFP_KERNEL))) goto out_err; p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_bytes(p, end, &ctx->seed_init, sizeof(ctx->seed_init)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_bytes(p, end, ctx->seed, sizeof(ctx->seed)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_bytes(p, end, &ctx->signalg, sizeof(ctx->signalg)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_bytes(p, end, &ctx->sealalg, sizeof(ctx->sealalg)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_bytes(p, end, &ctx->seq_send, sizeof(ctx->seq_send)); if (IS_ERR(p)) goto out_err_free_ctx; p = simple_get_netobj(p, end, &ctx->mech_used); if (IS_ERR(p)) goto out_err_free_ctx; p = get_key(p, end, &ctx->enc); if (IS_ERR(p)) goto out_err_free_mech; p = get_key(p, end, &ctx->seq); if (IS_ERR(p)) goto out_err_free_key1; if (p != end) { p = ERR_PTR(-EFAULT); goto out_err_free_key2; } ctx_id->internal_ctx_id = ctx; dprintk("RPC: Successfully imported new context.\n"); return 0; out_err_free_key2: crypto_free_tfm(ctx->seq); out_err_free_key1: crypto_free_tfm(ctx->enc); out_err_free_mech: kfree(ctx->mech_used.data); out_err_free_ctx: kfree(ctx); out_err: return PTR_ERR(p); } static void gss_delete_sec_context_kerberos(void *internal_ctx) { struct krb5_ctx *kctx = internal_ctx; crypto_free_tfm(kctx->seq); crypto_free_tfm(kctx->enc); kfree(kctx->mech_used.data); kfree(kctx); } static struct gss_api_ops gss_kerberos_ops = { .gss_import_sec_context = gss_import_sec_context_kerberos, .gss_get_mic = gss_get_mic_kerberos, .gss_verify_mic = gss_verify_mic_kerberos, .gss_wrap = gss_wrap_kerberos, .gss_unwrap = gss_unwrap_kerberos, .gss_delete_sec_context = gss_delete_sec_context_kerberos, }; static struct pf_desc gss_kerberos_pfs[] = { [0] = { .pseudoflavor = RPC_AUTH_GSS_KRB5, .service = RPC_GSS_SVC_NONE, .name = "krb5", }, [1] = { .pseudoflavor = RPC_AUTH_GSS_KRB5I, .service = RPC_GSS_SVC_INTEGRITY, .name = "krb5i", }, [2] = { .pseudoflavor = RPC_AUTH_GSS_KRB5P, .service = RPC_GSS_SVC_PRIVACY, .name = "krb5p", }, }; static struct gss_api_mech gss_kerberos_mech = { .gm_name = "krb5", .gm_owner = THIS_MODULE, .gm_ops = &gss_kerberos_ops, .gm_pf_num = ARRAY_SIZE(gss_kerberos_pfs), .gm_pfs = gss_kerberos_pfs, }; static int __init init_kerberos_module(void) { int status; status = gss_mech_register(&gss_kerberos_mech); if (status) printk("Failed to register kerberos gss mechanism!\n"); return status; } static void __exit cleanup_kerberos_module(void) { gss_mech_unregister(&gss_kerberos_mech); } MODULE_LICENSE("GPL"); module_init(init_kerberos_module); module_exit(cleanup_kerberos_module);
gpl-2.0
md-5/jdk10
test/jdk/sun/security/tools/keytool/NssTest.java
2505
/* * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; /* * @test * @summary It tests (almost) all keytool behaviors with NSS. * @library /test/lib /test/jdk/sun/security/pkcs11 * @modules java.base/sun.security.tools.keytool * java.base/sun.security.util * java.base/sun.security.x509 * @run main/othervm/timeout=600 NssTest */ public class NssTest { public static void main(String[] args) throws Exception { Path libPath = PKCS11Test.getNSSLibPath("softokn3"); if (libPath == null) { return; } System.out.println("Using NSS lib at " + libPath); copyFiles(); System.setProperty("nss", ""); System.setProperty("nss.lib", String.valueOf(libPath)); PKCS11Test.loadNSPR(libPath.getParent().toString()); KeyToolTest.main(args); } private static void copyFiles() throws IOException { Path srcPath = Paths.get(System.getProperty("test.src")); Files.copy(srcPath.resolve("p11-nss.txt"), Paths.get("p11-nss.txt")); Path dbPath = srcPath.getParent().getParent() .resolve("pkcs11").resolve("nss").resolve("db"); Files.copy(dbPath.resolve("cert8.db"), Paths.get("cert8.db")); Files.copy(dbPath.resolve("key3.db"), Paths.get("key3.db")); Files.copy(dbPath.resolve("secmod.db"), Paths.get("secmod.db")); } }
gpl-2.0
zhaolin1230/kernel_sony_msm8x60
drivers/video/msm/msm_fb.c
113444
/* * drivers/video/msm/msm_fb.c * * Core MSM framebuffer driver. * * Copyright (C) 2007 Google Incorporated * Copyright (c) 2008-2013, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/delay.h> #include <linux/mm.h> #include <linux/fb.h> #include <linux/msm_mdp.h> #include <linux/init.h> #include <linux/ioport.h> #include <linux/device.h> #include <linux/dma-mapping.h> #include <mach/board.h> #include <linux/uaccess.h> #include <mach/iommu_domains.h> #include <linux/workqueue.h> #include <linux/string.h> #include <linux/version.h> #include <linux/proc_fs.h> #include <linux/vmalloc.h> #include <linux/debugfs.h> #include <linux/console.h> #include <linux/android_pmem.h> #include <linux/leds.h> #include <linux/pm_runtime.h> #include <linux/sync.h> #include <linux/sw_sync.h> #include <linux/file.h> #define MSM_FB_C #include "msm_fb.h" #include "mddihosti.h" #include "tvenc.h" #include "mdp.h" #include "mdp4.h" #ifdef CONFIG_FB_MSM_TRIPLE_BUFFER #define MSM_FB_NUM 3 #endif #ifdef CONFIG_HAS_EARLYSUSPEND #undef CONFIG_HAS_EARLYSUSPEND #endif static unsigned char *fbram; static unsigned char *fbram_phys; static int fbram_size; static boolean bf_supported; static struct platform_device *pdev_list[MSM_FB_MAX_DEV_LIST]; static int pdev_list_cnt; int vsync_mode = 1; #define MAX_BLIT_REQ 256 #define MAX_FBI_LIST 32 static struct fb_info *fbi_list[MAX_FBI_LIST]; static int fbi_list_index; static struct msm_fb_data_type *mfd_list[MAX_FBI_LIST]; static int mfd_list_index; static u32 msm_fb_pseudo_palette[16] = { 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static struct ion_client *iclient; u32 msm_fb_debug_enabled; /* Setting msm_fb_msg_level to 8 prints out ALL messages */ u32 msm_fb_msg_level = 7; /* Setting mddi_msg_level to 8 prints out ALL messages */ u32 mddi_msg_level = 5; extern int32 mdp_block_power_cnt[MDP_MAX_BLOCK]; extern unsigned long mdp_timer_duration; static int msm_fb_register(struct msm_fb_data_type *mfd); static int msm_fb_open(struct fb_info *info, int user); static int msm_fb_release(struct fb_info *info, int user); static int msm_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info); static int msm_fb_stop_sw_refresher(struct msm_fb_data_type *mfd); int msm_fb_resume_sw_refresher(struct msm_fb_data_type *mfd); static int msm_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info); static int msm_fb_set_par(struct fb_info *info); static int msm_fb_blank_sub(int blank_mode, struct fb_info *info, boolean op_enable); static int msm_fb_suspend_sub(struct msm_fb_data_type *mfd); static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); static int msm_fb_mmap(struct fb_info *info, struct vm_area_struct * vma); static int mdp_bl_scale_config(struct msm_fb_data_type *mfd, struct mdp_bl_scale_data *data); static void msm_fb_scale_bl(__u32 *bl_lvl); static void msm_fb_commit_wq_handler(struct work_struct *work); static int msm_fb_pan_idle(struct msm_fb_data_type *mfd); #ifdef CONFIG_LGE_DISP_FBREAD static ssize_t msm_fb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos); #endif #ifdef MSM_FB_ENABLE_DBGFS #define MSM_FB_MAX_DBGFS 1024 #define MAX_BACKLIGHT_BRIGHTNESS 255 #define WAIT_FENCE_FIRST_TIMEOUT 3 * MSEC_PER_SEC #define WAIT_FENCE_FINAL_TIMEOUT 10 * MSEC_PER_SEC /* Display op timeout should be greater than total timeout */ #define WAIT_DISP_OP_TIMEOUT (WAIT_FENCE_FIRST_TIMEOUT +\ WAIT_FENCE_FINAL_TIMEOUT) * MDP_MAX_FENCE_FD #define MAX_TIMELINE_NAME_LEN 16 #define MAX_WQ_NAME_LEN 32 int msm_fb_debugfs_file_index; struct dentry *msm_fb_debugfs_root; struct dentry *msm_fb_debugfs_file[MSM_FB_MAX_DBGFS]; static int bl_scale, bl_min_lvl; DEFINE_MUTEX(msm_fb_notify_update_sem); void msmfb_no_update_notify_timer_cb(unsigned long data) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)data; if (!mfd) pr_err("%s mfd NULL\n", __func__); complete(&mfd->msmfb_no_update_notify); } struct dentry *msm_fb_get_debugfs_root(void) { if (msm_fb_debugfs_root == NULL) msm_fb_debugfs_root = debugfs_create_dir("msm_fb", NULL); return msm_fb_debugfs_root; } void msm_fb_debugfs_file_create(struct dentry *root, const char *name, u32 *var) { if (msm_fb_debugfs_file_index >= MSM_FB_MAX_DBGFS) return; msm_fb_debugfs_file[msm_fb_debugfs_file_index++] = debugfs_create_u32(name, S_IRUGO | S_IWUSR, root, var); } #endif int msm_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; if (!mfd->cursor_update) return -ENODEV; return mfd->cursor_update(info, cursor); } static int msm_fb_resource_initialized; #ifndef CONFIG_LEDS_AS3676_SEMC #ifndef CONFIG_FB_BACKLIGHT static int lcd_backlight_registered; static void msm_fb_set_bl_brightness(struct led_classdev *led_cdev, enum led_brightness value) { struct msm_fb_data_type *mfd = dev_get_drvdata(led_cdev->dev->parent); int bl_lvl; /* This maps android backlight level 1 to 255 into driver backlight level bl_min to bl_max with rounding and maps backlight level 0 to 0. */ if (value <= 0) bl_lvl = 0; else if (value >= MAX_BACKLIGHT_BRIGHTNESS) bl_lvl = mfd->panel_info.bl_max; else bl_lvl = mfd->panel_info.bl_min + ((value - 1) * 2 * (mfd->panel_info.bl_max - mfd->panel_info.bl_min) + MAX_BACKLIGHT_BRIGHTNESS - 1) / (MAX_BACKLIGHT_BRIGHTNESS - 1) / 2; down(&mfd->sem); msm_fb_set_backlight(mfd, bl_lvl); up(&mfd->sem); } static struct led_classdev backlight_led = { .name = "lcd-backlight", .brightness = MAX_BACKLIGHT_BRIGHTNESS, .brightness_set = msm_fb_set_bl_brightness, }; #endif #endif static struct msm_fb_platform_data *msm_fb_pdata; unsigned char hdmi_prim_display; unsigned char hdmi_prim_resolution; int msm_fb_detect_client(const char *name) { int ret = 0; u32 len; #ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT u32 id; #endif if (!msm_fb_pdata) return -EPERM; len = strnlen(name, PANEL_NAME_MAX_LEN); if (strnlen(msm_fb_pdata->prim_panel_name, PANEL_NAME_MAX_LEN)) { pr_err("\n name = %s, prim_display = %s", name, msm_fb_pdata->prim_panel_name); if (!strncmp((char *)msm_fb_pdata->prim_panel_name, name, len)) { if (!strncmp((char *)msm_fb_pdata->prim_panel_name, "hdmi_msm", len)) hdmi_prim_display = 1; hdmi_prim_resolution = msm_fb_pdata->ext_resolution; return 0; } else { ret = -EPERM; } } if (strnlen(msm_fb_pdata->ext_panel_name, PANEL_NAME_MAX_LEN)) { pr_err("\n name = %s, ext_display = %s", name, msm_fb_pdata->ext_panel_name); if (!strncmp((char *)msm_fb_pdata->ext_panel_name, name, len)) return 0; else ret = -EPERM; } if (ret) return ret; ret = -EPERM; if (msm_fb_pdata && msm_fb_pdata->detect_client) { ret = msm_fb_pdata->detect_client(name); /* if it's non mddi panel, we need to pre-scan mddi client to see if we can disable mddi host */ #ifdef CONFIG_FB_MSM_MDDI_AUTO_DETECT if (!ret && msm_fb_pdata->mddi_prescan) id = mddi_get_client_id(); #endif } return ret; } static ssize_t msm_fb_fps_level_change(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct fb_info *fbi = dev_get_drvdata(dev); struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; struct msm_fb_panel_data *pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; unsigned long val; int ret; ret = kstrtoul(buf, 10, &val); if (ret) return ret; if ((val <= 0) || (val > 100)) return -EINVAL; if (pdata->fps_level_change) pdata->fps_level_change(mfd->pdev, (u32)val); return count; } static ssize_t msm_fb_msm_fb_type(struct device *dev, struct device_attribute *attr, char *buf) { ssize_t ret = 0; struct fb_info *fbi = dev_get_drvdata(dev); struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)fbi->par; struct msm_fb_panel_data *pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; switch (pdata->panel_info.type) { case NO_PANEL: ret = snprintf(buf, PAGE_SIZE, "no panel\n"); break; case MDDI_PANEL: ret = snprintf(buf, PAGE_SIZE, "mddi panel\n"); break; case EBI2_PANEL: ret = snprintf(buf, PAGE_SIZE, "ebi2 panel\n"); break; case LCDC_PANEL: ret = snprintf(buf, PAGE_SIZE, "lcdc panel\n"); break; case EXT_MDDI_PANEL: ret = snprintf(buf, PAGE_SIZE, "ext mddi panel\n"); break; case TV_PANEL: ret = snprintf(buf, PAGE_SIZE, "tv panel\n"); break; case HDMI_PANEL: ret = snprintf(buf, PAGE_SIZE, "hdmi panel\n"); break; case LVDS_PANEL: ret = snprintf(buf, PAGE_SIZE, "lvds panel\n"); break; case DTV_PANEL: ret = snprintf(buf, PAGE_SIZE, "dtv panel\n"); break; case MIPI_VIDEO_PANEL: ret = snprintf(buf, PAGE_SIZE, "mipi dsi video panel\n"); break; case MIPI_CMD_PANEL: ret = snprintf(buf, PAGE_SIZE, "mipi dsi cmd panel\n"); break; case WRITEBACK_PANEL: ret = snprintf(buf, PAGE_SIZE, "writeback panel\n"); break; default: ret = snprintf(buf, PAGE_SIZE, "unknown panel\n"); break; } return ret; } static DEVICE_ATTR(msm_fb_type, S_IRUGO, msm_fb_msm_fb_type, NULL); static DEVICE_ATTR(msm_fb_fps_level, S_IRUGO | S_IWUSR, NULL, \ msm_fb_fps_level_change); static struct attribute *msm_fb_attrs[] = { &dev_attr_msm_fb_type.attr, &dev_attr_msm_fb_fps_level.attr, NULL, }; static struct attribute_group msm_fb_attr_group = { .attrs = msm_fb_attrs, }; static int msm_fb_create_sysfs(struct platform_device *pdev) { int rc; struct msm_fb_data_type *mfd = platform_get_drvdata(pdev); rc = sysfs_create_group(&mfd->fbi->dev->kobj, &msm_fb_attr_group); if (rc) MSM_FB_ERR("%s: sysfs group creation failed, rc=%d\n", __func__, rc); return rc; } static void msm_fb_remove_sysfs(struct platform_device *pdev) { struct msm_fb_data_type *mfd = platform_get_drvdata(pdev); sysfs_remove_group(&mfd->fbi->dev->kobj, &msm_fb_attr_group); } static int msm_fb_probe(struct platform_device *pdev) { struct msm_fb_data_type *mfd; int rc; int err = 0; MSM_FB_DEBUG("msm_fb_probe\n"); if ((pdev->id == 0) && (pdev->num_resources > 0)) { msm_fb_pdata = pdev->dev.platform_data; fbram_size = pdev->resource[0].end - pdev->resource[0].start + 1; fbram_phys = (char *)pdev->resource[0].start; fbram = __va(fbram_phys); if (!fbram) { printk(KERN_ERR "fbram ioremap failed!\n"); return -ENOMEM; } MSM_FB_DEBUG("msm_fb_probe: phy_Addr = 0x%x virt = 0x%x\n", (int)fbram_phys, (int)fbram); iclient = msm_ion_client_create(-1, pdev->name); if (IS_ERR_OR_NULL(iclient)) { pr_err("msm_ion_client_create() return" " error, val %p\n", iclient); iclient = NULL; } msm_fb_resource_initialized = 1; return 0; } if (!msm_fb_resource_initialized) return -EPERM; mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if (pdev_list_cnt >= MSM_FB_MAX_DEV_LIST) return -ENOMEM; vsync_cntrl.dev = mfd->fbi->dev; mfd->panel_info.frame_count = 0; mfd->bl_level = 0; bl_scale = 1024; bl_min_lvl = 255; #ifdef CONFIG_FB_MSM_OVERLAY mfd->overlay_play_enable = 1; #endif bf_supported = mdp4_overlay_borderfill_supported(); #ifdef CONFIG_FB_MSM_MDP41_VIRTUAL_BF_PIPE if (mdp_rev == MDP_REV_41) bf_supported = FALSE; #endif rc = msm_fb_register(mfd); if (rc) return rc; err = pm_runtime_set_active(mfd->fbi->dev); if (err < 0) printk(KERN_ERR "pm_runtime: fail to set active.\n"); pm_runtime_enable(mfd->fbi->dev); #ifndef CONFIG_LEDS_AS3676_SEMC #ifdef CONFIG_FB_BACKLIGHT msm_fb_config_backlight(mfd); #else /* android supports only one lcd-backlight/lcd for now */ if (!lcd_backlight_registered) { if (led_classdev_register(&pdev->dev, &backlight_led)) printk(KERN_ERR "led_classdev_register failed\n"); else lcd_backlight_registered = 1; } #endif #endif pdev_list[pdev_list_cnt++] = pdev; msm_fb_create_sysfs(pdev); if (mfd->timeline == NULL) { char timeline_name[MAX_TIMELINE_NAME_LEN]; snprintf(timeline_name, sizeof(timeline_name), "mdp_fb_%d", mfd->index); mfd->timeline = sw_sync_timeline_create(timeline_name); if (mfd->timeline == NULL) { pr_err("%s: cannot create time line", __func__); return -ENOMEM; } else { mfd->timeline_value = 0; } } return 0; } static int msm_fb_remove(struct platform_device *pdev) { struct msm_fb_data_type *mfd; MSM_FB_DEBUG("msm_fb_remove\n"); mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev); msm_fb_pan_idle(mfd); msm_fb_remove_sysfs(pdev); pm_runtime_disable(mfd->fbi->dev); if (!mfd) return -ENODEV; if (mfd->key != MFD_KEY) return -EINVAL; if (msm_fb_suspend_sub(mfd)) printk(KERN_ERR "msm_fb_remove: can't stop the device %d\n", mfd->index); if (mfd->channel_irq != 0) free_irq(mfd->channel_irq, (void *)mfd); if (mfd->vsync_width_boundary) vfree(mfd->vsync_width_boundary); if (mfd->vsync_resync_timer.function) del_timer(&mfd->vsync_resync_timer); if (mfd->refresh_timer.function) del_timer(&mfd->refresh_timer); if (mfd->dma_hrtimer.function) hrtimer_cancel(&mfd->dma_hrtimer); if (mfd->msmfb_no_update_notify_timer.function) del_timer(&mfd->msmfb_no_update_notify_timer); complete(&mfd->msmfb_no_update_notify); complete(&mfd->msmfb_update_notify); if (mfd->commit_wq) destroy_workqueue(mfd->commit_wq); /* remove /dev/fb* */ unregister_framebuffer(mfd->fbi); #ifndef CONFIG_LEDS_AS3676_SEMC #ifdef CONFIG_FB_BACKLIGHT /* remove /sys/class/backlight */ backlight_device_unregister(mfd->fbi->bl_dev); #else if (lcd_backlight_registered) { lcd_backlight_registered = 0; led_classdev_unregister(&backlight_led); } #endif #endif #ifdef MSM_FB_ENABLE_DBGFS if (mfd->sub_dir) debugfs_remove(mfd->sub_dir); #endif return 0; } #if defined(CONFIG_PM) && !defined(CONFIG_HAS_EARLYSUSPEND) static int msm_fb_suspend(struct platform_device *pdev, pm_message_t state) { struct msm_fb_data_type *mfd; int ret = 0; MSM_FB_DEBUG("msm_fb_suspend\n"); mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev); if ((!mfd) || (mfd->key != MFD_KEY)) return 0; msm_fb_pan_idle(mfd); console_lock(); fb_set_suspend(mfd->fbi, FBINFO_STATE_SUSPENDED); ret = msm_fb_suspend_sub(mfd); if (ret != 0) { printk(KERN_ERR "msm_fb: failed to suspend! %d\n", ret); fb_set_suspend(mfd->fbi, FBINFO_STATE_RUNNING); } else { pdev->dev.power.power_state = state; } console_unlock(); return ret; } #else #define msm_fb_suspend NULL #endif static int msm_fb_suspend_sub(struct msm_fb_data_type *mfd) { int ret = 0; if ((!mfd) || (mfd->key != MFD_KEY)) return 0; /* * suspend this channel */ mfd->suspend.sw_refreshing_enable = mfd->sw_refreshing_enable; mfd->suspend.op_enable = mfd->op_enable; /* * For HDMI/DTV, panel needs not to be turned ON during resume * as power_ctrl will turn ON the HPD at resume which will turn * ON the panel in case the HDMI cable is still connected. */ if (mfd->panel_info.type == HDMI_PANEL || mfd->panel_info.type == DTV_PANEL) mfd->suspend.panel_power_on = false; else mfd->suspend.panel_power_on = mfd->panel_power_on; mfd->suspend.op_suspend = true; if (mfd->op_enable) { ret = msm_fb_blank_sub(FB_BLANK_POWERDOWN, mfd->fbi, mfd->suspend.op_enable); if (ret) { MSM_FB_INFO ("msm_fb_suspend: can't turn off display!\n"); return ret; } mfd->op_enable = FALSE; } /* * try to power down */ mdp_pipe_ctrl(MDP_MASTER_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); /* * detach display channel irq if there's any * or wait until vsync-resync completes */ if ((mfd->dest == DISPLAY_LCD)) { if (mfd->panel_info.lcd.vsync_enable) { if (mfd->panel_info.lcd.hw_vsync_mode) { if (mfd->channel_irq != 0) disable_irq(mfd->channel_irq); } else { volatile boolean vh_pending; do { vh_pending = mfd->vsync_handler_pending; } while (vh_pending); } } } return 0; } #ifdef CONFIG_PM static int msm_fb_resume_sub(struct msm_fb_data_type *mfd) { int ret = 0; struct msm_fb_panel_data *pdata = NULL; if ((!mfd) || (mfd->key != MFD_KEY)) return 0; pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; /* attach display channel irq if there's any */ if (mfd->channel_irq != 0) enable_irq(mfd->channel_irq); /* resume state var recover */ mfd->sw_refreshing_enable = mfd->suspend.sw_refreshing_enable; mfd->op_enable = mfd->suspend.op_enable; if (mfd->suspend.panel_power_on) { if (mfd->panel_driver_on == FALSE) msm_fb_blank_sub(FB_BLANK_POWERDOWN, mfd->fbi, mfd->op_enable); ret = msm_fb_blank_sub(FB_BLANK_UNBLANK, mfd->fbi, mfd->op_enable); if (ret) MSM_FB_INFO("msm_fb_resume: can't turn on display!\n"); } mfd->suspend.op_suspend = false; return ret; } #endif #if defined(CONFIG_PM) && !defined(CONFIG_HAS_EARLYSUSPEND) static int msm_fb_resume(struct platform_device *pdev) { /* This resume function is called when interrupt is enabled. */ int ret = 0; struct msm_fb_data_type *mfd; MSM_FB_DEBUG("msm_fb_resume\n"); mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev); if ((!mfd) || (mfd->key != MFD_KEY)) return 0; msm_fb_pan_idle(mfd); console_lock(); ret = msm_fb_resume_sub(mfd); pdev->dev.power.power_state = PMSG_ON; fb_set_suspend(mfd->fbi, FBINFO_STATE_RUNNING); console_unlock(); return ret; } #else #define msm_fb_resume NULL #endif static int msm_fb_runtime_suspend(struct device *dev) { dev_dbg(dev, "pm_runtime: suspending...\n"); return 0; } static int msm_fb_runtime_resume(struct device *dev) { dev_dbg(dev, "pm_runtime: resuming...\n"); return 0; } static int msm_fb_runtime_idle(struct device *dev) { dev_dbg(dev, "pm_runtime: idling...\n"); return 0; } #if (defined(CONFIG_SUSPEND) && defined(CONFIG_FB_MSM_HDMI_MSM_PANEL)) static int msm_fb_ext_suspend(struct device *dev) { struct msm_fb_data_type *mfd = dev_get_drvdata(dev); struct msm_fb_panel_data *pdata = NULL; int ret = 0; if (hdmi_prim_display) { MSM_FB_INFO("%s: hdmi primary handles early suspend only\n", __func__); return 0; } if ((!mfd) || (mfd->key != MFD_KEY)) return 0; msm_fb_pan_idle(mfd); pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (mfd->panel_info.type == HDMI_PANEL || mfd->panel_info.type == DTV_PANEL) { ret = msm_fb_suspend_sub(mfd); /* Turn off the HPD circuitry */ if (pdata->power_ctrl) { MSM_FB_INFO("%s: Turning off HPD circuitry\n", __func__); pdata->power_ctrl(FALSE); } } return ret; } static int msm_fb_ext_resume(struct device *dev) { struct msm_fb_data_type *mfd = dev_get_drvdata(dev); struct msm_fb_panel_data *pdata = NULL; int ret = 0; if (hdmi_prim_display) { MSM_FB_INFO("%s: hdmi primary handles early resume only\n", __func__); return 0; } if ((!mfd) || (mfd->key != MFD_KEY)) return 0; msm_fb_pan_idle(mfd); pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (mfd->panel_info.type == HDMI_PANEL || mfd->panel_info.type == DTV_PANEL) { /* Turn on the HPD circuitry */ if (pdata->power_ctrl) { pdata->power_ctrl(TRUE); MSM_FB_INFO("%s: Turning on HPD circuitry\n", __func__); } ret = msm_fb_resume_sub(mfd); } return ret; } #endif static struct dev_pm_ops msm_fb_dev_pm_ops = { .runtime_suspend = msm_fb_runtime_suspend, .runtime_resume = msm_fb_runtime_resume, .runtime_idle = msm_fb_runtime_idle, #if (defined(CONFIG_SUSPEND) && defined(CONFIG_FB_MSM_HDMI_MSM_PANEL) && \ !defined(CONFIG_FB_MSM_HDMI_AS_PRIMARY)) .suspend = msm_fb_ext_suspend, .resume = msm_fb_ext_resume, #endif }; static struct platform_driver msm_fb_driver = { .probe = msm_fb_probe, .remove = msm_fb_remove, #ifndef CONFIG_HAS_EARLYSUSPEND .suspend = msm_fb_suspend, .resume = msm_fb_resume, #endif .shutdown = NULL, .driver = { /* Driver name must match the device name added in platform.c. */ .name = "msm_fb", .pm = &msm_fb_dev_pm_ops, }, }; #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(CONFIG_FB_MSM_MDP303) static void memset32_io(u32 __iomem *_ptr, u32 val, size_t count) { count >>= 2; while (count--) writel(val, _ptr++); } #endif #ifdef CONFIG_HAS_EARLYSUSPEND static void msmfb_early_suspend(struct early_suspend *h) { struct msm_fb_data_type *mfd = container_of(h, struct msm_fb_data_type, early_suspend); struct msm_fb_panel_data *pdata = NULL; msm_fb_pan_idle(mfd); #if defined(CONFIG_FB_MSM_MDP303) /* * For MDP with overlay, set framebuffer with black pixels * to show black screen on HDMI. */ struct fb_info *fbi = mfd->fbi; switch (mfd->fbi->var.bits_per_pixel) { case 32: memset32_io((void *)fbi->screen_base, 0xFF000000, fbi->fix.smem_len); break; default: memset32_io((void *)fbi->screen_base, 0x00, fbi->fix.smem_len); break; } #endif msm_fb_suspend_sub(mfd); pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (hdmi_prim_display && (mfd->panel_info.type == HDMI_PANEL || mfd->panel_info.type == DTV_PANEL)) { /* Turn off the HPD circuitry */ if (pdata->power_ctrl) { MSM_FB_INFO("%s: Turning off HPD circuitry\n", __func__); pdata->power_ctrl(FALSE); } } } static void msmfb_early_resume(struct early_suspend *h) { struct msm_fb_data_type *mfd = container_of(h, struct msm_fb_data_type, early_suspend); struct msm_fb_panel_data *pdata = NULL; msm_fb_pan_idle(mfd); pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if (hdmi_prim_display && (mfd->panel_info.type == HDMI_PANEL || mfd->panel_info.type == DTV_PANEL)) { /* Turn on the HPD circuitry */ if (pdata->power_ctrl) { MSM_FB_INFO("%s: Turning on HPD circuitry\n", __func__); pdata->power_ctrl(TRUE); } } msm_fb_resume_sub(mfd); } #endif static int unset_bl_level, bl_updated; #if defined(CONFIG_BACKLIGHT_LM3530) static int bl_level_old = 0x2A; #else static int bl_level_old; #endif static int mdp_bl_scale_config(struct msm_fb_data_type *mfd, struct mdp_bl_scale_data *data) { int ret = 0; int curr_bl; down(&mfd->sem); curr_bl = mfd->bl_level; bl_scale = data->scale; bl_min_lvl = data->min_lvl; pr_debug("%s: update scale = %d, min_lvl = %d\n", __func__, bl_scale, bl_min_lvl); /* update current backlight to use new scaling*/ msm_fb_set_backlight(mfd, curr_bl); up(&mfd->sem); return ret; } static void msm_fb_scale_bl(__u32 *bl_lvl) { __u32 temp = *bl_lvl; pr_debug("%s: input = %d, scale = %d", __func__, temp, bl_scale); if (temp >= bl_min_lvl) { /* bl_scale is the numerator of scaling fraction (x/1024)*/ temp = ((*bl_lvl) * bl_scale) / 1024; /*if less than minimum level, use min level*/ if (temp < bl_min_lvl) temp = bl_min_lvl; } pr_debug("%s: output = %d", __func__, temp); (*bl_lvl) = temp; } /*must call this function from within mfd->sem*/ void msm_fb_set_backlight(struct msm_fb_data_type *mfd, __u32 bkl_lvl) { struct msm_fb_panel_data *pdata; __u32 temp = bkl_lvl; if (!mfd->panel_power_on || !bl_updated) { unset_bl_level = bkl_lvl; return; } else { unset_bl_level = 0; } pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if ((pdata) && (pdata->set_backlight)) { msm_fb_scale_bl(&temp); if (bl_level_old == temp) { return; } mfd->bl_level = temp; pdata->set_backlight(mfd); mfd->bl_level = bkl_lvl; bl_level_old = temp; } } static int msm_fb_blank_sub(int blank_mode, struct fb_info *info, boolean op_enable) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; struct msm_fb_panel_data *pdata = NULL; int ret = 0; pdata = (struct msm_fb_panel_data *)mfd->pdev->dev.platform_data; if ((!pdata) || (!pdata->on) || (!pdata->off)) { printk(KERN_ERR "msm_fb_blank_sub: no panel operation detected!\n"); return -ENODEV; } switch (blank_mode) { case FB_BLANK_UNBLANK: if (!mfd->panel_power_on) { ret = pdata->on(mfd->pdev); if (ret == 0) { mfd->panel_power_on = TRUE; mfd->panel_driver_on = mfd->op_enable; } } break; case FB_BLANK_VSYNC_SUSPEND: case FB_BLANK_HSYNC_SUSPEND: case FB_BLANK_NORMAL: case FB_BLANK_POWERDOWN: default: if (mfd->panel_power_on) { int curr_pwr_state; mfd->op_enable = FALSE; curr_pwr_state = mfd->panel_power_on; mfd->panel_power_on = FALSE; if (mfd->msmfb_no_update_notify_timer.function) del_timer(&mfd->msmfb_no_update_notify_timer); complete(&mfd->msmfb_no_update_notify); bl_updated = 0; /* clean fb to prevent displaying old fb */ memset((void *)info->screen_base, 0, info->fix.smem_len); ret = pdata->off(mfd->pdev); if (ret) mfd->panel_power_on = curr_pwr_state; msm_fb_release_timeline(mfd); mfd->op_enable = TRUE; } break; } return ret; } int calc_fb_offset(struct msm_fb_data_type *mfd, struct fb_info *fbi, int bpp) { struct msm_panel_info *panel_info = &mfd->panel_info; int remainder, yres, offset; if (panel_info->mode2_yres != 0) { yres = panel_info->mode2_yres; remainder = (fbi->fix.line_length*yres) & (PAGE_SIZE - 1); } else { yres = panel_info->yres; remainder = (fbi->fix.line_length*yres) & (PAGE_SIZE - 1); } if (!remainder) remainder = PAGE_SIZE; if (fbi->var.yoffset < yres) { offset = (fbi->var.xoffset * bpp); /* iBuf->buf += fbi->var.xoffset * bpp + 0 * yres * fbi->fix.line_length; */ } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) { offset = (fbi->var.xoffset * bpp + yres * fbi->fix.line_length + PAGE_SIZE - remainder); } else { offset = (fbi->var.xoffset * bpp + 2 * yres * fbi->fix.line_length + 2 * (PAGE_SIZE - remainder)); } return offset; } static void msm_fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; msm_fb_pan_idle(mfd); cfb_fillrect(info, rect); if (!mfd->hw_refresh && (info->var.yoffset == 0) && !mfd->sw_currently_refreshing) { struct fb_var_screeninfo var; var = info->var; var.reserved[0] = 0x54445055; var.reserved[1] = (rect->dy << 16) | (rect->dx); var.reserved[2] = ((rect->dy + rect->height) << 16) | (rect->dx + rect->width); msm_fb_pan_display(&var, info); } } static void msm_fb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; msm_fb_pan_idle(mfd); cfb_copyarea(info, area); if (!mfd->hw_refresh && (info->var.yoffset == 0) && !mfd->sw_currently_refreshing) { struct fb_var_screeninfo var; var = info->var; var.reserved[0] = 0x54445055; var.reserved[1] = (area->dy << 16) | (area->dx); var.reserved[2] = ((area->dy + area->height) << 16) | (area->dx + area->width); msm_fb_pan_display(&var, info); } } static void msm_fb_imageblit(struct fb_info *info, const struct fb_image *image) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; msm_fb_pan_idle(mfd); cfb_imageblit(info, image); if (!mfd->hw_refresh && (info->var.yoffset == 0) && !mfd->sw_currently_refreshing) { struct fb_var_screeninfo var; var = info->var; var.reserved[0] = 0x54445055; var.reserved[1] = (image->dy << 16) | (image->dx); var.reserved[2] = ((image->dy + image->height) << 16) | (image->dx + image->width); msm_fb_pan_display(&var, info); } } static int msm_fb_blank(int blank_mode, struct fb_info *info) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; if (blank_mode == FB_BLANK_POWERDOWN) { struct fb_event event; event.info = info; event.data = &blank_mode; fb_notifier_call_chain(FB_EVENT_BLANK, &event); } msm_fb_pan_idle(mfd); if (mfd->op_enable == 0) { if (blank_mode == FB_BLANK_UNBLANK) { mfd->suspend.panel_power_on = TRUE; /* if unblank is called when system is in suspend, wait for the system to resume */ while (mfd->suspend.op_suspend) { pr_debug("waiting for system to resume\n"); msleep(20); } } else mfd->suspend.panel_power_on = FALSE; } return msm_fb_blank_sub(blank_mode, info, mfd->op_enable); } static int msm_fb_set_lut(struct fb_cmap *cmap, struct fb_info *info) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; if (!mfd->lut_update) return -ENODEV; mfd->lut_update(info, cmap); return 0; } /* * Custom Framebuffer mmap() function for MSM driver. * Differs from standard mmap() function by allowing for customized * page-protection. */ static int msm_fb_mmap(struct fb_info *info, struct vm_area_struct * vma) { /* Get frame buffer memory range. */ unsigned long start = info->fix.smem_start; u32 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); unsigned long off = vma->vm_pgoff << PAGE_SHIFT; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; if (!start) return -EINVAL; if ((vma->vm_end <= vma->vm_start) || (off >= len) || ((vma->vm_end - vma->vm_start) > (len - off))) return -EINVAL; msm_fb_pan_idle(mfd); /* Set VM flags. */ start &= PAGE_MASK; off += start; if (off < start) return -EINVAL; vma->vm_pgoff = off >> PAGE_SHIFT; /* This is an IO map - tell maydump to skip this VMA */ vma->vm_flags |= VM_IO | VM_RESERVED; /* Set VM page protection */ if (mfd->mdp_fb_page_protection == MDP_FB_PAGE_PROTECTION_WRITECOMBINE) vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); else if (mfd->mdp_fb_page_protection == MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE) vma->vm_page_prot = pgprot_writethroughcache(vma->vm_page_prot); else if (mfd->mdp_fb_page_protection == MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE) vma->vm_page_prot = pgprot_writebackcache(vma->vm_page_prot); else if (mfd->mdp_fb_page_protection == MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE) vma->vm_page_prot = pgprot_writebackwacache(vma->vm_page_prot); else vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); /* Remap the frame buffer I/O range */ if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; return 0; } static struct fb_ops msm_fb_ops = { .owner = THIS_MODULE, .fb_open = msm_fb_open, .fb_release = msm_fb_release, #ifdef CONFIG_LGE_DISP_FBREAD .fb_read = msm_fb_read, #else .fb_read = NULL, #endif .fb_write = NULL, .fb_cursor = NULL, .fb_check_var = msm_fb_check_var, /* vinfo check */ .fb_set_par = msm_fb_set_par, /* set the video mode according to info->var */ .fb_setcolreg = NULL, /* set color register */ .fb_blank = msm_fb_blank, /* blank display */ .fb_pan_display = msm_fb_pan_display, /* pan display */ .fb_fillrect = msm_fb_fillrect, /* Draws a rectangle */ .fb_copyarea = msm_fb_copyarea, /* Copy data from area to another */ .fb_imageblit = msm_fb_imageblit, /* Draws a image to the display */ .fb_rotate = NULL, .fb_sync = NULL, /* wait for blit idle, optional */ .fb_ioctl = msm_fb_ioctl, /* perform fb specific ioctl (optional) */ .fb_mmap = msm_fb_mmap, }; static __u32 msm_fb_line_length(__u32 fb_index, __u32 xres, int bpp) { /* The adreno GPU hardware requires that the pitch be aligned to 32 pixels for color buffers, so for the cases where the GPU is writing directly to fb0, the framebuffer pitch also needs to be 32 pixel aligned */ if (fb_index == 0) return ALIGN(xres, 32) * bpp; else return xres * bpp; } static int msm_fb_register(struct msm_fb_data_type *mfd) { int ret = -ENODEV; int bpp; struct msm_panel_info *panel_info = &mfd->panel_info; struct fb_info *fbi = mfd->fbi; struct fb_fix_screeninfo *fix; struct fb_var_screeninfo *var; int *id; int fbram_offset; int remainder, remainder_mode2; /* * fb info initialization */ fix = &fbi->fix; var = &fbi->var; fix->type_aux = 0; /* if type == FB_TYPE_INTERLEAVED_PLANES */ fix->visual = FB_VISUAL_TRUECOLOR; /* True Color */ fix->ywrapstep = 0; /* No support */ fix->mmio_start = 0; /* No MMIO Address */ fix->mmio_len = 0; /* No MMIO Address */ fix->accel = FB_ACCEL_NONE;/* FB_ACCEL_MSM needes to be added in fb.h */ var->xoffset = 0, /* Offset from virtual to visible */ var->yoffset = 0, /* resolution */ var->grayscale = 0, /* No graylevels */ var->nonstd = 0, /* standard pixel format */ var->activate = FB_ACTIVATE_VBL, /* activate it at vsync */ #if defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WXGA_PT) var->height = 102, /* height of picture in mm */ var->width = 61, /* width of picture in mm */ #else var->height = -1, /* height of picture in mm */ var->width = -1, /* width of picture in mm */ #endif var->accel_flags = 0, /* acceleration flags */ var->sync = 0, /* see FB_SYNC_* */ var->rotate = 0, /* angle we rotate counter clockwise */ mfd->op_enable = FALSE; switch (mfd->fb_imgType) { case MDP_RGB_565: fix->type = FB_TYPE_PACKED_PIXELS; fix->xpanstep = 1; fix->ypanstep = 1; var->vmode = FB_VMODE_NONINTERLACED; var->blue.offset = 0; var->green.offset = 5; var->red.offset = 11; var->blue.length = 5; var->green.length = 6; var->red.length = 5; var->blue.msb_right = 0; var->green.msb_right = 0; var->red.msb_right = 0; var->transp.offset = 0; var->transp.length = 0; bpp = 2; break; case MDP_RGB_888: fix->type = FB_TYPE_PACKED_PIXELS; fix->xpanstep = 1; fix->ypanstep = 1; var->vmode = FB_VMODE_NONINTERLACED; var->blue.offset = 0; var->green.offset = 8; var->red.offset = 16; var->blue.length = 8; var->green.length = 8; var->red.length = 8; var->blue.msb_right = 0; var->green.msb_right = 0; var->red.msb_right = 0; var->transp.offset = 0; var->transp.length = 0; bpp = 3; break; case MDP_ARGB_8888: fix->type = FB_TYPE_PACKED_PIXELS; fix->xpanstep = 1; fix->ypanstep = 1; var->vmode = FB_VMODE_NONINTERLACED; var->blue.offset = 0; var->green.offset = 8; var->red.offset = 16; var->blue.length = 8; var->green.length = 8; var->red.length = 8; var->blue.msb_right = 0; var->green.msb_right = 0; var->red.msb_right = 0; var->transp.offset = 24; var->transp.length = 8; bpp = 4; break; case MDP_RGBA_8888: fix->type = FB_TYPE_PACKED_PIXELS; fix->xpanstep = 1; fix->ypanstep = 1; var->vmode = FB_VMODE_NONINTERLACED; var->blue.offset = 8; var->green.offset = 16; var->red.offset = 24; var->blue.length = 8; var->green.length = 8; var->red.length = 8; var->blue.msb_right = 0; var->green.msb_right = 0; var->red.msb_right = 0; var->transp.offset = 0; var->transp.length = 8; bpp = 4; break; case MDP_YCRYCB_H2V1: /* ToDo: need to check TV-Out YUV422i framebuffer format */ /* we might need to create new type define */ fix->type = FB_TYPE_INTERLEAVED_PLANES; fix->xpanstep = 2; fix->ypanstep = 1; var->vmode = FB_VMODE_NONINTERLACED; /* how about R/G/B offset? */ var->blue.offset = 0; var->green.offset = 5; var->red.offset = 11; var->blue.length = 5; var->green.length = 6; var->red.length = 5; var->blue.msb_right = 0; var->green.msb_right = 0; var->red.msb_right = 0; var->transp.offset = 0; var->transp.length = 0; bpp = 2; break; default: MSM_FB_ERR("msm_fb_init: fb %d unkown image type!\n", mfd->index); return ret; } fix->type = panel_info->is_3d_panel; fix->line_length = msm_fb_line_length(mfd->index, panel_info->xres, bpp); /* Make sure all buffers can be addressed on a page boundary by an x * and y offset */ remainder = (fix->line_length * panel_info->yres) & (PAGE_SIZE - 1); /* PAGE_SIZE is a power of 2 */ if (!remainder) remainder = PAGE_SIZE; remainder_mode2 = (fix->line_length * panel_info->mode2_yres) & (PAGE_SIZE - 1); if (!remainder_mode2) remainder_mode2 = PAGE_SIZE; /* * calculate smem_len based on max size of two supplied modes. * Only fb0 has mem. fb1 and fb2 don't have mem. */ if (!bf_supported || mfd->index == 0) fix->smem_len = MAX((msm_fb_line_length(mfd->index, panel_info->xres, bpp) * panel_info->yres + PAGE_SIZE - remainder) * mfd->fb_page, (msm_fb_line_length(mfd->index, panel_info->mode2_xres, bpp) * panel_info->mode2_yres + PAGE_SIZE - remainder_mode2) * mfd->fb_page); else if (mfd->index == 1 || mfd->index == 2) { pr_debug("%s:%d no memory is allocated for fb%d!\n", __func__, __LINE__, mfd->index); fix->smem_len = 0; } mfd->var_xres = panel_info->xres; mfd->var_yres = panel_info->yres; mfd->var_frame_rate = panel_info->frame_rate; var->pixclock = mfd->panel_info.clk_rate; mfd->var_pixclock = var->pixclock; var->xres = panel_info->xres; var->yres = panel_info->yres; var->xres_virtual = panel_info->xres; var->yres_virtual = panel_info->yres * mfd->fb_page + ((PAGE_SIZE - remainder)/fix->line_length) * mfd->fb_page; var->bits_per_pixel = bpp * 8; /* FrameBuffer color depth */ var->reserved[3] = mdp_get_panel_framerate(mfd); /* * id field for fb app */ id = (int *)&mfd->panel; switch (mdp_rev) { case MDP_REV_20: snprintf(fix->id, sizeof(fix->id), "msmfb20_%x", (__u32) *id); break; case MDP_REV_22: snprintf(fix->id, sizeof(fix->id), "msmfb22_%x", (__u32) *id); break; case MDP_REV_30: snprintf(fix->id, sizeof(fix->id), "msmfb30_%x", (__u32) *id); break; case MDP_REV_303: snprintf(fix->id, sizeof(fix->id), "msmfb303_%x", (__u32) *id); break; case MDP_REV_31: snprintf(fix->id, sizeof(fix->id), "msmfb31_%x", (__u32) *id); break; case MDP_REV_40: snprintf(fix->id, sizeof(fix->id), "msmfb40_%x", (__u32) *id); break; case MDP_REV_41: snprintf(fix->id, sizeof(fix->id), "msmfb41_%x", (__u32) *id); break; case MDP_REV_42: snprintf(fix->id, sizeof(fix->id), "msmfb42_%x", (__u32) *id); break; case MDP_REV_43: snprintf(fix->id, sizeof(fix->id), "msmfb43_%x", (__u32) *id); break; case MDP_REV_44: snprintf(fix->id, sizeof(fix->id), "msmfb44_%x", (__u32) *id); break; default: snprintf(fix->id, sizeof(fix->id), "msmfb0_%x", (__u32) *id); break; } fbi->fbops = &msm_fb_ops; fbi->flags = FBINFO_FLAG_DEFAULT; fbi->pseudo_palette = msm_fb_pseudo_palette; mfd->ref_cnt = 0; mfd->sw_currently_refreshing = FALSE; mfd->sw_refreshing_enable = TRUE; mfd->panel_power_on = FALSE; mfd->pan_waiting = FALSE; init_completion(&mfd->pan_comp); init_completion(&mfd->refresher_comp); sema_init(&mfd->sem, 1); init_timer(&mfd->msmfb_no_update_notify_timer); mfd->msmfb_no_update_notify_timer.function = msmfb_no_update_notify_timer_cb; mfd->msmfb_no_update_notify_timer.data = (unsigned long)mfd; init_completion(&mfd->msmfb_update_notify); init_completion(&mfd->msmfb_no_update_notify); init_completion(&mfd->commit_comp); mutex_init(&mfd->sync_mutex); INIT_WORK(&mfd->commit_work, msm_fb_commit_wq_handler); { char wq_name[MAX_WQ_NAME_LEN]; snprintf(wq_name, sizeof(wq_name), "msmfb_commit_wq_%d", mfd->index); mfd->commit_wq = create_singlethread_workqueue(wq_name); } mfd->msm_fb_backup = kzalloc(sizeof(struct msm_fb_backup_type), GFP_KERNEL); if (mfd->msm_fb_backup == 0) { pr_err("error: not enough memory!\n"); return -ENOMEM; } fbram_offset = PAGE_ALIGN((int)fbram)-(int)fbram; fbram += fbram_offset; fbram_phys += fbram_offset; fbram_size -= fbram_offset; if (!bf_supported || mfd->index == 0) if (fbram_size < fix->smem_len) { pr_err("error: no more framebuffer memory!\n"); return -ENOMEM; } fbi->screen_base = fbram; fbi->fix.smem_start = (unsigned long)fbram_phys; msm_iommu_map_contig_buffer(fbi->fix.smem_start, DISPLAY_WRITE_DOMAIN, GEN_POOL, fbi->fix.smem_len, SZ_4K, 0, &(mfd->display_iova)); msm_iommu_map_contig_buffer(fbi->fix.smem_start, DISPLAY_READ_DOMAIN, GEN_POOL, fbi->fix.smem_len, SZ_4K, 0, &(mfd->display_iova)); msm_iommu_map_contig_buffer(fbi->fix.smem_start, ROTATOR_SRC_DOMAIN, GEN_POOL, fbi->fix.smem_len, SZ_4K, 0, &(mfd->rotator_iova)); if (!bf_supported || mfd->index == 0) memset(fbi->screen_base, 0x0, fix->smem_len); mfd->op_enable = TRUE; mfd->panel_power_on = FALSE; /* cursor memory allocation */ if (mfd->cursor_update) { unsigned long cursor_buf_iommu = 0; mfd->cursor_buf = dma_alloc_coherent(NULL, MDP_CURSOR_SIZE, (dma_addr_t *) &mfd->cursor_buf_phys, GFP_KERNEL); msm_iommu_map_contig_buffer((unsigned long)mfd->cursor_buf_phys, DISPLAY_READ_DOMAIN, GEN_POOL, MDP_CURSOR_SIZE, SZ_4K, 0, &cursor_buf_iommu); if (cursor_buf_iommu) mfd->cursor_buf_phys = (void *)cursor_buf_iommu; if (!mfd->cursor_buf) mfd->cursor_update = 0; } if (mfd->lut_update) { ret = fb_alloc_cmap(&fbi->cmap, 256, 0); if (ret) printk(KERN_ERR "%s: fb_alloc_cmap() failed!\n", __func__); } if (register_framebuffer(fbi) < 0) { if (mfd->lut_update) fb_dealloc_cmap(&fbi->cmap); if (mfd->cursor_buf) dma_free_coherent(NULL, MDP_CURSOR_SIZE, mfd->cursor_buf, (dma_addr_t) mfd->cursor_buf_phys); mfd->op_enable = FALSE; return -EPERM; } fbram += fix->smem_len; fbram_phys += fix->smem_len; fbram_size -= fix->smem_len; MSM_FB_INFO ("FrameBuffer[%d] %dx%d size=%d bytes is registered successfully!\n", mfd->index, fbi->var.xres, fbi->var.yres, fbi->fix.smem_len); #ifdef CONFIG_UPDATE_LCDC_LUT if (msm_fb_pdata->update_lcdc_lut) msm_fb_pdata->update_lcdc_lut(); #endif ret = 0; #ifdef CONFIG_HAS_EARLYSUSPEND if (hdmi_prim_display || (mfd->panel_info.type != DTV_PANEL)) { mfd->early_suspend.suspend = msmfb_early_suspend; mfd->early_suspend.resume = msmfb_early_resume; mfd->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB - 2; register_early_suspend(&mfd->early_suspend); } #endif #ifdef MSM_FB_ENABLE_DBGFS { struct dentry *root; struct dentry *sub_dir; char sub_name[2]; root = msm_fb_get_debugfs_root(); if (root != NULL) { sub_name[0] = (char)(mfd->index + 0x30); sub_name[1] = '\0'; sub_dir = debugfs_create_dir(sub_name, root); } else { sub_dir = NULL; } mfd->sub_dir = sub_dir; if (sub_dir) { msm_fb_debugfs_file_create(sub_dir, "op_enable", (u32 *) &mfd->op_enable); msm_fb_debugfs_file_create(sub_dir, "panel_power_on", (u32 *) &mfd-> panel_power_on); msm_fb_debugfs_file_create(sub_dir, "ref_cnt", (u32 *) &mfd->ref_cnt); msm_fb_debugfs_file_create(sub_dir, "fb_imgType", (u32 *) &mfd->fb_imgType); msm_fb_debugfs_file_create(sub_dir, "sw_currently_refreshing", (u32 *) &mfd-> sw_currently_refreshing); msm_fb_debugfs_file_create(sub_dir, "sw_refreshing_enable", (u32 *) &mfd-> sw_refreshing_enable); msm_fb_debugfs_file_create(sub_dir, "xres", (u32 *) &mfd->panel_info. xres); msm_fb_debugfs_file_create(sub_dir, "yres", (u32 *) &mfd->panel_info. yres); msm_fb_debugfs_file_create(sub_dir, "bpp", (u32 *) &mfd->panel_info. bpp); msm_fb_debugfs_file_create(sub_dir, "type", (u32 *) &mfd->panel_info. type); msm_fb_debugfs_file_create(sub_dir, "wait_cycle", (u32 *) &mfd->panel_info. wait_cycle); msm_fb_debugfs_file_create(sub_dir, "pdest", (u32 *) &mfd->panel_info. pdest); msm_fb_debugfs_file_create(sub_dir, "backbuff", (u32 *) &mfd->panel_info. fb_num); msm_fb_debugfs_file_create(sub_dir, "clk_rate", (u32 *) &mfd->panel_info. clk_rate); msm_fb_debugfs_file_create(sub_dir, "frame_count", (u32 *) &mfd->panel_info. frame_count); switch (mfd->dest) { case DISPLAY_LCD: msm_fb_debugfs_file_create(sub_dir, "vsync_enable", (u32 *)&mfd->panel_info.lcd.vsync_enable); msm_fb_debugfs_file_create(sub_dir, "refx100", (u32 *) &mfd->panel_info.lcd. refx100); msm_fb_debugfs_file_create(sub_dir, "v_back_porch", (u32 *) &mfd->panel_info.lcd.v_back_porch); msm_fb_debugfs_file_create(sub_dir, "v_front_porch", (u32 *) &mfd->panel_info.lcd.v_front_porch); msm_fb_debugfs_file_create(sub_dir, "v_pulse_width", (u32 *) &mfd->panel_info.lcd.v_pulse_width); msm_fb_debugfs_file_create(sub_dir, "hw_vsync_mode", (u32 *) &mfd->panel_info.lcd.hw_vsync_mode); msm_fb_debugfs_file_create(sub_dir, "vsync_notifier_period", (u32 *) &mfd->panel_info.lcd.vsync_notifier_period); break; case DISPLAY_LCDC: msm_fb_debugfs_file_create(sub_dir, "h_back_porch", (u32 *) &mfd->panel_info.lcdc.h_back_porch); msm_fb_debugfs_file_create(sub_dir, "h_front_porch", (u32 *) &mfd->panel_info.lcdc.h_front_porch); msm_fb_debugfs_file_create(sub_dir, "h_pulse_width", (u32 *) &mfd->panel_info.lcdc.h_pulse_width); msm_fb_debugfs_file_create(sub_dir, "v_back_porch", (u32 *) &mfd->panel_info.lcdc.v_back_porch); msm_fb_debugfs_file_create(sub_dir, "v_front_porch", (u32 *) &mfd->panel_info.lcdc.v_front_porch); msm_fb_debugfs_file_create(sub_dir, "v_pulse_width", (u32 *) &mfd->panel_info.lcdc.v_pulse_width); msm_fb_debugfs_file_create(sub_dir, "border_clr", (u32 *) &mfd->panel_info.lcdc.border_clr); msm_fb_debugfs_file_create(sub_dir, "underflow_clr", (u32 *) &mfd->panel_info.lcdc.underflow_clr); msm_fb_debugfs_file_create(sub_dir, "hsync_skew", (u32 *) &mfd->panel_info.lcdc.hsync_skew); break; default: break; } } } #endif /* MSM_FB_ENABLE_DBGFS */ return ret; } static int msm_fb_open(struct fb_info *info, int user) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; bool unblank = true; int result; result = pm_runtime_get_sync(info->dev); if (result < 0) { printk(KERN_ERR "pm_runtime: fail to wake up\n"); } if (info->node == 0 && !(mfd->cont_splash_done)) { /* primary */ mfd->ref_cnt++; return 0; } if (!mfd->ref_cnt) { if (!bf_supported || (info->node != 1 && info->node != 2)) mdp_set_dma_pan_info(info, NULL, TRUE); else pr_debug("%s:%d no mdp_set_dma_pan_info %d\n", __func__, __LINE__, info->node); if (mfd->is_panel_ready && !mfd->is_panel_ready()) unblank = false; if (unblank && (mfd->panel_info.type != DTV_PANEL)) { if (msm_fb_blank_sub(FB_BLANK_UNBLANK, info, TRUE)) { pr_err("msm_fb_open: can't turn on display\n"); return -EINVAL; } } } mfd->ref_cnt++; return 0; } static void msm_fb_free_base_pipe(struct msm_fb_data_type *mfd) { return mdp4_overlay_free_base_pipe(mfd); } static int msm_fb_release(struct fb_info *info, int user) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; int ret = 0; if (!mfd->ref_cnt) { MSM_FB_INFO("msm_fb_release: try to close unopened fb %d!\n", mfd->index); return -EINVAL; } msm_fb_pan_idle(mfd); mfd->ref_cnt--; if (!mfd->ref_cnt) { if (mfd->op_enable) { ret = msm_fb_blank_sub(FB_BLANK_POWERDOWN, info, mfd->op_enable); if (ret != 0) { printk(KERN_ERR "msm_fb_release: can't turn off display!\n"); return ret; } } else { msm_fb_free_base_pipe(mfd); } } pm_runtime_put(info->dev); return ret; } void msm_fb_wait_for_fence(struct msm_fb_data_type *mfd) { int i, ret = 0; /* buf sync */ for (i = 0; i < mfd->acq_fen_cnt; i++) { ret = sync_fence_wait(mfd->acq_fen[i], WAIT_FENCE_FIRST_TIMEOUT); if (ret == -ETIME) { pr_warn("%s: sync_fence_wait timed out!" "Waiting %ld more seconds\n", __func__,WAIT_FENCE_FINAL_TIMEOUT/MSEC_PER_SEC); ret = sync_fence_wait(mfd->acq_fen[i], WAIT_FENCE_FINAL_TIMEOUT); } if (ret < 0) { pr_err("%s: sync_fence_wait failed! ret = %x\n", __func__, ret); break; } sync_fence_put(mfd->acq_fen[i]); } if (ret < 0) { while (i < mfd->acq_fen_cnt) { sync_fence_put(mfd->acq_fen[i]); i++; } } mfd->acq_fen_cnt = 0; } int msm_fb_signal_timeline(struct msm_fb_data_type *mfd) { mutex_lock(&mfd->sync_mutex); if (mfd->timeline && !list_empty((const struct list_head *) (&(mfd->timeline->obj.active_list_head)))) { sw_sync_timeline_inc(mfd->timeline, 1); mfd->timeline_value++; } mutex_unlock(&mfd->sync_mutex); return 0; } void msm_fb_release_timeline(struct msm_fb_data_type *mfd) { mutex_lock(&mfd->sync_mutex); if (mfd->timeline) { sw_sync_timeline_inc(mfd->timeline, 2); mfd->timeline_value += 2; } mutex_unlock(&mfd->sync_mutex); } DEFINE_SEMAPHORE(msm_fb_pan_sem); static int msm_fb_pan_idle(struct msm_fb_data_type *mfd) { int ret = 0; mutex_lock(&mfd->sync_mutex); if (mfd->is_committing) { mutex_unlock(&mfd->sync_mutex); ret = wait_for_completion_interruptible_timeout( &mfd->commit_comp, msecs_to_jiffies(WAIT_DISP_OP_TIMEOUT)); if (ret < 0) ret = -ERESTARTSYS; else if (!ret) pr_err("%s wait for commit_comp timeout %d %d", __func__, ret, mfd->is_committing); if (ret <= 0) { mutex_lock(&mfd->sync_mutex); mfd->is_committing = 0; complete_all(&mfd->commit_comp); mutex_unlock(&mfd->sync_mutex); } } else { mutex_unlock(&mfd->sync_mutex); } return ret; } static int msm_fb_pan_display_ex(struct fb_info *info, struct mdp_display_commit *disp_commit) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; struct msm_fb_backup_type *fb_backup; struct fb_var_screeninfo *var = &disp_commit->var; u32 wait_for_finish = disp_commit->wait_for_finish; int ret = 0; if (disp_commit->flags & MDP_DISPLAY_COMMIT_OVERLAY) { if (!mfd->panel_power_on) /* suspended */ return -EPERM; } else { /* * If framebuffer is 2, io pan display is not allowed. */ if (bf_supported && info->node == 2) { pr_err("%s: no pan display for fb%d!", __func__, info->node); return -EPERM; } if (info->node != 0 || mfd->cont_splash_done) /* primary */ if ((!mfd->op_enable) || (!mfd->panel_power_on)) return -EPERM; if (var->xoffset > (info->var.xres_virtual - info->var.xres)) return -EINVAL; if (var->yoffset > (info->var.yres_virtual - info->var.yres)) return -EINVAL; } msm_fb_pan_idle(mfd); mutex_lock(&mfd->sync_mutex); if (!(disp_commit->flags & MDP_DISPLAY_COMMIT_OVERLAY)) { if (info->fix.xpanstep) info->var.xoffset = (var->xoffset / info->fix.xpanstep) * info->fix.xpanstep; if (info->fix.ypanstep) info->var.yoffset = (var->yoffset / info->fix.ypanstep) * info->fix.ypanstep; } fb_backup = (struct msm_fb_backup_type *)mfd->msm_fb_backup; memcpy(&fb_backup->info, info, sizeof(struct fb_info)); memcpy(&fb_backup->disp_commit, disp_commit, sizeof(struct mdp_display_commit)); mfd->is_committing = 1; INIT_COMPLETION(mfd->commit_comp); queue_work(mfd->commit_wq, &mfd->commit_work); mutex_unlock(&mfd->sync_mutex); if (wait_for_finish) msm_fb_pan_idle(mfd); return ret; } static int msm_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { struct mdp_display_commit disp_commit; memset(&disp_commit, 0, sizeof(disp_commit)); disp_commit.var = *var; disp_commit.wait_for_finish = TRUE; return msm_fb_pan_display_ex(info, &disp_commit); } static int msm_fb_pan_display_sub(struct fb_var_screeninfo *var, struct fb_info *info) { struct mdp_dirty_region dirty; struct mdp_dirty_region *dirtyPtr = NULL; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; struct msm_fb_panel_data *pdata; /* * If framebuffer is 2, io pen display is not allowed. */ if (bf_supported && info->node == 2) { pr_err("%s: no pan display for fb%d!", __func__, info->node); return -EPERM; } if (info->node != 0 || mfd->cont_splash_done) /* primary */ if ((!mfd->op_enable) || (!mfd->panel_power_on)) return -EPERM; if (var->xoffset > (info->var.xres_virtual - info->var.xres)) return -EINVAL; if (var->yoffset > (info->var.yres_virtual - info->var.yres)) return -EINVAL; if (info->fix.xpanstep) info->var.xoffset = (var->xoffset / info->fix.xpanstep) * info->fix.xpanstep; if (info->fix.ypanstep) info->var.yoffset = (var->yoffset / info->fix.ypanstep) * info->fix.ypanstep; /* "UPDT" */ if (var->reserved[0] == 0x54445055) { dirty.xoffset = var->reserved[1] & 0xffff; dirty.yoffset = (var->reserved[1] >> 16) & 0xffff; if ((var->reserved[2] & 0xffff) <= dirty.xoffset) return -EINVAL; if (((var->reserved[2] >> 16) & 0xffff) <= dirty.yoffset) return -EINVAL; dirty.width = (var->reserved[2] & 0xffff) - dirty.xoffset; dirty.height = ((var->reserved[2] >> 16) & 0xffff) - dirty.yoffset; info->var.yoffset = var->yoffset; if (dirty.xoffset < 0) return -EINVAL; if (dirty.yoffset < 0) return -EINVAL; if ((dirty.xoffset + dirty.width) > info->var.xres) return -EINVAL; if ((dirty.yoffset + dirty.height) > info->var.yres) return -EINVAL; if ((dirty.width <= 0) || (dirty.height <= 0)) return -EINVAL; dirtyPtr = &dirty; } complete(&mfd->msmfb_update_notify); mutex_lock(&msm_fb_notify_update_sem); if (mfd->msmfb_no_update_notify_timer.function) del_timer(&mfd->msmfb_no_update_notify_timer); mfd->msmfb_no_update_notify_timer.expires = jiffies + (2 * HZ); add_timer(&mfd->msmfb_no_update_notify_timer); mutex_unlock(&msm_fb_notify_update_sem); down(&msm_fb_pan_sem); msm_fb_wait_for_fence(mfd); if (info->node == 0 && !(mfd->cont_splash_done)) { /* primary */ mdp_set_dma_pan_info(info, NULL, TRUE); if (msm_fb_blank_sub(FB_BLANK_UNBLANK, info, mfd->op_enable)) { pr_err("%s: can't turn on display!\n", __func__); up(&msm_fb_pan_sem); msm_fb_release_timeline(mfd); return -EINVAL; } } mdp_set_dma_pan_info(info, dirtyPtr, (var->activate & FB_ACTIVATE_VBL)); /* async call */ mdp_dma_pan_update(info); msm_fb_signal_timeline(mfd); if (mdp4_unmap_sec_resource(mfd)) pr_err("%s: unmap secure res failed\n", __func__); up(&msm_fb_pan_sem); if (unset_bl_level && !bl_updated) { pdata = (struct msm_fb_panel_data *)mfd->pdev-> dev.platform_data; if ((pdata) && (pdata->set_backlight)) { down(&mfd->sem); mfd->bl_level = unset_bl_level; pdata->set_backlight(mfd); bl_level_old = unset_bl_level; up(&mfd->sem); bl_updated = 1; } } ++mfd->panel_info.frame_count; return 0; } static void msm_fb_commit_wq_handler(struct work_struct *work) { struct msm_fb_data_type *mfd; struct fb_var_screeninfo *var; struct fb_info *info; struct msm_fb_backup_type *fb_backup; mfd = container_of(work, struct msm_fb_data_type, commit_work); fb_backup = (struct msm_fb_backup_type *)mfd->msm_fb_backup; info = &fb_backup->info; if (fb_backup->disp_commit.flags & MDP_DISPLAY_COMMIT_OVERLAY) { mdp4_overlay_commit(info); } else { var = &fb_backup->disp_commit.var; msm_fb_pan_display_sub(var, info); } mutex_lock(&mfd->sync_mutex); mfd->is_committing = 0; complete_all(&mfd->commit_comp); mutex_unlock(&mfd->sync_mutex); } static int msm_fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; msm_fb_pan_idle(mfd); if (var->rotate != FB_ROTATE_UR) return -EINVAL; if (var->grayscale != info->var.grayscale) return -EINVAL; switch (var->bits_per_pixel) { case 16: if ((var->green.offset != 5) || !((var->blue.offset == 11) || (var->blue.offset == 0)) || !((var->red.offset == 11) || (var->red.offset == 0)) || (var->blue.length != 5) || (var->green.length != 6) || (var->red.length != 5) || (var->blue.msb_right != 0) || (var->green.msb_right != 0) || (var->red.msb_right != 0) || (var->transp.offset != 0) || (var->transp.length != 0)) return -EINVAL; break; case 24: if ((var->blue.offset != 0) || (var->green.offset != 8) || (var->red.offset != 16) || (var->blue.length != 8) || (var->green.length != 8) || (var->red.length != 8) || (var->blue.msb_right != 0) || (var->green.msb_right != 0) || (var->red.msb_right != 0) || !(((var->transp.offset == 0) && (var->transp.length == 0)) || ((var->transp.offset == 24) && (var->transp.length == 8)))) return -EINVAL; break; case 32: /* Figure out if the user meant RGBA or ARGB and verify the position of the RGB components */ if (var->transp.offset == 24) { if ((var->blue.offset != 0) || (var->green.offset != 8) || (var->red.offset != 16)) return -EINVAL; } else if (var->transp.offset == 0) { if ((var->blue.offset != 8) || (var->green.offset != 16) || (var->red.offset != 24)) return -EINVAL; } else return -EINVAL; /* Check the common values for both RGBA and ARGB */ if ((var->blue.length != 8) || (var->green.length != 8) || (var->red.length != 8) || (var->transp.length != 8) || (var->blue.msb_right != 0) || (var->green.msb_right != 0) || (var->red.msb_right != 0)) return -EINVAL; break; default: return -EINVAL; } if ((var->xres_virtual <= 0) || (var->yres_virtual <= 0)) return -EINVAL; if (!bf_supported || (info->node != 1 && info->node != 2)) if (info->fix.smem_len < (var->xres_virtual* var->yres_virtual* (var->bits_per_pixel/8))) return -EINVAL; if ((var->xres == 0) || (var->yres == 0)) return -EINVAL; if (var->xoffset > (var->xres_virtual - var->xres)) return -EINVAL; if (var->yoffset > (var->yres_virtual - var->yres)) return -EINVAL; return 0; } int msm_fb_check_frame_rate(struct msm_fb_data_type *mfd , struct fb_info *info) { int panel_height, panel_width, var_frame_rate, fps_mod; struct fb_var_screeninfo *var = &info->var; fps_mod = 0; if ((mfd->panel_info.type == DTV_PANEL) || (mfd->panel_info.type == HDMI_PANEL)) { panel_height = var->yres + var->upper_margin + var->vsync_len + var->lower_margin; panel_width = var->xres + var->right_margin + var->hsync_len + var->left_margin; var_frame_rate = ((var->pixclock)/(panel_height * panel_width)); if (mfd->var_frame_rate != var_frame_rate) { fps_mod = 1; mfd->var_frame_rate = var_frame_rate; } } return fps_mod; } static int msm_fb_set_par(struct fb_info *info) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; struct fb_var_screeninfo *var = &info->var; int old_imgType; int blank = 0; msm_fb_pan_idle(mfd); old_imgType = mfd->fb_imgType; switch (var->bits_per_pixel) { case 16: if (var->red.offset == 0) mfd->fb_imgType = MDP_BGR_565; else mfd->fb_imgType = MDP_RGB_565; break; case 24: if ((var->transp.offset == 0) && (var->transp.length == 0)) mfd->fb_imgType = MDP_RGB_888; else if ((var->transp.offset == 24) && (var->transp.length == 8)) { mfd->fb_imgType = MDP_ARGB_8888; info->var.bits_per_pixel = 32; } break; case 32: if (var->transp.offset == 24) mfd->fb_imgType = MDP_ARGB_8888; else mfd->fb_imgType = MDP_RGBA_8888; break; default: return -EINVAL; } if ((mfd->var_pixclock != var->pixclock) || (mfd->hw_refresh && ((mfd->fb_imgType != old_imgType) || (mfd->var_pixclock != var->pixclock) || (mfd->var_xres != var->xres) || (mfd->var_yres != var->yres) || (msm_fb_check_frame_rate(mfd, info))))) { mfd->var_xres = var->xres; mfd->var_yres = var->yres; mfd->var_pixclock = var->pixclock; blank = 1; } mfd->fbi->fix.line_length = msm_fb_line_length(mfd->index, var->xres, var->bits_per_pixel/8); if (mfd->update_panel_info) mfd->update_panel_info(mfd); if ((mfd->panel_info.type == DTV_PANEL) && !mfd->panel_power_on) { msm_fb_blank_sub(FB_BLANK_UNBLANK, info, mfd->op_enable); } else if (blank) { msm_fb_blank_sub(FB_BLANK_POWERDOWN, info, mfd->op_enable); msm_fb_blank_sub(FB_BLANK_UNBLANK, info, mfd->op_enable); } return 0; } static int msm_fb_stop_sw_refresher(struct msm_fb_data_type *mfd) { if (mfd->hw_refresh) return -EPERM; if (mfd->sw_currently_refreshing) { down(&mfd->sem); mfd->sw_currently_refreshing = FALSE; up(&mfd->sem); /* wait until the refresher finishes the last job */ wait_for_completion_killable(&mfd->refresher_comp); } return 0; } int msm_fb_resume_sw_refresher(struct msm_fb_data_type *mfd) { boolean do_refresh; if (mfd->hw_refresh) return -EPERM; down(&mfd->sem); if ((!mfd->sw_currently_refreshing) && (mfd->sw_refreshing_enable)) { do_refresh = TRUE; mfd->sw_currently_refreshing = TRUE; } else { do_refresh = FALSE; } up(&mfd->sem); if (do_refresh) mdp_refresh_screen((unsigned long)mfd); return 0; } #if defined CONFIG_FB_MSM_MDP31 static int mdp_blit_split_height(struct fb_info *info, struct mdp_blit_req *req) { int ret; struct mdp_blit_req splitreq; int s_x_0, s_x_1, s_w_0, s_w_1, s_y_0, s_y_1, s_h_0, s_h_1; int d_x_0, d_x_1, d_w_0, d_w_1, d_y_0, d_y_1, d_h_0, d_h_1; splitreq = *req; /* break dest roi at height*/ d_x_0 = d_x_1 = req->dst_rect.x; d_w_0 = d_w_1 = req->dst_rect.w; d_y_0 = req->dst_rect.y; if (req->dst_rect.h % 32 == 3) d_h_1 = (req->dst_rect.h - 3) / 2 - 1; else if (req->dst_rect.h % 32 == 2) d_h_1 = (req->dst_rect.h - 2) / 2 - 6; else d_h_1 = (req->dst_rect.h - 1) / 2 - 1; d_h_0 = req->dst_rect.h - d_h_1; d_y_1 = d_y_0 + d_h_0; if (req->dst_rect.h == 3) { d_h_1 = 2; d_h_0 = 2; d_y_1 = d_y_0 + 1; } /* blit first region */ if (((splitreq.flags & 0x07) == 0x04) || ((splitreq.flags & 0x07) == 0x0)) { if (splitreq.flags & MDP_ROT_90) { s_y_0 = s_y_1 = req->src_rect.y; s_h_0 = s_h_1 = req->src_rect.h; s_x_0 = req->src_rect.x; s_w_1 = (req->src_rect.w * d_h_1) / req->dst_rect.h; s_w_0 = req->src_rect.w - s_w_1; s_x_1 = s_x_0 + s_w_0; if (d_h_1 >= 8 * s_w_1) { s_w_1++; s_x_1--; } } else { s_x_0 = s_x_1 = req->src_rect.x; s_w_0 = s_w_1 = req->src_rect.w; s_y_0 = req->src_rect.y; s_h_1 = (req->src_rect.h * d_h_1) / req->dst_rect.h; s_h_0 = req->src_rect.h - s_h_1; s_y_1 = s_y_0 + s_h_0; if (d_h_1 >= 8 * s_h_1) { s_h_1++; s_y_1--; } } splitreq.src_rect.h = s_h_0; splitreq.src_rect.y = s_y_0; splitreq.dst_rect.h = d_h_0; splitreq.dst_rect.y = d_y_0; splitreq.src_rect.x = s_x_0; splitreq.src_rect.w = s_w_0; splitreq.dst_rect.x = d_x_0; splitreq.dst_rect.w = d_w_0; } else { if (splitreq.flags & MDP_ROT_90) { s_y_0 = s_y_1 = req->src_rect.y; s_h_0 = s_h_1 = req->src_rect.h; s_x_0 = req->src_rect.x; s_w_1 = (req->src_rect.w * d_h_0) / req->dst_rect.h; s_w_0 = req->src_rect.w - s_w_1; s_x_1 = s_x_0 + s_w_0; if (d_h_0 >= 8 * s_w_1) { s_w_1++; s_x_1--; } } else { s_x_0 = s_x_1 = req->src_rect.x; s_w_0 = s_w_1 = req->src_rect.w; s_y_0 = req->src_rect.y; s_h_1 = (req->src_rect.h * d_h_0) / req->dst_rect.h; s_h_0 = req->src_rect.h - s_h_1; s_y_1 = s_y_0 + s_h_0; if (d_h_0 >= 8 * s_h_1) { s_h_1++; s_y_1--; } } splitreq.src_rect.h = s_h_0; splitreq.src_rect.y = s_y_0; splitreq.dst_rect.h = d_h_1; splitreq.dst_rect.y = d_y_1; splitreq.src_rect.x = s_x_0; splitreq.src_rect.w = s_w_0; splitreq.dst_rect.x = d_x_1; splitreq.dst_rect.w = d_w_1; } ret = mdp_ppp_blit(info, &splitreq); if (ret) return ret; /* blit second region */ if (((splitreq.flags & 0x07) == 0x04) || ((splitreq.flags & 0x07) == 0x0)) { splitreq.src_rect.h = s_h_1; splitreq.src_rect.y = s_y_1; splitreq.dst_rect.h = d_h_1; splitreq.dst_rect.y = d_y_1; splitreq.src_rect.x = s_x_1; splitreq.src_rect.w = s_w_1; splitreq.dst_rect.x = d_x_1; splitreq.dst_rect.w = d_w_1; } else { splitreq.src_rect.h = s_h_1; splitreq.src_rect.y = s_y_1; splitreq.dst_rect.h = d_h_0; splitreq.dst_rect.y = d_y_0; splitreq.src_rect.x = s_x_1; splitreq.src_rect.w = s_w_1; splitreq.dst_rect.x = d_x_0; splitreq.dst_rect.w = d_w_0; } ret = mdp_ppp_blit(info, &splitreq); return ret; } #endif int mdp_blit(struct fb_info *info, struct mdp_blit_req *req) { int ret; #if defined CONFIG_FB_MSM_MDP31 || defined CONFIG_FB_MSM_MDP30 unsigned int remainder = 0, is_bpp_4 = 0; struct mdp_blit_req splitreq; int s_x_0, s_x_1, s_w_0, s_w_1, s_y_0, s_y_1, s_h_0, s_h_1; int d_x_0, d_x_1, d_w_0, d_w_1, d_y_0, d_y_1, d_h_0, d_h_1; if (req->flags & MDP_ROT_90) { if (((req->dst_rect.h == 1) && ((req->src_rect.w != 1) || (req->dst_rect.w != req->src_rect.h))) || ((req->dst_rect.w == 1) && ((req->src_rect.h != 1) || (req->dst_rect.h != req->src_rect.w)))) { printk(KERN_ERR "mpd_ppp: error scaling when size is 1!\n"); return -EINVAL; } } else { if (((req->dst_rect.w == 1) && ((req->src_rect.w != 1) || (req->dst_rect.h != req->src_rect.h))) || ((req->dst_rect.h == 1) && ((req->src_rect.h != 1) || (req->dst_rect.w != req->src_rect.w)))) { printk(KERN_ERR "mpd_ppp: error scaling when size is 1!\n"); return -EINVAL; } } #endif if (unlikely(req->src_rect.h == 0 || req->src_rect.w == 0)) { printk(KERN_ERR "mpd_ppp: src img of zero size!\n"); return -EINVAL; } if (unlikely(req->dst_rect.h == 0 || req->dst_rect.w == 0)) return 0; #if defined CONFIG_FB_MSM_MDP31 /* MDP width split workaround */ remainder = (req->dst_rect.w)%32; ret = mdp_get_bytes_per_pixel(req->dst.format, (struct msm_fb_data_type *)info->par); if (ret <= 0) { printk(KERN_ERR "mdp_ppp: incorrect bpp!\n"); return -EINVAL; } is_bpp_4 = (ret == 4) ? 1 : 0; if ((is_bpp_4 && (remainder == 6 || remainder == 14 || remainder == 22 || remainder == 30)) || remainder == 3 || (remainder == 1 && req->dst_rect.w != 1) || (remainder == 2 && req->dst_rect.w != 2)) { /* make new request as provide by user */ splitreq = *req; /* break dest roi at width*/ d_y_0 = d_y_1 = req->dst_rect.y; d_h_0 = d_h_1 = req->dst_rect.h; d_x_0 = req->dst_rect.x; if (remainder == 14) d_w_1 = (req->dst_rect.w - 14) / 2 + 4; else if (remainder == 22) d_w_1 = (req->dst_rect.w - 22) / 2 + 10; else if (remainder == 30) d_w_1 = (req->dst_rect.w - 30) / 2 + 10; else if (remainder == 6) d_w_1 = req->dst_rect.w / 2 - 1; else if (remainder == 3) d_w_1 = (req->dst_rect.w - 3) / 2 - 1; else if (remainder == 2) d_w_1 = (req->dst_rect.w - 2) / 2 - 6; else d_w_1 = (req->dst_rect.w - 1) / 2 - 1; d_w_0 = req->dst_rect.w - d_w_1; d_x_1 = d_x_0 + d_w_0; if (req->dst_rect.w == 3) { d_w_1 = 2; d_w_0 = 2; d_x_1 = d_x_0 + 1; } /* blit first region */ if (((splitreq.flags & 0x07) == 0x07) || ((splitreq.flags & 0x07) == 0x0)) { if (splitreq.flags & MDP_ROT_90) { s_x_0 = s_x_1 = req->src_rect.x; s_w_0 = s_w_1 = req->src_rect.w; s_y_0 = req->src_rect.y; s_h_1 = (req->src_rect.h * d_w_1) / req->dst_rect.w; s_h_0 = req->src_rect.h - s_h_1; s_y_1 = s_y_0 + s_h_0; if (d_w_1 >= 8 * s_h_1) { s_h_1++; s_y_1--; } } else { s_y_0 = s_y_1 = req->src_rect.y; s_h_0 = s_h_1 = req->src_rect.h; s_x_0 = req->src_rect.x; s_w_1 = (req->src_rect.w * d_w_1) / req->dst_rect.w; s_w_0 = req->src_rect.w - s_w_1; s_x_1 = s_x_0 + s_w_0; if (d_w_1 >= 8 * s_w_1) { s_w_1++; s_x_1--; } } splitreq.src_rect.h = s_h_0; splitreq.src_rect.y = s_y_0; splitreq.dst_rect.h = d_h_0; splitreq.dst_rect.y = d_y_0; splitreq.src_rect.x = s_x_0; splitreq.src_rect.w = s_w_0; splitreq.dst_rect.x = d_x_0; splitreq.dst_rect.w = d_w_0; } else { if (splitreq.flags & MDP_ROT_90) { s_x_0 = s_x_1 = req->src_rect.x; s_w_0 = s_w_1 = req->src_rect.w; s_y_0 = req->src_rect.y; s_h_1 = (req->src_rect.h * d_w_0) / req->dst_rect.w; s_h_0 = req->src_rect.h - s_h_1; s_y_1 = s_y_0 + s_h_0; if (d_w_0 >= 8 * s_h_1) { s_h_1++; s_y_1--; } } else { s_y_0 = s_y_1 = req->src_rect.y; s_h_0 = s_h_1 = req->src_rect.h; s_x_0 = req->src_rect.x; s_w_1 = (req->src_rect.w * d_w_0) / req->dst_rect.w; s_w_0 = req->src_rect.w - s_w_1; s_x_1 = s_x_0 + s_w_0; if (d_w_0 >= 8 * s_w_1) { s_w_1++; s_x_1--; } } splitreq.src_rect.h = s_h_0; splitreq.src_rect.y = s_y_0; splitreq.dst_rect.h = d_h_1; splitreq.dst_rect.y = d_y_1; splitreq.src_rect.x = s_x_0; splitreq.src_rect.w = s_w_0; splitreq.dst_rect.x = d_x_1; splitreq.dst_rect.w = d_w_1; } if ((splitreq.dst_rect.h % 32 == 3) || ((req->dst_rect.h % 32) == 1 && req->dst_rect.h != 1) || ((req->dst_rect.h % 32) == 2 && req->dst_rect.h != 2)) ret = mdp_blit_split_height(info, &splitreq); else ret = mdp_ppp_blit(info, &splitreq); if (ret) return ret; /* blit second region */ if (((splitreq.flags & 0x07) == 0x07) || ((splitreq.flags & 0x07) == 0x0)) { splitreq.src_rect.h = s_h_1; splitreq.src_rect.y = s_y_1; splitreq.dst_rect.h = d_h_1; splitreq.dst_rect.y = d_y_1; splitreq.src_rect.x = s_x_1; splitreq.src_rect.w = s_w_1; splitreq.dst_rect.x = d_x_1; splitreq.dst_rect.w = d_w_1; } else { splitreq.src_rect.h = s_h_1; splitreq.src_rect.y = s_y_1; splitreq.dst_rect.h = d_h_0; splitreq.dst_rect.y = d_y_0; splitreq.src_rect.x = s_x_1; splitreq.src_rect.w = s_w_1; splitreq.dst_rect.x = d_x_0; splitreq.dst_rect.w = d_w_0; } if (((splitreq.dst_rect.h % 32) == 3) || ((req->dst_rect.h % 32) == 1 && req->dst_rect.h != 1) || ((req->dst_rect.h % 32) == 2 && req->dst_rect.h != 2)) ret = mdp_blit_split_height(info, &splitreq); else ret = mdp_ppp_blit(info, &splitreq); if (ret) return ret; } else if ((req->dst_rect.h % 32) == 3 || ((req->dst_rect.h % 32) == 1 && req->dst_rect.h != 1) || ((req->dst_rect.h % 32) == 2 && req->dst_rect.h != 2)) ret = mdp_blit_split_height(info, req); else ret = mdp_ppp_blit(info, req); return ret; #elif defined CONFIG_FB_MSM_MDP30 /* MDP width split workaround */ remainder = (req->dst_rect.w)%16; ret = mdp_get_bytes_per_pixel(req->dst.format, (struct msm_fb_data_type *)info->par); if (ret <= 0) { printk(KERN_ERR "mdp_ppp: incorrect bpp!\n"); return -EINVAL; } is_bpp_4 = (ret == 4) ? 1 : 0; if ((is_bpp_4 && (remainder == 6 || remainder == 14))) { /* make new request as provide by user */ splitreq = *req; /* break dest roi at width*/ d_y_0 = d_y_1 = req->dst_rect.y; d_h_0 = d_h_1 = req->dst_rect.h; d_x_0 = req->dst_rect.x; if (remainder == 14 || remainder == 6) d_w_1 = req->dst_rect.w / 2; else d_w_1 = (req->dst_rect.w - 1) / 2 - 1; d_w_0 = req->dst_rect.w - d_w_1; d_x_1 = d_x_0 + d_w_0; /* blit first region */ if (((splitreq.flags & 0x07) == 0x07) || ((splitreq.flags & 0x07) == 0x05) || ((splitreq.flags & 0x07) == 0x02) || ((splitreq.flags & 0x07) == 0x0)) { if (splitreq.flags & MDP_ROT_90) { s_x_0 = s_x_1 = req->src_rect.x; s_w_0 = s_w_1 = req->src_rect.w; s_y_0 = req->src_rect.y; s_h_1 = (req->src_rect.h * d_w_1) / req->dst_rect.w; s_h_0 = req->src_rect.h - s_h_1; s_y_1 = s_y_0 + s_h_0; if (d_w_1 >= 8 * s_h_1) { s_h_1++; s_y_1--; } } else { s_y_0 = s_y_1 = req->src_rect.y; s_h_0 = s_h_1 = req->src_rect.h; s_x_0 = req->src_rect.x; s_w_1 = (req->src_rect.w * d_w_1) / req->dst_rect.w; s_w_0 = req->src_rect.w - s_w_1; s_x_1 = s_x_0 + s_w_0; if (d_w_1 >= 8 * s_w_1) { s_w_1++; s_x_1--; } } splitreq.src_rect.h = s_h_0; splitreq.src_rect.y = s_y_0; splitreq.dst_rect.h = d_h_0; splitreq.dst_rect.y = d_y_0; splitreq.src_rect.x = s_x_0; splitreq.src_rect.w = s_w_0; splitreq.dst_rect.x = d_x_0; splitreq.dst_rect.w = d_w_0; } else { if (splitreq.flags & MDP_ROT_90) { s_x_0 = s_x_1 = req->src_rect.x; s_w_0 = s_w_1 = req->src_rect.w; s_y_0 = req->src_rect.y; s_h_1 = (req->src_rect.h * d_w_0) / req->dst_rect.w; s_h_0 = req->src_rect.h - s_h_1; s_y_1 = s_y_0 + s_h_0; if (d_w_0 >= 8 * s_h_1) { s_h_1++; s_y_1--; } } else { s_y_0 = s_y_1 = req->src_rect.y; s_h_0 = s_h_1 = req->src_rect.h; s_x_0 = req->src_rect.x; s_w_1 = (req->src_rect.w * d_w_0) / req->dst_rect.w; s_w_0 = req->src_rect.w - s_w_1; s_x_1 = s_x_0 + s_w_0; if (d_w_0 >= 8 * s_w_1) { s_w_1++; s_x_1--; } } splitreq.src_rect.h = s_h_0; splitreq.src_rect.y = s_y_0; splitreq.dst_rect.h = d_h_1; splitreq.dst_rect.y = d_y_1; splitreq.src_rect.x = s_x_0; splitreq.src_rect.w = s_w_0; splitreq.dst_rect.x = d_x_1; splitreq.dst_rect.w = d_w_1; } /* No need to split in height */ ret = mdp_ppp_blit(info, &splitreq); if (ret) return ret; /* blit second region */ if (((splitreq.flags & 0x07) == 0x07) || ((splitreq.flags & 0x07) == 0x05) || ((splitreq.flags & 0x07) == 0x02) || ((splitreq.flags & 0x07) == 0x0)) { splitreq.src_rect.h = s_h_1; splitreq.src_rect.y = s_y_1; splitreq.dst_rect.h = d_h_1; splitreq.dst_rect.y = d_y_1; splitreq.src_rect.x = s_x_1; splitreq.src_rect.w = s_w_1; splitreq.dst_rect.x = d_x_1; splitreq.dst_rect.w = d_w_1; } else { splitreq.src_rect.h = s_h_1; splitreq.src_rect.y = s_y_1; splitreq.dst_rect.h = d_h_0; splitreq.dst_rect.y = d_y_0; splitreq.src_rect.x = s_x_1; splitreq.src_rect.w = s_w_1; splitreq.dst_rect.x = d_x_0; splitreq.dst_rect.w = d_w_0; } /* No need to split in height ... just width */ ret = mdp_ppp_blit(info, &splitreq); if (ret) return ret; } else ret = mdp_ppp_blit(info, req); return ret; #else ret = mdp_ppp_blit(info, req); return ret; #endif } typedef void (*msm_dma_barrier_function_pointer) (void *, size_t); static inline void msm_fb_dma_barrier_for_rect(struct fb_info *info, struct mdp_img *img, struct mdp_rect *rect, msm_dma_barrier_function_pointer dma_barrier_fp ) { /* * Compute the start and end addresses of the rectangles. * NOTE: As currently implemented, the data between * the end of one row and the start of the next is * included in the address range rather than * doing multiple calls for each row. */ unsigned long start; size_t size; char * const pmem_start = info->screen_base; int bytes_per_pixel = mdp_get_bytes_per_pixel(img->format, (struct msm_fb_data_type *)info->par); if (bytes_per_pixel <= 0) { printk(KERN_ERR "%s incorrect bpp!\n", __func__); return; } start = (unsigned long)pmem_start + img->offset + (img->width * rect->y + rect->x) * bytes_per_pixel; size = (rect->h * img->width + rect->w) * bytes_per_pixel; (*dma_barrier_fp) ((void *) start, size); } static inline void msm_dma_nc_pre(void) { dmb(); } static inline void msm_dma_wt_pre(void) { dmb(); } static inline void msm_dma_todevice_wb_pre(void *start, size_t size) { dma_cache_pre_ops(start, size, DMA_TO_DEVICE); } static inline void msm_dma_fromdevice_wb_pre(void *start, size_t size) { dma_cache_pre_ops(start, size, DMA_FROM_DEVICE); } static inline void msm_dma_nc_post(void) { dmb(); } static inline void msm_dma_fromdevice_wt_post(void *start, size_t size) { dma_cache_post_ops(start, size, DMA_FROM_DEVICE); } static inline void msm_dma_todevice_wb_post(void *start, size_t size) { dma_cache_post_ops(start, size, DMA_TO_DEVICE); } static inline void msm_dma_fromdevice_wb_post(void *start, size_t size) { dma_cache_post_ops(start, size, DMA_FROM_DEVICE); } /* * Do the write barriers required to guarantee data is committed to RAM * (from CPU cache or internal buffers) before a DMA operation starts. * NOTE: As currently implemented, the data between * the end of one row and the start of the next is * included in the address range rather than * doing multiple calls for each row. */ static void msm_fb_ensure_memory_coherency_before_dma(struct fb_info *info, struct mdp_blit_req *req_list, int req_list_count) { #ifdef CONFIG_ARCH_QSD8X50 int i; /* * Normally, do the requested barriers for each address * range that corresponds to a rectangle. * * But if at least one write barrier is requested for data * going to or from the device but no address range is * needed for that barrier, then do the barrier, but do it * only once, no matter how many requests there are. */ struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; switch (mfd->mdp_fb_page_protection) { default: case MDP_FB_PAGE_PROTECTION_NONCACHED: case MDP_FB_PAGE_PROTECTION_WRITECOMBINE: /* * The following barrier is only done at most once, * since further calls would be redundant. */ for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_DMA_BARRIER_START)) { msm_dma_nc_pre(); break; } } break; case MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE: /* * The following barrier is only done at most once, * since further calls would be redundant. */ for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_DMA_BARRIER_START)) { msm_dma_wt_pre(); break; } } break; case MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE: case MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE: for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_DMA_BARRIER_START)) { msm_fb_dma_barrier_for_rect(info, &(req_list[i].src), &(req_list[i].src_rect), msm_dma_todevice_wb_pre ); msm_fb_dma_barrier_for_rect(info, &(req_list[i].dst), &(req_list[i].dst_rect), msm_dma_todevice_wb_pre ); } } break; } #else dmb(); #endif } /* * Do the write barriers required to guarantee data will be re-read from RAM by * the CPU after a DMA operation ends. * NOTE: As currently implemented, the data between * the end of one row and the start of the next is * included in the address range rather than * doing multiple calls for each row. */ static void msm_fb_ensure_memory_coherency_after_dma(struct fb_info *info, struct mdp_blit_req *req_list, int req_list_count) { #ifdef CONFIG_ARCH_QSD8X50 int i; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; switch (mfd->mdp_fb_page_protection) { default: case MDP_FB_PAGE_PROTECTION_NONCACHED: case MDP_FB_PAGE_PROTECTION_WRITECOMBINE: /* * The following barrier is only done at most once, * since further calls would be redundant. */ for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_DMA_BARRIER_END)) { msm_dma_nc_post(); break; } } break; case MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE: for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_DMA_BARRIER_END)) { msm_fb_dma_barrier_for_rect(info, &(req_list[i].dst), &(req_list[i].dst_rect), msm_dma_fromdevice_wt_post ); } } break; case MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE: case MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE: for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_DMA_BARRIER_END)) { msm_fb_dma_barrier_for_rect(info, &(req_list[i].dst), &(req_list[i].dst_rect), msm_dma_fromdevice_wb_post ); } } break; } #else dmb(); #endif } /* * NOTE: The userspace issues blit operations in a sequence, the sequence * start with a operation marked START and ends in an operation marked * END. It is guranteed by the userspace that all the blit operations * between START and END are only within the regions of areas designated * by the START and END operations and that the userspace doesnt modify * those areas. Hence it would be enough to perform barrier/cache operations * only on the START and END operations. */ static int msmfb_blit(struct fb_info *info, void __user *p) { /* * CAUTION: The names of the struct types intentionally *DON'T* match * the names of the variables declared -- they appear to be swapped. * Read the code carefully and you should see that the variable names * make sense. */ const int MAX_LIST_WINDOW = 16; struct mdp_blit_req req_list[MAX_LIST_WINDOW]; struct mdp_blit_req_list req_list_header; int count, i, req_list_count; if (bf_supported && (info->node == 1 || info->node == 2)) { pr_err("%s: no pan display for fb%d.", __func__, info->node); return -EPERM; } /* Get the count size for the total BLIT request. */ if (copy_from_user(&req_list_header, p, sizeof(req_list_header))) return -EFAULT; p += sizeof(req_list_header); count = req_list_header.count; if (count < 0 || count >= MAX_BLIT_REQ) return -EINVAL; while (count > 0) { /* * Access the requests through a narrow window to decrease copy * overhead and make larger requests accessible to the * coherency management code. * NOTE: The window size is intended to be larger than the * typical request size, but not require more than 2 * kbytes of stack storage. */ req_list_count = count; if (req_list_count > MAX_LIST_WINDOW) req_list_count = MAX_LIST_WINDOW; if (copy_from_user(&req_list, p, sizeof(struct mdp_blit_req)*req_list_count)) return -EFAULT; /* * Ensure that any data CPU may have previously written to * internal state (but not yet committed to memory) is * guaranteed to be committed to memory now. */ msm_fb_ensure_memory_coherency_before_dma(info, req_list, req_list_count); /* * Do the blit DMA, if required -- returning early only if * there is a failure. */ for (i = 0; i < req_list_count; i++) { if (!(req_list[i].flags & MDP_NO_BLIT)) { /* Do the actual blit. */ int ret = mdp_blit(info, &(req_list[i])); /* * Note that early returns don't guarantee * memory coherency. */ if (ret) return ret; } } /* * Ensure that CPU cache and other internal CPU state is * updated to reflect any change in memory modified by MDP blit * DMA. */ msm_fb_ensure_memory_coherency_after_dma(info, req_list, req_list_count); /* Go to next window of requests. */ count -= req_list_count; p += sizeof(struct mdp_blit_req)*req_list_count; } return 0; } static int msmfb_vsync_ctrl(struct fb_info *info, void __user *argp) { int enable, ret; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; ret = copy_from_user(&enable, argp, sizeof(enable)); if (ret) { pr_err("%s:msmfb_overlay_vsync ioctl failed", __func__); return ret; } if (mfd->vsync_ctrl) mfd->vsync_ctrl(enable); else { pr_err("%s: Vsync IOCTL not supported", __func__); return -EINVAL; } return 0; } #ifdef CONFIG_FB_MSM_OVERLAY static int msmfb_overlay_get(struct fb_info *info, void __user *p) { struct mdp_overlay req; int ret; if (copy_from_user(&req, p, sizeof(req))) return -EFAULT; ret = mdp4_overlay_get(info, &req); if (ret) { printk(KERN_ERR "%s: ioctl failed \n", __func__); return ret; } if (copy_to_user(p, &req, sizeof(req))) { printk(KERN_ERR "%s: copy2user failed \n", __func__); return -EFAULT; } return 0; } static int msmfb_overlay_set(struct fb_info *info, void __user *p) { struct mdp_overlay req; int ret; if (copy_from_user(&req, p, sizeof(req))) return -EFAULT; ret = mdp4_overlay_set(info, &req); if (ret) { printk(KERN_ERR "%s: ioctl failed, rc=%d\n", __func__, ret); return ret; } if (copy_to_user(p, &req, sizeof(req))) { printk(KERN_ERR "%s: copy2user failed \n", __func__); return -EFAULT; } return 0; } static int msmfb_overlay_unset(struct fb_info *info, unsigned long *argp) { int ret, ndx; ret = copy_from_user(&ndx, argp, sizeof(ndx)); if (ret) { printk(KERN_ERR "%s:msmfb_overlay_unset ioctl failed \n", __func__); return ret; } return mdp4_overlay_unset(info, ndx); } static int msmfb_overlay_vsync_ctrl(struct fb_info *info, void __user *argp) { int ret; int enable; ret = copy_from_user(&enable, argp, sizeof(enable)); if (ret) { pr_err("%s:msmfb_overlay_vsync ioctl failed", __func__); return ret; } ret = mdp4_overlay_vsync_ctrl(info, enable); return ret; } static int msmfb_overlay_play_wait(struct fb_info *info, unsigned long *argp) { int ret; struct msmfb_overlay_data req; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; if (mfd->overlay_play_enable == 0) /* nothing to do */ return 0; ret = copy_from_user(&req, argp, sizeof(req)); if (ret) { pr_err("%s:msmfb_overlay_wait ioctl failed", __func__); return ret; } ret = mdp4_overlay_play_wait(info, &req); return ret; } static int msmfb_overlay_play(struct fb_info *info, unsigned long *argp) { int ret; struct msmfb_overlay_data req; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; struct msm_fb_panel_data *pdata; if (mfd->overlay_play_enable == 0) /* nothing to do */ return 0; ret = copy_from_user(&req, argp, sizeof(req)); if (ret) { printk(KERN_ERR "%s:msmfb_overlay_play ioctl failed \n", __func__); return ret; } if (info->node == 0 && !(mfd->cont_splash_done)) { /* primary */ mdp_set_dma_pan_info(info, NULL, TRUE); if (msm_fb_blank_sub(FB_BLANK_UNBLANK, info, mfd->op_enable)) { pr_err("%s: can't turn on display!\n", __func__); return -EINVAL; } } if (!mfd->panel_power_on) /* suspended */ return -EPERM; complete(&mfd->msmfb_update_notify); mutex_lock(&msm_fb_notify_update_sem); if (mfd->msmfb_no_update_notify_timer.function) del_timer(&mfd->msmfb_no_update_notify_timer); mfd->msmfb_no_update_notify_timer.expires = jiffies + (2 * HZ); add_timer(&mfd->msmfb_no_update_notify_timer); mutex_unlock(&msm_fb_notify_update_sem); ret = mdp4_overlay_play(info, &req); if (unset_bl_level && !bl_updated) { pdata = (struct msm_fb_panel_data *)mfd->pdev-> dev.platform_data; if ((pdata) && (pdata->set_backlight)) { down(&mfd->sem); mfd->bl_level = unset_bl_level; pdata->set_backlight(mfd); bl_level_old = unset_bl_level; up(&mfd->sem); bl_updated = 1; } } return ret; } static int msmfb_overlay_play_enable(struct fb_info *info, unsigned long *argp) { int ret, enable; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; ret = copy_from_user(&enable, argp, sizeof(enable)); if (ret) { printk(KERN_ERR "%s:msmfb_overlay_play_enable ioctl failed \n", __func__); return ret; } mfd->overlay_play_enable = enable; return 0; } static int msmfb_overlay_blt(struct fb_info *info, unsigned long *argp) { int ret; struct msmfb_overlay_blt req; ret = copy_from_user(&req, argp, sizeof(req)); if (ret) { pr_err("%s: failed\n", __func__); return ret; } ret = mdp4_overlay_blt(info, &req); return ret; } #ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL static int msmfb_overlay_ioctl_writeback_init(struct fb_info *info) { return mdp4_writeback_init(info); } static int msmfb_overlay_ioctl_writeback_start( struct fb_info *info) { int ret = 0; ret = mdp4_writeback_start(info); if (ret) goto error; error: if (ret) pr_err("%s:msmfb_writeback_start " " ioctl failed\n", __func__); return ret; } static int msmfb_overlay_ioctl_writeback_stop( struct fb_info *info) { int ret = 0; ret = mdp4_writeback_stop(info); if (ret) goto error; error: if (ret) pr_err("%s:msmfb_writeback_stop ioctl failed\n", __func__); return ret; } static int msmfb_overlay_ioctl_writeback_queue_buffer( struct fb_info *info, unsigned long *argp) { int ret = 0; struct msmfb_data data; ret = copy_from_user(&data, argp, sizeof(data)); if (ret) goto error; ret = mdp4_writeback_queue_buffer(info, &data); if (ret) goto error; error: if (ret) pr_err("%s:msmfb_writeback_queue_buffer ioctl failed\n", __func__); return ret; } static int msmfb_overlay_ioctl_writeback_dequeue_buffer( struct fb_info *info, unsigned long *argp) { int ret = 0; struct msmfb_data data; ret = copy_from_user(&data, argp, sizeof(data)); if (ret) goto error; ret = mdp4_writeback_dequeue_buffer(info, &data); if (ret) goto error; ret = copy_to_user(argp, &data, sizeof(data)); if (ret) goto error; error: if (ret) pr_err("%s:msmfb_writeback_dequeue_buffer ioctl failed\n", __func__); return ret; } static int msmfb_overlay_ioctl_writeback_terminate(struct fb_info *info) { return mdp4_writeback_terminate(info); } static int msmfb_overlay_ioctl_writeback_set_mirr_hint(struct fb_info * info, void *argp) { int ret = 0, hint; if (!info) { ret = -EINVAL; goto error; } ret = copy_from_user(&hint, argp, sizeof(hint)); if (ret) goto error; ret = mdp4_writeback_set_mirroring_hint(info, hint); if (ret) goto error; error: if (ret) pr_err("%s: ioctl failed\n", __func__); return ret; } #else static int msmfb_overlay_ioctl_writeback_init(struct fb_info *info) { return -ENOTSUPP; } static int msmfb_overlay_ioctl_writeback_start( struct fb_info *info) { return -ENOTSUPP; } static int msmfb_overlay_ioctl_writeback_stop( struct fb_info *info) { return -ENOTSUPP; } static int msmfb_overlay_ioctl_writeback_queue_buffer( struct fb_info *info, unsigned long *argp) { return -ENOTSUPP; } static int msmfb_overlay_ioctl_writeback_dequeue_buffer( struct fb_info *info, unsigned long *argp) { return -ENOTSUPP; } static int msmfb_overlay_ioctl_writeback_terminate(struct fb_info *info) { return -ENOTSUPP; } static int msmfb_overlay_ioctl_writeback_set_mirr_hint(struct fb_info * info, void *argp) { return -ENOTSUPP; } #endif static int msmfb_overlay_3d_sbys(struct fb_info *info, unsigned long *argp) { int ret; struct msmfb_overlay_3d req; ret = copy_from_user(&req, argp, sizeof(req)); if (ret) { pr_err("%s:msmfb_overlay_3d_ctrl ioctl failed\n", __func__); return ret; } ret = mdp4_overlay_3d_sbys(info, &req); return ret; } static int msmfb_mixer_info(struct fb_info *info, unsigned long *argp) { int ret, cnt; struct msmfb_mixer_info_req req; ret = copy_from_user(&req, argp, sizeof(req)); if (ret) { pr_err("%s: failed\n", __func__); return ret; } cnt = mdp4_mixer_info(req.mixer_num, req.info); req.cnt = cnt; ret = copy_to_user(argp, &req, sizeof(req)); if (ret) pr_err("%s:msmfb_overlay_blt_off ioctl failed\n", __func__); return cnt; } #endif DEFINE_SEMAPHORE(msm_fb_ioctl_ppp_sem); DEFINE_MUTEX(msm_fb_ioctl_lut_sem); /* Set color conversion matrix from user space */ #ifndef CONFIG_FB_MSM_MDP40 static void msmfb_set_color_conv(struct mdp_ccs *p) { int i; if (p->direction == MDP_CCS_RGB2YUV) { /* MDP cmd block enable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); /* RGB->YUV primary forward matrix */ for (i = 0; i < MDP_CCS_SIZE; i++) writel(p->ccs[i], MDP_CSC_PFMVn(i)); #ifdef CONFIG_FB_MSM_MDP31 for (i = 0; i < MDP_BV_SIZE; i++) writel(p->bv[i], MDP_CSC_POST_BV2n(i)); #endif /* MDP cmd block disable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); } else { /* MDP cmd block enable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); /* YUV->RGB primary reverse matrix */ for (i = 0; i < MDP_CCS_SIZE; i++) writel(p->ccs[i], MDP_CSC_PRMVn(i)); for (i = 0; i < MDP_BV_SIZE; i++) writel(p->bv[i], MDP_CSC_PRE_BV1n(i)); /* MDP cmd block disable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); } } #else static void msmfb_set_color_conv(struct mdp_csc *p) { mdp4_vg_csc_update(p); } #endif static int msmfb_notify_update(struct fb_info *info, unsigned long *argp) { int ret, notify; struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; ret = copy_from_user(&notify, argp, sizeof(int)); if (ret) { pr_err("%s:ioctl failed\n", __func__); return ret; } if (notify > NOTIFY_UPDATE_STOP) return -EINVAL; if (notify == NOTIFY_UPDATE_START) { INIT_COMPLETION(mfd->msmfb_update_notify); ret = wait_for_completion_interruptible_timeout( &mfd->msmfb_update_notify, 4*HZ); } else { INIT_COMPLETION(mfd->msmfb_no_update_notify); ret = wait_for_completion_interruptible_timeout( &mfd->msmfb_no_update_notify, 4*HZ); } if (ret == 0) ret = -ETIMEDOUT; return (ret > 0) ? 0 : ret; } static int msmfb_handle_pp_ioctl(struct msm_fb_data_type *mfd, struct msmfb_mdp_pp *pp_ptr) { int ret = -1; #ifdef CONFIG_FB_MSM_MDP40 int i = 0; #endif if (!pp_ptr) return ret; switch (pp_ptr->op) { #ifdef CONFIG_FB_MSM_MDP40 case mdp_op_csc_cfg: ret = mdp4_csc_config(&(pp_ptr->data.csc_cfg_data)); for (i = 0; i < CSC_MAX_BLOCKS; i++) { if (pp_ptr->data.csc_cfg_data.block == csc_cfg_matrix[i].block) { memcpy(&csc_cfg_matrix[i].csc_data, &(pp_ptr->data.csc_cfg_data.csc_data), sizeof(struct mdp_csc_cfg)); break; } } break; case mdp_op_pcc_cfg: ret = mdp4_pcc_cfg(&(pp_ptr->data.pcc_cfg_data)); break; case mdp_op_lut_cfg: switch (pp_ptr->data.lut_cfg_data.lut_type) { case mdp_lut_igc: ret = mdp4_igc_lut_config( (struct mdp_igc_lut_data *) &pp_ptr->data.lut_cfg_data.data); break; case mdp_lut_pgc: ret = mdp4_argc_cfg( &pp_ptr->data.lut_cfg_data.data.pgc_lut_data); break; case mdp_lut_hist: ret = mdp_hist_lut_config( (struct mdp_hist_lut_data *) &pp_ptr->data.lut_cfg_data.data); break; default: break; } break; case mdp_op_qseed_cfg: ret = mdp4_qseed_cfg((struct mdp_qseed_cfg_data *) &pp_ptr->data.qseed_cfg_data); break; case mdp_op_calib_cfg: ret = mdp4_calib_config((struct mdp_calib_config_data *) &pp_ptr->data.calib_cfg); break; #endif case mdp_bl_scale_cfg: ret = mdp_bl_scale_config(mfd, (struct mdp_bl_scale_data *) &pp_ptr->data.bl_scale_data); break; default: pr_warn("Unsupported request to MDP_PP IOCTL.\n"); ret = -EINVAL; break; } return ret; } static int msmfb_handle_buf_sync_ioctl(struct msm_fb_data_type *mfd, struct mdp_buf_sync *buf_sync) { int i, ret = 0; u32 threshold; int acq_fen_fd[MDP_MAX_FENCE_FD]; struct sync_fence *fence; struct sync_pt *release_sync_pt; struct sync_pt *retire_sync_pt; struct sync_fence *release_fence; struct sync_fence *retire_fence; int release_fen_fd; int retire_fen_fd; if ((buf_sync->acq_fen_fd_cnt > MDP_MAX_FENCE_FD) || (mfd->timeline == NULL)) return -EINVAL; if ((!mfd->op_enable) || (!mfd->panel_power_on)) return -EPERM; if (buf_sync->acq_fen_fd_cnt) ret = copy_from_user(acq_fen_fd, buf_sync->acq_fen_fd, buf_sync->acq_fen_fd_cnt * sizeof(int)); if (ret) { pr_err("%s:copy_from_user failed", __func__); return ret; } mutex_lock(&mfd->sync_mutex); for (i = 0; i < buf_sync->acq_fen_fd_cnt; i++) { fence = sync_fence_fdget(acq_fen_fd[i]); if (fence == NULL) { pr_info("%s: null fence! i=%d fd=%d\n", __func__, i, acq_fen_fd[i]); ret = -EINVAL; break; } mfd->acq_fen[i] = fence; } mfd->acq_fen_cnt = i; if (ret) goto buf_sync_err_1; if (buf_sync->flags & MDP_BUF_SYNC_FLAG_WAIT) { msm_fb_wait_for_fence(mfd); } if ((mfd->panel.type == MIPI_CMD_PANEL) || (mfd->panel.type == WRITEBACK_PANEL)) threshold = 1; else threshold = 2; release_fen_fd = get_unused_fd_flags(0); if (release_fen_fd < 0) { pr_err("%s: get_unused_fd_flags failed", __func__); ret = -EIO; goto buf_sync_err_1; } retire_fen_fd = get_unused_fd_flags(0); if (retire_fen_fd < 0) { pr_err("%s: get_unused_fd_flags failed", __func__); ret = -EIO; goto buf_sync_err_2; } release_sync_pt = sw_sync_pt_create(mfd->timeline, mfd->timeline_value + threshold); release_fence = sync_fence_create("mdp-fence", release_sync_pt); sync_fence_install(release_fence, release_fen_fd); retire_sync_pt = sw_sync_pt_create(mfd->timeline, mfd->timeline_value + threshold); retire_fence = sync_fence_create("mdp-retire-fence", retire_sync_pt); sync_fence_install(retire_fence, retire_fen_fd); ret = copy_to_user(buf_sync->rel_fen_fd, &release_fen_fd, sizeof(int)); if (ret) { pr_err("%s:copy_to_user failed", __func__); goto buf_sync_err_3; } ret = copy_to_user(buf_sync->retire_fen_fd, &retire_fen_fd, sizeof(int)); if (ret) { pr_err("%s:copy_to_user failed", __func__); goto buf_sync_err_3; } mutex_unlock(&mfd->sync_mutex); return ret; buf_sync_err_3: sync_fence_put(release_fence); sync_fence_put(retire_fence); put_unused_fd(retire_fen_fd); buf_sync_err_2: put_unused_fd(release_fen_fd); buf_sync_err_1: for (i = 0; i < mfd->acq_fen_cnt; i++) sync_fence_put(mfd->acq_fen[i]); mfd->acq_fen_cnt = 0; mutex_unlock(&mfd->sync_mutex); return ret; } static int msmfb_display_commit(struct fb_info *info, unsigned long *argp) { int ret; struct mdp_display_commit disp_commit; ret = copy_from_user(&disp_commit, argp, sizeof(disp_commit)); if (ret) { pr_err("%s:copy_from_user failed", __func__); return ret; } ret = msm_fb_pan_display_ex(info, &disp_commit); return ret; } static int msmfb_get_metadata(struct msm_fb_data_type *mfd, struct msmfb_metadata *metadata_ptr) { int ret = 0; switch (metadata_ptr->op) { case metadata_op_frame_rate: metadata_ptr->data.panel_frame_rate = mdp_get_panel_framerate(mfd); break; default: pr_warn("Unsupported request to MDP META IOCTL.\n"); ret = -EINVAL; break; } return ret; } static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; void __user *argp = (void __user *)arg; struct fb_cursor cursor; struct fb_cmap cmap; struct mdp_histogram_data hist; struct mdp_histogram_start_req hist_req; uint32_t block; #ifndef CONFIG_FB_MSM_MDP40 struct mdp_ccs ccs_matrix; #else struct mdp_csc csc_matrix; #endif struct mdp_page_protection fb_page_protection; struct msmfb_mdp_pp mdp_pp; struct mdp_buf_sync buf_sync; struct msmfb_metadata mdp_metadata; int ret = 0; msm_fb_pan_idle(mfd); switch (cmd) { #ifdef CONFIG_FB_MSM_OVERLAY case MSMFB_OVERLAY_GET: ret = msmfb_overlay_get(info, argp); break; case MSMFB_OVERLAY_SET: ret = msmfb_overlay_set(info, argp); break; case MSMFB_OVERLAY_UNSET: ret = msmfb_overlay_unset(info, argp); break; case MSMFB_OVERLAY_PLAY: ret = msmfb_overlay_play(info, argp); break; case MSMFB_OVERLAY_PLAY_ENABLE: ret = msmfb_overlay_play_enable(info, argp); break; case MSMFB_OVERLAY_PLAY_WAIT: ret = msmfb_overlay_play_wait(info, argp); break; case MSMFB_OVERLAY_BLT: ret = msmfb_overlay_blt(info, argp); break; case MSMFB_OVERLAY_3D: ret = msmfb_overlay_3d_sbys(info, argp); break; case MSMFB_MIXER_INFO: ret = msmfb_mixer_info(info, argp); break; case MSMFB_WRITEBACK_INIT: ret = msmfb_overlay_ioctl_writeback_init(info); break; case MSMFB_WRITEBACK_START: ret = msmfb_overlay_ioctl_writeback_start( info); break; case MSMFB_WRITEBACK_STOP: ret = msmfb_overlay_ioctl_writeback_stop( info); break; case MSMFB_WRITEBACK_QUEUE_BUFFER: ret = msmfb_overlay_ioctl_writeback_queue_buffer( info, argp); break; case MSMFB_WRITEBACK_DEQUEUE_BUFFER: ret = msmfb_overlay_ioctl_writeback_dequeue_buffer( info, argp); break; case MSMFB_WRITEBACK_TERMINATE: ret = msmfb_overlay_ioctl_writeback_terminate(info); break; case MSMFB_WRITEBACK_SET_MIRRORING_HINT: ret = msmfb_overlay_ioctl_writeback_set_mirr_hint( info, argp); break; #endif case MSMFB_VSYNC_CTRL: case MSMFB_OVERLAY_VSYNC_CTRL: down(&msm_fb_ioctl_ppp_sem); if (mdp_rev >= MDP_REV_40) ret = msmfb_overlay_vsync_ctrl(info, argp); else ret = msmfb_vsync_ctrl(info, argp); up(&msm_fb_ioctl_ppp_sem); break; case MSMFB_BLIT: down(&msm_fb_ioctl_ppp_sem); ret = msmfb_blit(info, argp); up(&msm_fb_ioctl_ppp_sem); break; /* Ioctl for setting ccs matrix from user space */ case MSMFB_SET_CCS_MATRIX: #ifndef CONFIG_FB_MSM_MDP40 ret = copy_from_user(&ccs_matrix, argp, sizeof(ccs_matrix)); if (ret) { printk(KERN_ERR "%s:MSMFB_SET_CCS_MATRIX ioctl failed \n", __func__); return ret; } down(&msm_fb_ioctl_ppp_sem); if (ccs_matrix.direction == MDP_CCS_RGB2YUV) mdp_ccs_rgb2yuv = ccs_matrix; else mdp_ccs_yuv2rgb = ccs_matrix; msmfb_set_color_conv(&ccs_matrix) ; up(&msm_fb_ioctl_ppp_sem); #else ret = copy_from_user(&csc_matrix, argp, sizeof(csc_matrix)); if (ret) { pr_err("%s:MSMFB_SET_CSC_MATRIX ioctl failed\n", __func__); return ret; } down(&msm_fb_ioctl_ppp_sem); msmfb_set_color_conv(&csc_matrix); up(&msm_fb_ioctl_ppp_sem); #endif break; /* Ioctl for getting ccs matrix to user space */ case MSMFB_GET_CCS_MATRIX: #ifndef CONFIG_FB_MSM_MDP40 ret = copy_from_user(&ccs_matrix, argp, sizeof(ccs_matrix)) ; if (ret) { printk(KERN_ERR "%s:MSMFB_GET_CCS_MATRIX ioctl failed \n", __func__); return ret; } down(&msm_fb_ioctl_ppp_sem); if (ccs_matrix.direction == MDP_CCS_RGB2YUV) ccs_matrix = mdp_ccs_rgb2yuv; else ccs_matrix = mdp_ccs_yuv2rgb; ret = copy_to_user(argp, &ccs_matrix, sizeof(ccs_matrix)); if (ret) { printk(KERN_ERR "%s:MSMFB_GET_CCS_MATRIX ioctl failed \n", __func__); return ret ; } up(&msm_fb_ioctl_ppp_sem); #else ret = -EINVAL; #endif break; case MSMFB_GRP_DISP: #ifdef CONFIG_FB_MSM_MDP22 { unsigned long grp_id; ret = copy_from_user(&grp_id, argp, sizeof(grp_id)); if (ret) return ret; mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); writel(grp_id, MDP_FULL_BYPASS_WORD43); mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); break; } #else return -EFAULT; #endif case MSMFB_SUSPEND_SW_REFRESHER: if (!mfd->panel_power_on) return -EPERM; mfd->sw_refreshing_enable = FALSE; ret = msm_fb_stop_sw_refresher(mfd); break; case MSMFB_RESUME_SW_REFRESHER: if (!mfd->panel_power_on) return -EPERM; mfd->sw_refreshing_enable = TRUE; ret = msm_fb_resume_sw_refresher(mfd); break; case MSMFB_CURSOR: ret = copy_from_user(&cursor, argp, sizeof(cursor)); if (ret) return ret; ret = msm_fb_cursor(info, &cursor); break; case MSMFB_SET_LUT: ret = copy_from_user(&cmap, argp, sizeof(cmap)); if (ret) return ret; mutex_lock(&msm_fb_ioctl_lut_sem); ret = msm_fb_set_lut(&cmap, info); mutex_unlock(&msm_fb_ioctl_lut_sem); break; case MSMFB_HISTOGRAM: if (!mfd->panel_power_on) return -EPERM; if (!mfd->do_histogram) return -ENODEV; ret = copy_from_user(&hist, argp, sizeof(hist)); if (ret) return ret; ret = mfd->do_histogram(info, &hist); break; case MSMFB_HISTOGRAM_START: if (!mfd->panel_power_on) return -EPERM; if (!mfd->start_histogram) return -ENODEV; ret = copy_from_user(&hist_req, argp, sizeof(hist_req)); if (ret) return ret; ret = mfd->start_histogram(&hist_req); break; case MSMFB_HISTOGRAM_STOP: if (!mfd->stop_histogram) return -ENODEV; ret = copy_from_user(&block, argp, sizeof(int)); if (ret) return ret; ret = mfd->stop_histogram(info, block); break; case MSMFB_GET_PAGE_PROTECTION: fb_page_protection.page_protection = mfd->mdp_fb_page_protection; ret = copy_to_user(argp, &fb_page_protection, sizeof(fb_page_protection)); if (ret) return ret; break; case MSMFB_NOTIFY_UPDATE: ret = msmfb_notify_update(info, argp); break; case MSMFB_SET_PAGE_PROTECTION: #if defined CONFIG_ARCH_QSD8X50 || defined CONFIG_ARCH_MSM8X60 ret = copy_from_user(&fb_page_protection, argp, sizeof(fb_page_protection)); if (ret) return ret; /* Validate the proposed page protection settings. */ switch (fb_page_protection.page_protection) { case MDP_FB_PAGE_PROTECTION_NONCACHED: case MDP_FB_PAGE_PROTECTION_WRITECOMBINE: case MDP_FB_PAGE_PROTECTION_WRITETHROUGHCACHE: /* Write-back cache (read allocate) */ case MDP_FB_PAGE_PROTECTION_WRITEBACKCACHE: /* Write-back cache (write allocate) */ case MDP_FB_PAGE_PROTECTION_WRITEBACKWACACHE: mfd->mdp_fb_page_protection = fb_page_protection.page_protection; break; default: ret = -EINVAL; break; } #else /* * Don't allow caching until 7k DMA cache operations are * available. */ ret = -EINVAL; #endif break; case MSMFB_MDP_PP: ret = copy_from_user(&mdp_pp, argp, sizeof(mdp_pp)); if (ret) return ret; ret = msmfb_handle_pp_ioctl(mfd, &mdp_pp); if (ret == 1) ret = copy_to_user(argp, &mdp_pp, sizeof(mdp_pp)); break; case MSMFB_BUFFER_SYNC: ret = copy_from_user(&buf_sync, argp, sizeof(buf_sync)); if (ret) return ret; ret = msmfb_handle_buf_sync_ioctl(mfd, &buf_sync); if (!ret) ret = copy_to_user(argp, &buf_sync, sizeof(buf_sync)); break; case MSMFB_DISPLAY_COMMIT: ret = msmfb_display_commit(info, argp); break; case MSMFB_METADATA_GET: ret = copy_from_user(&mdp_metadata, argp, sizeof(mdp_metadata)); if (ret) return ret; ret = msmfb_get_metadata(mfd, &mdp_metadata); if (!ret) ret = copy_to_user(argp, &mdp_metadata, sizeof(mdp_metadata)); break; default: MSM_FB_INFO("MDP: unknown ioctl (cmd=%x) received!\n", cmd); ret = -EINVAL; break; } return ret; } static int msm_fb_register_driver(void) { return platform_driver_register(&msm_fb_driver); } #ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL struct fb_info *msm_fb_get_writeback_fb(void) { int c = 0; for (c = 0; c < fbi_list_index; ++c) { struct msm_fb_data_type *mfd; mfd = (struct msm_fb_data_type *)fbi_list[c]->par; if (mfd->panel.type == WRITEBACK_PANEL) return fbi_list[c]; } return NULL; } EXPORT_SYMBOL(msm_fb_get_writeback_fb); int msm_fb_writeback_start(struct fb_info *info) { return mdp4_writeback_start(info); } EXPORT_SYMBOL(msm_fb_writeback_start); int msm_fb_writeback_queue_buffer(struct fb_info *info, struct msmfb_data *data) { return mdp4_writeback_queue_buffer(info, data); } EXPORT_SYMBOL(msm_fb_writeback_queue_buffer); int msm_fb_writeback_dequeue_buffer(struct fb_info *info, struct msmfb_data *data) { return mdp4_writeback_dequeue_buffer(info, data); } EXPORT_SYMBOL(msm_fb_writeback_dequeue_buffer); int msm_fb_writeback_stop(struct fb_info *info) { return mdp4_writeback_stop(info); } EXPORT_SYMBOL(msm_fb_writeback_stop); int msm_fb_writeback_init(struct fb_info *info) { return mdp4_writeback_init(info); } EXPORT_SYMBOL(msm_fb_writeback_init); int msm_fb_writeback_terminate(struct fb_info *info) { return mdp4_writeback_terminate(info); } EXPORT_SYMBOL(msm_fb_writeback_terminate); #endif struct platform_device *msm_fb_add_device(struct platform_device *pdev) { struct msm_fb_panel_data *pdata; struct platform_device *this_dev = NULL; struct fb_info *fbi; struct msm_fb_data_type *mfd = NULL; u32 type, id, fb_num; if (!pdev) return NULL; id = pdev->id; pdata = pdev->dev.platform_data; if (!pdata) return NULL; type = pdata->panel_info.type; #if defined MSM_FB_NUM /* * over written fb_num which defined * at panel_info * */ if (type == HDMI_PANEL || type == DTV_PANEL || type == TV_PANEL || type == WRITEBACK_PANEL) { if (hdmi_prim_display) pdata->panel_info.fb_num = 2; else pdata->panel_info.fb_num = 1; } else pdata->panel_info.fb_num = MSM_FB_NUM; MSM_FB_INFO("setting pdata->panel_info.fb_num to %d. type: %d\n", pdata->panel_info.fb_num, type); #endif fb_num = pdata->panel_info.fb_num; if (fb_num <= 0) return NULL; if (fbi_list_index >= MAX_FBI_LIST) { printk(KERN_ERR "msm_fb: no more framebuffer info list!\n"); return NULL; } /* * alloc panel device data */ this_dev = msm_fb_device_alloc(pdata, type, id); if (!this_dev) { printk(KERN_ERR "%s: msm_fb_device_alloc failed!\n", __func__); return NULL; } /* * alloc framebuffer info + par data */ fbi = framebuffer_alloc(sizeof(struct msm_fb_data_type), NULL); if (fbi == NULL) { platform_device_put(this_dev); printk(KERN_ERR "msm_fb: can't alloca framebuffer info data!\n"); return NULL; } mfd = (struct msm_fb_data_type *)fbi->par; mfd->key = MFD_KEY; mfd->fbi = fbi; mfd->panel.type = type; mfd->panel.id = id; mfd->fb_page = fb_num; mfd->index = fbi_list_index; mfd->mdp_fb_page_protection = MDP_FB_PAGE_PROTECTION_WRITECOMBINE; mfd->iclient = iclient; /* link to the latest pdev */ mfd->pdev = this_dev; mfd->panel_pdev = pdev; mfd_list[mfd_list_index++] = mfd; fbi_list[fbi_list_index++] = fbi; /* * set driver data */ platform_set_drvdata(this_dev, mfd); if (platform_device_add(this_dev)) { printk(KERN_ERR "msm_fb: platform_device_add failed!\n"); platform_device_put(this_dev); framebuffer_release(fbi); fbi_list_index--; return NULL; } return this_dev; } EXPORT_SYMBOL(msm_fb_add_device); int get_fb_phys_info(unsigned long *start, unsigned long *len, int fb_num, int subsys_id) { struct fb_info *info; struct msm_fb_data_type *mfd; if (fb_num > MAX_FBI_LIST || (subsys_id != DISPLAY_SUBSYSTEM_ID && subsys_id != ROTATOR_SUBSYSTEM_ID)) { pr_err("%s(): Invalid parameters\n", __func__); return -1; } info = fbi_list[fb_num]; if (!info) { pr_err("%s(): info is NULL\n", __func__); return -1; } mfd = (struct msm_fb_data_type *)info->par; if (subsys_id == DISPLAY_SUBSYSTEM_ID) { if (mfd->display_iova) *start = mfd->display_iova; else *start = info->fix.smem_start; } else { if (mfd->rotator_iova) *start = mfd->rotator_iova; else *start = info->fix.smem_start; } *len = info->fix.smem_len; return 0; } EXPORT_SYMBOL(get_fb_phys_info); int __init msm_fb_init(void) { int rc = -ENODEV; if (msm_fb_register_driver()) return rc; #ifdef MSM_FB_ENABLE_DBGFS { struct dentry *root; if ((root = msm_fb_get_debugfs_root()) != NULL) { msm_fb_debugfs_file_create(root, "msm_fb_msg_printing_level", (u32 *) &msm_fb_msg_level); msm_fb_debugfs_file_create(root, "mddi_msg_printing_level", (u32 *) &mddi_msg_level); msm_fb_debugfs_file_create(root, "msm_fb_debug_enabled", (u32 *) &msm_fb_debug_enabled); } } #endif return 0; } /* * To implement "msm_fb_read" for screenshot such as DDMS" */ #ifdef CONFIG_LGE_DISP_FBREAD static ssize_t msm_fb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos) { unsigned long p = *ppos; u32 *buffer; u8 *dst; u8 __iomem *src; u8 r, g, b; int c, i, cnt = 0, err = 0; unsigned long total_size; int line_length, xres, bpp; total_size = info->screen_size; if (total_size == 0) total_size = info->fix.smem_len; if (p >= total_size) return 0; if (count >= total_size) count = total_size; if (count + p > total_size) count = total_size - p; buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL); if (!buffer) return -ENOMEM; src = (u8 __iomem *) (info->screen_base + p); xres = info->var.xres; line_length = ALIGN(xres, 32); bpp = info->var.bits_per_pixel/8; for (i = 0; i < count; i += 4) { c = 4; r = fb_readb(src++); g = fb_readb(src++); b = fb_readb(src++); src++; *ppos += c; if ((p+i)%(line_length*bpp) >= xres*bpp) continue; dst = (u8 *)buffer; *dst++ = r; *dst++ = g; *dst++ = b; *dst++ = 0xff; if (copy_to_user(buf, buffer, c)) { err = -EFAULT; break; } cnt += c; buf += c; } kfree(buffer); return (err) ? err : cnt; } #endif /* Called by v4l2 driver to enable/disable overlay pipe */ int msm_fb_v4l2_enable(struct mdp_overlay *req, bool enable, void **par) { int err = 0; #ifdef CONFIG_FB_MSM_MDP40 struct mdp4_overlay_pipe *pipe; if (enable) { err = mdp4_v4l2_overlay_set(fbi_list[0], req, &pipe); *(struct mdp4_overlay_pipe **)par = pipe; } else { pipe = *(struct mdp4_overlay_pipe **)par; mdp4_v4l2_overlay_clear(pipe); } #else #ifdef CONFIG_FB_MSM_MDP30 if (enable) err = mdp_ppp_v4l2_overlay_set(fbi_list[0], req); else err = mdp_ppp_v4l2_overlay_clear(); #else err = -EINVAL; #endif #endif return err; } EXPORT_SYMBOL(msm_fb_v4l2_enable); /* Called by v4l2 driver to provide a frame for display */ int msm_fb_v4l2_update(void *par, unsigned long srcp0_addr, unsigned long srcp0_size, unsigned long srcp1_addr, unsigned long srcp1_size, unsigned long srcp2_addr, unsigned long srcp2_size) { #ifdef CONFIG_FB_MSM_MDP40 struct mdp4_overlay_pipe *pipe = (struct mdp4_overlay_pipe *)par; return mdp4_v4l2_overlay_play(fbi_list[0], pipe, srcp0_addr, srcp1_addr, srcp2_addr); #else #ifdef CONFIG_FB_MSM_MDP30 return mdp_ppp_v4l2_overlay_play(fbi_list[0], srcp0_addr, srcp0_size, srcp1_addr, srcp1_size); #else return -EINVAL; #endif #endif } EXPORT_SYMBOL(msm_fb_v4l2_update); module_init(msm_fb_init);
gpl-2.0
Rodeo314/hb-saintdev
win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/ChapterMarker.cs
2905
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="ChapterMarker.cs" company="HandBrake Project (http://handbrake.fr)"> // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // </copyright> // <summary> // A Movie Chapter // </summary> // -------------------------------------------------------------------------------------------------------------------- namespace HandBrake.ApplicationServices.Services.Encode.Model.Models { using System; using HandBrake.ApplicationServices.Utilities; /// <summary> /// A Movie Chapter /// </summary> public class ChapterMarker : PropertyChangedBase { /// <summary> /// Backing field for chapter name /// </summary> private string chapterName; /// <summary> /// Initializes a new instance of the <see cref="ChapterMarker"/> class. /// </summary> public ChapterMarker() { } /// <summary> /// Initializes a new instance of the <see cref="ChapterMarker"/> class. /// </summary> /// <param name="number"> /// The number. /// </param> /// <param name="name"> /// The name. /// </param> /// <param name="duration"> /// The duration. /// </param> public ChapterMarker(int number, string name, TimeSpan duration) { this.ChapterName = name; this.ChapterNumber = number; this.Duration = duration; } /// <summary> /// Initializes a new instance of the <see cref="ChapterMarker"/> class. /// Copy Constructor /// </summary> /// <param name="chapter"> /// The chapter. /// </param> public ChapterMarker(ChapterMarker chapter) { this.ChapterName = chapter.ChapterName; this.ChapterNumber = chapter.ChapterNumber; this.Duration = chapter.Duration; } /// <summary> /// Gets or sets The number of this Chapter, in regards to it's parent Title /// </summary> public int ChapterNumber { get; set; } /// <summary> /// Gets or sets the duration. /// </summary> public TimeSpan Duration { get; set; } /// <summary> /// Gets or sets ChapterName. /// </summary> public string ChapterName { get { return this.chapterName; } set { this.chapterName = value; this.NotifyOfPropertyChange(() => this.ChapterName); } } } }
gpl-2.0
yclee/bbs
package/broadcom-wl/Makefile
5023
# # Copyright (C) 2006-2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=broadcom-wl PKG_VERSION:=4.150.10.5.3 PKG_RELEASE:=3.2 WLC_VERSION:=0.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources PKG_MD5SUM:=cc615fd49719eea8bce5b2a8813783f3 WL_WEXT=1 include $(INCLUDE_DIR)/package.mk define Package/broadcom-wl/Default SECTION:=kernel CATEGORY:=Kernel modules DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo SUBMENU:=Proprietary BCM43xx WiFi driver SUBMENUDEP:=@TARGET_brcm_2_4 endef define KernelPackage/brcm-wl/Default $(call Package/broadcom-wl/Default) SECTION:=kernel DEPENDS:=@TARGET_brcm_2_4 +wireless-tools TITLE:=Kernel driver for BCM43xx chipsets FILES:=$(PKG_BUILD_DIR)/driver/wl$(1).o AUTOLOAD:=$(call AutoLoad,30,wl$(1)) endef define KernelPackage/brcm-wl/Default/description This package contains the proprietary wireless driver for the Broadcom BCM43xx chipset. endef define KernelPackage/brcm-wl $(call KernelPackage/brcm-wl/Default,) TITLE+= (normal version) endef define KernelPackage/brcm-wl/description $(call KernelPackage/brcm-wl/Default/description) endef define KernelPackage/brcm-wl-mimo $(call KernelPackage/brcm-wl/Default,_mimo) TITLE+= (MIMO version) endef define KernelPackage/brcm-wl-mimo/description $(call KernelPackage/brcm-wl/Default/description) endef define KernelPackage/wlcompat/Default $(call KernelPackage/brcm-wl/Default,) TITLE:=Kernel driver for BCM43xx chipsets FILES:=$(PKG_BUILD_DIR)/wlcompat/wlcompat$(1).o endef define KernelPackage/wlcompat $(call KernelPackage/wlcompat/Default,) AUTOLOAD:=$(call AutoLoad,50,wlcompat) endef define KernelPackage/wlcompat/description This package contains a wrapper module, that provides Wireless Extension support for the proprietary Broadcom wl module. endef define KernelPackage/wlcompat-debug $(call KernelPackage/wlcompat/Default,-debug) TITLE+= (debug) AUTOLOAD:= endef define KernelPackage/wlcompat-debug/description $(call KernelPackage/wlcompat/description) This is the debugging version. endef define Package/wlc $(call Package/broadcom-wl/Default) TITLE:=wl driver setup utility endef define Package/wlc/description This package contains an utility for initializing the proprietary Broadcom wl driver. endef define Package/wl $(call Package/broadcom-wl/Default) DEPENDS+= +nvram TITLE:=Proprietary Broadcom wl driver config utility endef define Package/wl/description This package contains the proprietary utility (wl) for configuring the proprietary Broadcom wl driver. endef define Package/nas $(call Package/broadcom-wl/Default) DEPENDS+= +nvram TITLE:=Proprietary Broadcom WPA/WPA2 authenticator endef define Package/nas/description This package contains the proprietary WPA/WPA2 authenticator (nas) for the proprietary Broadcom wl driver. endef MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ ARCH="$(LINUX_KARCH)" \ PATH="$(TARGET_PATH)" \ SUBDIRS="$(PKG_BUILD_DIR)/kmod" define Build/Prepare $(call Build/Prepare/Default) $(CP) src/* $(PKG_BUILD_DIR)/ endef define Build/Compile # Compile the kernel part $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/driver" \ modules $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/driver" \ MOD_NAME="_mimo" \ modules $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/wlcompat" \ $(if $(WL_WEXT),WL_WEXT=1) \ modules $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/wlcompat" \ DEBUG=1 \ $(if $(WL_WEXT),WL_WEXT=1) \ modules # Compile wlc $(MAKE) -C $(PKG_BUILD_DIR)/wlc \ $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS)" \ all # Compile libshared $(MAKE) -C $(PKG_BUILD_DIR)/router/shared \ $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS) -I. -I$(PKG_BUILD_DIR)/include -Dlinux=1" \ all $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas $(PKG_BUILD_DIR)/nas_exe.o -L$(STAGING_DIR)/usr/lib -lnvram $(PKG_BUILD_DIR)/router/shared/libshared.a $(TARGET_CC) -o $(PKG_BUILD_DIR)/wl $(PKG_BUILD_DIR)/wl_exe.o endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_BUILD_DIR)/router/shared/libshared.a $(1)/usr/lib/ endef define Package/wlc/install $(CP) ./files/* $(1)/ $(INSTALL_DIR) $(1)/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/wlc/wlc $(1)/sbin/ endef define Package/wl/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/ endef define Package/nas/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/ ln -sf nas $(1)/usr/sbin/nas4not ln -sf nas $(1)/usr/sbin/nas4wds endef $(eval $(call KernelPackage,brcm-wl)) $(eval $(call KernelPackage,brcm-wl-mimo)) $(eval $(call KernelPackage,wlcompat)) $(eval $(call KernelPackage,wlcompat-debug)) $(eval $(call BuildPackage,wlc)) $(eval $(call BuildPackage,wl)) $(eval $(call BuildPackage,nas))
gpl-2.0
akohlmey/lammps
src/nstencil_half_multi_3d_tri.cpp
3559
// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #include "nstencil_half_multi_3d_tri.h" #include "neigh_list.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ NStencilHalfMulti3dTri::NStencilHalfMulti3dTri(LAMMPS *lmp) : NStencil(lmp) {} /* ---------------------------------------------------------------------- */ void NStencilHalfMulti3dTri::set_stencil_properties() { int n = ncollections; int i, j; // Cross collections: use full stencil, looking one way through hierarchy // smaller -> larger => use full stencil in larger bin // larger -> smaller => no nstencil required // If cut offs are same, use half stencil for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if(cutcollectionsq[i][i] > cutcollectionsq[j][j]) continue; flag_skip_multi[i][j] = false; if(cutcollectionsq[i][i] == cutcollectionsq[j][j]){ flag_half_multi[i][j] = true; bin_collection_multi[i][j] = i; } else { flag_half_multi[i][j] = false; bin_collection_multi[i][j] = j; } } } } /* ---------------------------------------------------------------------- create stencils based on bin geometry and cutoff ------------------------------------------------------------------------- */ void NStencilHalfMulti3dTri::create() { int icollection, jcollection, bin_collection, i, j, k, ns; int n = ncollections; double cutsq; for (icollection = 0; icollection < n; icollection++) { for (jcollection = 0; jcollection < n; jcollection++) { if (flag_skip_multi[icollection][jcollection]) { nstencil_multi[icollection][jcollection] = 0; continue; } ns = 0; sx = stencil_sx_multi[icollection][jcollection]; sy = stencil_sy_multi[icollection][jcollection]; sz = stencil_sz_multi[icollection][jcollection]; mbinx = stencil_mbinx_multi[icollection][jcollection]; mbiny = stencil_mbiny_multi[icollection][jcollection]; mbinz = stencil_mbinz_multi[icollection][jcollection]; bin_collection = bin_collection_multi[icollection][jcollection]; cutsq = cutcollectionsq[icollection][jcollection]; if (flag_half_multi[icollection][jcollection]) { for (k = 0; k <= sz; k++) for (j = -sy; j <= sy; j++) for (i = -sx; i <= sx; i++) if (bin_distance_multi(i,j,k,bin_collection) < cutsq) stencil_multi[icollection][jcollection][ns++] = k*mbiny*mbinx + j*mbinx + i; } else { for (k = -sz; k <= sz; k++) for (j = -sy; j <= sy; j++) for (i = -sx; i <= sx; i++) if (bin_distance_multi(i,j,k,bin_collection) < cutsq) stencil_multi[icollection][jcollection][ns++] = k*mbiny*mbinx + j*mbinx + i; } nstencil_multi[icollection][jcollection] = ns; } } }
gpl-2.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/include/mysql/sql_common.h
2067
/* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ extern const char *unknown_sqlstate; extern const char *cant_connect_sqlstate; extern const char *not_error_sqlstate; #ifdef __cplusplus extern "C" { #endif extern CHARSET_INFO *default_client_charset_info; MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc, uint fields, my_bool default_value, uint server_capabilities); void free_rows(MYSQL_DATA *cur); void free_old_query(MYSQL *mysql); void end_server(MYSQL *mysql); my_bool mysql_reconnect(MYSQL *mysql); void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group); my_bool cli_advanced_command(MYSQL *mysql, enum enum_server_command command, const unsigned char *header, ulong header_length, const unsigned char *arg, ulong arg_length, my_bool skip_check, MYSQL_STMT *stmt); unsigned long cli_safe_read(MYSQL *mysql); void net_clear_error(NET *net); void set_stmt_errmsg(MYSQL_STMT *stmt, NET *net); void set_stmt_error(MYSQL_STMT *stmt, int errcode, const char *sqlstate, const char *err); void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate); #ifdef __cplusplus } #endif #define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)
gpl-2.0
J-Liu/qemu
include/hw/xen/io/ring.h
24941
/****************************************************************************** * ring.h * * Shared producer-consumer ring macros. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Tim Deegan and Andrew Warfield November 2004. */ #ifndef __XEN_PUBLIC_IO_RING_H__ #define __XEN_PUBLIC_IO_RING_H__ /* * When #include'ing this header, you need to provide the following * declaration upfront: * - standard integers types (uint8_t, uint16_t, etc) * They are provided by stdint.h of the standard headers. * * In addition, if you intend to use the FLEX macros, you also need to * provide the following, before invoking the FLEX macros: * - size_t * - memcpy * - grant_ref_t * These declarations are provided by string.h of the standard headers, * and grant_table.h from the Xen public headers. */ #if __XEN_INTERFACE_VERSION__ < 0x00030208 #define xen_mb() mb() #define xen_rmb() rmb() #define xen_wmb() wmb() #endif typedef unsigned int RING_IDX; /* Round a 32-bit unsigned constant down to the nearest power of two. */ #define __RD2(_x) (((_x) & 0x00000002) ? 0x2 : ((_x) & 0x1)) #define __RD4(_x) (((_x) & 0x0000000c) ? __RD2((_x)>>2)<<2 : __RD2(_x)) #define __RD8(_x) (((_x) & 0x000000f0) ? __RD4((_x)>>4)<<4 : __RD4(_x)) #define __RD16(_x) (((_x) & 0x0000ff00) ? __RD8((_x)>>8)<<8 : __RD8(_x)) #define __RD32(_x) (((_x) & 0xffff0000) ? __RD16((_x)>>16)<<16 : __RD16(_x)) /* * Calculate size of a shared ring, given the total available space for the * ring and indexes (_sz), and the name tag of the request/response structure. * A ring contains as many entries as will fit, rounded down to the nearest * power of two (so we can mask with (size-1) to loop around). */ #define __CONST_RING_SIZE(_s, _sz) \ (__RD32(((_sz) - offsetof(struct _s##_sring, ring)) / \ sizeof(((struct _s##_sring *)0)->ring[0]))) /* * The same for passing in an actual pointer instead of a name tag. */ #define __RING_SIZE(_s, _sz) \ (__RD32(((_sz) - (long)(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) /* * Macros to make the correct C datatypes for a new kind of ring. * * To make a new ring datatype, you need to have two message structures, * let's say request_t, and response_t already defined. * * In a header where you want the ring datatype declared, you then do: * * DEFINE_RING_TYPES(mytag, request_t, response_t); * * These expand out to give you a set of types, as you can see below. * The most important of these are: * * mytag_sring_t - The shared ring. * mytag_front_ring_t - The 'front' half of the ring. * mytag_back_ring_t - The 'back' half of the ring. * * To initialize a ring in your code you need to know the location and size * of the shared memory area (PAGE_SIZE, for instance). To initialise * the front half: * * mytag_front_ring_t front_ring; * SHARED_RING_INIT((mytag_sring_t *)shared_page); * FRONT_RING_INIT(&front_ring, (mytag_sring_t *)shared_page, PAGE_SIZE); * * Initializing the back follows similarly (note that only the front * initializes the shared ring): * * mytag_back_ring_t back_ring; * BACK_RING_INIT(&back_ring, (mytag_sring_t *)shared_page, PAGE_SIZE); */ #define DEFINE_RING_TYPES(__name, __req_t, __rsp_t) \ \ /* Shared ring entry */ \ union __name##_sring_entry { \ __req_t req; \ __rsp_t rsp; \ }; \ \ /* Shared ring page */ \ struct __name##_sring { \ RING_IDX req_prod, req_event; \ RING_IDX rsp_prod, rsp_event; \ union { \ struct { \ uint8_t smartpoll_active; \ } netif; \ struct { \ uint8_t msg; \ } tapif_user; \ uint8_t pvt_pad[4]; \ } pvt; \ uint8_t __pad[44]; \ union __name##_sring_entry ring[1]; /* variable-length */ \ }; \ \ /* "Front" end's private variables */ \ struct __name##_front_ring { \ RING_IDX req_prod_pvt; \ RING_IDX rsp_cons; \ unsigned int nr_ents; \ struct __name##_sring *sring; \ }; \ \ /* "Back" end's private variables */ \ struct __name##_back_ring { \ RING_IDX rsp_prod_pvt; \ RING_IDX req_cons; \ unsigned int nr_ents; \ struct __name##_sring *sring; \ }; \ \ /* Syntactic sugar */ \ typedef struct __name##_sring __name##_sring_t; \ typedef struct __name##_front_ring __name##_front_ring_t; \ typedef struct __name##_back_ring __name##_back_ring_t /* * Macros for manipulating rings. * * FRONT_RING_whatever works on the "front end" of a ring: here * requests are pushed on to the ring and responses taken off it. * * BACK_RING_whatever works on the "back end" of a ring: here * requests are taken off the ring and responses put on. * * N.B. these macros do NO INTERLOCKS OR FLOW CONTROL. * This is OK in 1-for-1 request-response situations where the * requestor (front end) never has more than RING_SIZE()-1 * outstanding requests. */ /* Initialising empty rings */ #define SHARED_RING_INIT(_s) do { \ (_s)->req_prod = (_s)->rsp_prod = 0; \ (_s)->req_event = (_s)->rsp_event = 1; \ (void)memset((_s)->pvt.pvt_pad, 0, sizeof((_s)->pvt.pvt_pad)); \ (void)memset((_s)->__pad, 0, sizeof((_s)->__pad)); \ } while(0) #define FRONT_RING_INIT(_r, _s, __size) do { \ (_r)->req_prod_pvt = 0; \ (_r)->rsp_cons = 0; \ (_r)->nr_ents = __RING_SIZE(_s, __size); \ (_r)->sring = (_s); \ } while (0) #define BACK_RING_INIT(_r, _s, __size) do { \ (_r)->rsp_prod_pvt = 0; \ (_r)->req_cons = 0; \ (_r)->nr_ents = __RING_SIZE(_s, __size); \ (_r)->sring = (_s); \ } while (0) /* How big is this ring? */ #define RING_SIZE(_r) \ ((_r)->nr_ents) /* Number of free requests (for use on front side only). */ #define RING_FREE_REQUESTS(_r) \ (RING_SIZE(_r) - ((_r)->req_prod_pvt - (_r)->rsp_cons)) /* Test if there is an empty slot available on the front ring. * (This is only meaningful from the front. ) */ #define RING_FULL(_r) \ (RING_FREE_REQUESTS(_r) == 0) /* Test if there are outstanding messages to be processed on a ring. */ #define RING_HAS_UNCONSUMED_RESPONSES(_r) \ ((_r)->sring->rsp_prod - (_r)->rsp_cons) #ifdef __GNUC__ #define RING_HAS_UNCONSUMED_REQUESTS(_r) ({ \ unsigned int req = (_r)->sring->req_prod - (_r)->req_cons; \ unsigned int rsp = RING_SIZE(_r) - \ ((_r)->req_cons - (_r)->rsp_prod_pvt); \ req < rsp ? req : rsp; \ }) #else /* Same as above, but without the nice GCC ({ ... }) syntax. */ #define RING_HAS_UNCONSUMED_REQUESTS(_r) \ ((((_r)->sring->req_prod - (_r)->req_cons) < \ (RING_SIZE(_r) - ((_r)->req_cons - (_r)->rsp_prod_pvt))) ? \ ((_r)->sring->req_prod - (_r)->req_cons) : \ (RING_SIZE(_r) - ((_r)->req_cons - (_r)->rsp_prod_pvt))) #endif /* Direct access to individual ring elements, by index. */ #define RING_GET_REQUEST(_r, _idx) \ (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req)) /* * Get a local copy of a request. * * Use this in preference to RING_GET_REQUEST() so all processing is * done on a local copy that cannot be modified by the other end. * * Note that https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 may cause this * to be ineffective where _req is a struct which consists of only bitfields. */ #define RING_COPY_REQUEST(_r, _idx, _req) do { \ /* Use volatile to force the copy into _req. */ \ *(_req) = *(volatile typeof(_req))RING_GET_REQUEST(_r, _idx); \ } while (0) #define RING_GET_RESPONSE(_r, _idx) \ (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp)) /* Loop termination condition: Would the specified index overflow the ring? */ #define RING_REQUEST_CONS_OVERFLOW(_r, _cons) \ (((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r)) /* Ill-behaved frontend determination: Can there be this many requests? */ #define RING_REQUEST_PROD_OVERFLOW(_r, _prod) \ (((_prod) - (_r)->rsp_prod_pvt) > RING_SIZE(_r)) #define RING_PUSH_REQUESTS(_r) do { \ xen_wmb(); /* back sees requests /before/ updated producer index */ \ (_r)->sring->req_prod = (_r)->req_prod_pvt; \ } while (0) #define RING_PUSH_RESPONSES(_r) do { \ xen_wmb(); /* front sees resps /before/ updated producer index */ \ (_r)->sring->rsp_prod = (_r)->rsp_prod_pvt; \ } while (0) /* * Notification hold-off (req_event and rsp_event): * * When queueing requests or responses on a shared ring, it may not always be * necessary to notify the remote end. For example, if requests are in flight * in a backend, the front may be able to queue further requests without * notifying the back (if the back checks for new requests when it queues * responses). * * When enqueuing requests or responses: * * Use RING_PUSH_{REQUESTS,RESPONSES}_AND_CHECK_NOTIFY(). The second argument * is a boolean return value. True indicates that the receiver requires an * asynchronous notification. * * After dequeuing requests or responses (before sleeping the connection): * * Use RING_FINAL_CHECK_FOR_REQUESTS() or RING_FINAL_CHECK_FOR_RESPONSES(). * The second argument is a boolean return value. True indicates that there * are pending messages on the ring (i.e., the connection should not be put * to sleep). * * These macros will set the req_event/rsp_event field to trigger a * notification on the very next message that is enqueued. If you want to * create batches of work (i.e., only receive a notification after several * messages have been enqueued) then you will need to create a customised * version of the FINAL_CHECK macro in your own code, which sets the event * field appropriately. */ #define RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(_r, _notify) do { \ RING_IDX __old = (_r)->sring->req_prod; \ RING_IDX __new = (_r)->req_prod_pvt; \ xen_wmb(); /* back sees requests /before/ updated producer index */ \ (_r)->sring->req_prod = __new; \ xen_mb(); /* back sees new requests /before/ we check req_event */ \ (_notify) = ((RING_IDX)(__new - (_r)->sring->req_event) < \ (RING_IDX)(__new - __old)); \ } while (0) #define RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(_r, _notify) do { \ RING_IDX __old = (_r)->sring->rsp_prod; \ RING_IDX __new = (_r)->rsp_prod_pvt; \ xen_wmb(); /* front sees resps /before/ updated producer index */ \ (_r)->sring->rsp_prod = __new; \ xen_mb(); /* front sees new resps /before/ we check rsp_event */ \ (_notify) = ((RING_IDX)(__new - (_r)->sring->rsp_event) < \ (RING_IDX)(__new - __old)); \ } while (0) #define RING_FINAL_CHECK_FOR_REQUESTS(_r, _work_to_do) do { \ (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ if (_work_to_do) break; \ (_r)->sring->req_event = (_r)->req_cons + 1; \ xen_mb(); \ (_work_to_do) = RING_HAS_UNCONSUMED_REQUESTS(_r); \ } while (0) #define RING_FINAL_CHECK_FOR_RESPONSES(_r, _work_to_do) do { \ (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ if (_work_to_do) break; \ (_r)->sring->rsp_event = (_r)->rsp_cons + 1; \ xen_mb(); \ (_work_to_do) = RING_HAS_UNCONSUMED_RESPONSES(_r); \ } while (0) /* * DEFINE_XEN_FLEX_RING_AND_INTF defines two monodirectional rings and * functions to check if there is data on the ring, and to read and * write to them. * * DEFINE_XEN_FLEX_RING is similar to DEFINE_XEN_FLEX_RING_AND_INTF, but * does not define the indexes page. As different protocols can have * extensions to the basic format, this macro allow them to define their * own struct. * * XEN_FLEX_RING_SIZE * Convenience macro to calculate the size of one of the two rings * from the overall order. * * $NAME_mask * Function to apply the size mask to an index, to reduce the index * within the range [0-size]. * * $NAME_read_packet * Function to read data from the ring. The amount of data to read is * specified by the "size" argument. * * $NAME_write_packet * Function to write data to the ring. The amount of data to write is * specified by the "size" argument. * * $NAME_get_ring_ptr * Convenience function that returns a pointer to read/write to the * ring at the right location. * * $NAME_data_intf * Indexes page, shared between frontend and backend. It also * contains the array of grant refs. * * $NAME_queued * Function to calculate how many bytes are currently on the ring, * ready to be read. It can also be used to calculate how much free * space is currently on the ring (XEN_FLEX_RING_SIZE() - * $NAME_queued()). */ #ifndef XEN_PAGE_SHIFT /* The PAGE_SIZE for ring protocols and hypercall interfaces is always * 4K, regardless of the architecture, and page granularity chosen by * operating systems. */ #define XEN_PAGE_SHIFT 12 #endif #define XEN_FLEX_RING_SIZE(order) \ (1UL << ((order) + XEN_PAGE_SHIFT - 1)) #define DEFINE_XEN_FLEX_RING(name) \ static inline RING_IDX name##_mask(RING_IDX idx, RING_IDX ring_size) \ { \ return idx & (ring_size - 1); \ } \ \ static inline unsigned char *name##_get_ring_ptr(unsigned char *buf, \ RING_IDX idx, \ RING_IDX ring_size) \ { \ return buf + name##_mask(idx, ring_size); \ } \ \ static inline void name##_read_packet(void *opaque, \ const unsigned char *buf, \ size_t size, \ RING_IDX masked_prod, \ RING_IDX *masked_cons, \ RING_IDX ring_size) \ { \ if (*masked_cons < masked_prod || \ size <= ring_size - *masked_cons) { \ memcpy(opaque, buf + *masked_cons, size); \ } else { \ memcpy(opaque, buf + *masked_cons, ring_size - *masked_cons); \ memcpy((unsigned char *)opaque + ring_size - *masked_cons, buf, \ size - (ring_size - *masked_cons)); \ } \ *masked_cons = name##_mask(*masked_cons + size, ring_size); \ } \ \ static inline void name##_write_packet(unsigned char *buf, \ const void *opaque, \ size_t size, \ RING_IDX *masked_prod, \ RING_IDX masked_cons, \ RING_IDX ring_size) \ { \ if (*masked_prod < masked_cons || \ size <= ring_size - *masked_prod) { \ memcpy(buf + *masked_prod, opaque, size); \ } else { \ memcpy(buf + *masked_prod, opaque, ring_size - *masked_prod); \ memcpy(buf, (unsigned char *)opaque + (ring_size - *masked_prod), \ size - (ring_size - *masked_prod)); \ } \ *masked_prod = name##_mask(*masked_prod + size, ring_size); \ } \ \ static inline RING_IDX name##_queued(RING_IDX prod, \ RING_IDX cons, \ RING_IDX ring_size) \ { \ RING_IDX size; \ \ if (prod == cons) \ return 0; \ \ prod = name##_mask(prod, ring_size); \ cons = name##_mask(cons, ring_size); \ \ if (prod == cons) \ return ring_size; \ \ if (prod > cons) \ size = prod - cons; \ else \ size = ring_size - (cons - prod); \ return size; \ } \ \ struct name##_data { \ unsigned char *in; /* half of the allocation */ \ unsigned char *out; /* half of the allocation */ \ } #define DEFINE_XEN_FLEX_RING_AND_INTF(name) \ struct name##_data_intf { \ RING_IDX in_cons, in_prod; \ \ uint8_t pad1[56]; \ \ RING_IDX out_cons, out_prod; \ \ uint8_t pad2[56]; \ \ RING_IDX ring_order; \ grant_ref_t ref[]; \ }; \ DEFINE_XEN_FLEX_RING(name) #endif /* __XEN_PUBLIC_IO_RING_H__ */ /* * Local variables: * mode: C * c-file-style: "BSD" * c-basic-offset: 4 * tab-width: 4 * indent-tabs-mode: nil * End: */
gpl-2.0
mads-bertelsen/McCode
support/MacOSX/Perl-Tk/Tk-804.032/pod/pTk/TextLayout.pod
13533
# Copyright (c) 1996 Sun Microsystems, Inc. # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # =head1 NAME Tk_ComputeTextLayout, Tk_FreeTextLayout, Tk_DrawTextLayout, Tk_UnderlineTextLayout, Tk_PointToChar, Tk_CharBbox, Tk_DistanceToTextLayout, Tk_IntersectTextLayout, Tk_TextLayoutToPostscript - routines to measure and display single-font, multi-line, justified text. =for category C Programming =head1 SYNOPSIS B<#include E<lt>tk.hE<gt>> Tk_TextLayout B<Tk_ComputeTextLayout(>I<tkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr>B<)> void B<Tk_FreeTextLayout(>I<layout>B<)> void B<Tk_DrawTextLayout(>I<display, drawable, gc, layout, x, y, firstChar, lastChar>B<)> void B<Tk_UnderlineTextLayout(>I<display, drawable, gc, layout, x, y, underline>B<)> int B<Tk_PointToChar(>I<layout, x, y>B<)> int B<Tk_CharBbox(>I<layout, index, xPtr, yPtr, widthPtr, heightPtr>B<)> int B<Tk_DistanceToTextLayout(>I<layout, x, y>B<)> int B<Tk_IntersectTextLayout(>I<layout, x, y, width, height>B<)> void B<Tk_TextLayoutToPostscript(>I<interp, layout>B<)> =head1 ARGUMENTS =over 4 =item Tk_Font tkfont (in) Font to use when constructing and displaying a text layout. The I<tkfont> must remain valid for the lifetime of the text layout. Must have been returned by a previous call to B<Tk_GetFont>. =item "const char" *string (in) Potentially multi-line string whose dimensions are to be computed and stored in the text layout. The I<string> must remain valid for the lifetime of the text layout. =item int numChars (in) The number of characters to consider from I<string>. If I<numChars> is less than 0, then assumes I<string> is null terminated and uses B<strlen(>I<string>B<)>. =item int wrapLength (in) Longest permissible line length, in pixels. Lines in I<string> will automatically be broken at word boundaries and wrapped when they reach this length. If I<wrapLength> is too small for even a single character to fit on a line, it will be expanded to allow one character to fit on each line. If I<wrapLength> is E<lt>= 0, there is no automatic wrapping; lines will get as long as they need to be and only wrap if a newline/return character is encountered. =item Tk_Justify justify (in) How to justify the lines in a multi-line text layout. Possible values are TK_JUSTIFY_LEFT, TK_JUSTIFY_CENTER, or TK_JUSTIFY_RIGHT. If the text layout only occupies a single line, then I<justify> is irrelevant. =item int flags (in) Various flag bits OR-ed together. TK_IGNORE_TABS means that tab characters should not be expanded to the next tab stop. TK_IGNORE_NEWLINES means that newline/return characters should not cause a line break. If either tabs or newlines/returns are ignored, then they will be treated as regular characters, being measured and displayed in a platform-dependent manner as described in B<Tk_MeasureChars>, and will not have any special behaviors. =item int *widthPtr (out) If non-NULL, filled with either the width, in pixels, of the widest line in the text layout, or the width, in pixels, of the bounding box for the character specified by I<index>. =item int *heightPtr (out) If non-NULL, filled with either the total height, in pixels, of all the lines in the text layout, or the height, in pixels, of the bounding box for the character specified by I<index>. =item Tk_TextLayout layout (in) A token that represents the cached layout information about the single-font, multi-line, justified piece of text. This token is returned by B<Tk_ComputeTextLayout>. =item Display *display (in) Display on which to draw. =item Drawable drawable (in) Window or pixmap in which to draw. =item GC gc (in) Graphics context to use for drawing text layout. The font selected in this GC must correspond to the I<tkfont> used when constructing the text layout. =item int "x, y" (in) Point, in pixels, at which to place the upper-left hand corner of the text layout when it is being drawn, or the coordinates of a point (with respect to the upper-left hand corner of the text layout) to check against the text layout. =item int firstChar (in) The index of the first character to draw from the given text layout. The number 0 means to draw from the beginning. =item int lastChar (in) The index of the last character up to which to draw. The character specified by I<lastChar> itself will not be drawn. A number less than 0 means to draw all characters in the text layout. =item int underline (in) Index of the single character to underline in the text layout, or a number less than 0 for no underline. =item int index (in) The index of the character whose bounding box is desired. The bounding box is computed with respect to the upper-left hand corner of the text layout. =item int "*xPtr, *yPtr" (out) Filled with the upper-left hand corner, in pixels, of the bounding box for the character specified by I<index>. Either or both I<xPtr> and I<yPtr> may be NULL, in which case the corresponding value is not calculated. =item int "width, height" (in) Specifies the width and height, in pixels, of the rectangular area to compare for intersection against the text layout. =item Tcl_Interp *interp (out) Postscript code that will print the text layout is appended to I<interp-E<gt>result>. =back =head1 DESCRIPTION These routines are for measuring and displaying single-font, multi-line, justified text. To measure and display simple single-font, single-line strings, refer to the documentation for B<Tk_MeasureChars>. There is no programming interface in the core of Tk that supports multi-font, multi-line text; support for that behavior must be built on top of simpler layers. The routines described here are built on top of the programming interface described in the B<Tk_MeasureChars> documentation. Tab characters and newline/return characters may be treated specially by these procedures, but all other characters are passed through to the lower level. B<Tk_ComputeTextLayout> computes the layout information needed to display a single-font, multi-line, justified I<string> of text and returns a Tk_TextLayout token that holds this information. This token is used in subsequent calls to procedures such as B<Tk_DrawTextLayout>, B<Tk_DistanceToTextLayout>, and B<Tk_FreeTextLayout>. The I<string> and I<tkfont> used when computing the layout must remain valid for the lifetime of this token. B<Tk_FreeTextLayout> is called to release the storage associated with I<layout> when it is no longer needed. A I<layout> should not be used in any other text layout procedures once it has been released. B<Tk_DrawTextLayout> uses the information in I<layout> to display a single-font, multi-line, justified string of text at the specified location. B<Tk_UnderlineTextLayout> uses the information in I<layout> to display an underline below an individual character. This procedure does not draw the text, just the underline. To produce natively underlined text, an underlined font should be constructed and used. All characters, including tabs, newline/return characters, and spaces at the ends of lines, can be underlined using this method. However, the underline will never be drawn outside of the computed width of I<layout>; the underline will stop at the edge for any character that would extend partially outside of I<layout>, and the underline will not be visible at all for any character that would be located completely outside of the layout. B<Tk_PointToChar> uses the information in I<layout> to determine the character closest to the given point. The point is specified with respect to the upper-left hand corner of the I<layout>, which is considered to be located at (0, 0). Any point whose I<y>-value is less that 0 will be considered closest to the first character in the text layout; any point whose I<y>-value is greater than the height of the text layout will be considered closest to the last character in the text layout. Any point whose I<x>-value is less than 0 will be considered closest to the first character on that line; any point whose I<x>-value is greater than the width of the text layout will be considered closest to the last character on that line. The return value is the index of the character that was closest to the point. Given a I<layout> with no characters, the value 0 will always be returned, referring to a hypothetical zero-width placeholder character. B<Tk_CharBBox> uses the information in I<layout> to return the bounding box for the character specified by I<index>. The width of the bounding box is the advance width of the character, and does not include any left or right bearing. Any character that extends partially outside of I<layout> is considered to be truncated at the edge. Any character that would be located completely outside of I<layout> is considered to be zero-width and pegged against the edge. The height of the bounding box is the line height for this font, extending from the top of the ascent to the bottom of the descent; information about the actual height of individual letters is not available. For measurement purposes, a I<layout> that contains no characters is considered to contain a single zero-width placeholder character at index 0. If I<index> was not a valid character index, the return value is 0 and I<*xPtr>, I<*yPtr>, I<*widthPtr>, and I<*heightPtr> are unmodified. Otherwise, if I<index> did specify a valid, the return value is non-zero, and I<*xPtr>, I<*yPtr>, I<*widthPtr>, and I<*heightPtr> are filled with the bounding box information for the character. If any of I<xPtr>, I<yPtr>, I<widthPtr>, or I<heightPtr> are NULL, the corresponding value is not calculated or stored. B<Tk_DistanceToTextLayout> computes the shortest distance in pixels from the given point (I<x, y>) to the characters in I<layout>. Newline/return characters and non-displaying space characters that occur at the end of individual lines in the text layout are ignored for hit detection purposes, but tab characters are not. The return value is 0 if the point actually hits the I<layout>. If the point didn't hit the I<layout> then the return value is the distance in pixels from the point to the I<layout>. B<Tk_IntersectTextLayout> determines whether a I<layout> lies entirely inside, entirely outside, or overlaps a given rectangle. Newline/return characters and non-displaying space characters that occur at the end of individual lines in the I<layout> are ignored for intersection calculations. The return value is -1 if the I<layout> is entirely outside of the rectangle, 0 if it overlaps, and 1 if it is entirely inside of the rectangle. B<Tk_TextLayoutToPostscript> outputs code consisting of a Postscript array of strings that represent the individual lines in I<layout>. It is the responsibility of the caller to take the Postscript array of strings and add some Postscript function operate on the array to render each of the lines. The code that represents the Postscript array of strings is appended to I<interp-E<gt>result>. =head1 DISPLAY MODEL When measuring a text layout, space characters that occur at the end of a line are ignored. The space characters still exist and the insertion point can be positioned amongst them, but their additional width is ignored when justifying lines or returning the total width of a text layout. All end-of-line space characters are considered to be attached to the right edge of the line; this behavior is logical for left-justified text and reasonable for center-justified text, but not very useful when editing right-justified text. Spaces are considered variable width characters; the first space that extends past the edge of the text layout is clipped to the edge, and any subsequent spaces on the line are considered zero width and pegged against the edge. Space characters that occur in the middle of a line of text are not suppressed and occupy their normal space width. Tab characters are not ignored for measurement calculations. If wrapping is turned on and there are enough tabs on a line, the next tab will wrap to the beginning of the next line. There are some possible strange interactions between tabs and justification; tab positions are calculated and the line length computed in a left-justified world, and then the whole resulting line is shifted so it is centered or right-justified, causing the tab columns not to align any more. When wrapping is turned on, lines may wrap at word breaks (space or tab characters) or newline/returns. A dash or hyphen character in the middle of a word is not considered a word break. B<Tk_ComputeTextLayout> always attempts to place at least one word on each line. If it cannot because the I<wrapLength> is too small, the word will be broken and as much as fits placed on the line and the rest on subsequent line(s). If I<wrapLength> is so small that not even one character can fit on a given line, the I<wrapLength> is ignored for that line and one character will be placed on the line anyhow. When wrapping is turned off, only newline/return characters may cause a line break. When a text layout has been created using an underlined I<tkfont>, then any space characters that occur at the end of individual lines, newlines/returns, and tabs will not be displayed underlined when B<Tk_DrawTextLayout> is called, because those characters are never actually drawn - they are merely placeholders maintained in the I<layout>. =head1 KEYWORDS font
gpl-2.0
joshumax/hurd
pfinet/linux-src/net/ipv4/tcp_output.c
35884
/* * INET An implementation of the TCP/IP protocol suite for the LINUX * operating system. INET is implemented using the BSD Socket * interface as the means of communication with the user level. * * Implementation of the Transmission Control Protocol(TCP). * * Version: $Id: tcp_output.c,v 1.108.2.1 1999/05/14 23:07:36 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> * Mark Evans, <evansmp@uhura.aston.ac.uk> * Corey Minyard <wf-rch!minyard@relay.EU.net> * Florian La Roche, <flla@stud.uni-sb.de> * Charles Hedrick, <hedrick@klinzhai.rutgers.edu> * Linus Torvalds, <torvalds@cs.helsinki.fi> * Alan Cox, <gw4pts@gw4pts.ampr.org> * Matthew Dillon, <dillon@apollo.west.oic.com> * Arnt Gulbrandsen, <agulbra@nvg.unit.no> * Jorge Cwik, <jorge@laser.satlink.net> */ /* * Changes: Pedro Roque : Retransmit queue handled by TCP. * : Fragmentation on mtu decrease * : Segment collapse on retransmit * : AF independence * * Linus Torvalds : send_delayed_ack * David S. Miller : Charge memory using the right skb * during syn/ack processing. * David S. Miller : Output engine completely rewritten. * Andrea Arcangeli: SYNACK carry ts_recent in tsecr. * */ #include <net/tcp.h> extern int sysctl_tcp_timestamps; extern int sysctl_tcp_window_scaling; extern int sysctl_tcp_sack; /* People can turn this off for buggy TCP's found in printers etc. */ int sysctl_tcp_retrans_collapse = 1; /* Get rid of any delayed acks, we sent one already.. */ static __inline__ void clear_delayed_acks(struct sock * sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); tp->delayed_acks = 0; if(tcp_in_quickack_mode(tp)) tcp_exit_quickack_mode(tp); tcp_clear_xmit_timer(sk, TIME_DACK); } static __inline__ void update_send_head(struct sock *sk) { struct tcp_opt *tp = &sk->tp_pinfo.af_tcp; tp->send_head = tp->send_head->next; if (tp->send_head == (struct sk_buff *) &sk->write_queue) tp->send_head = NULL; } /* This routine actually transmits TCP packets queued in by * tcp_do_sendmsg(). This is used by both the initial * transmission and possible later retransmissions. * All SKB's seen here are completely headerless. It is our * job to build the TCP header, and pass the packet down to * IP so it can do the same plus pass the packet off to the * device. * * We are working here with either a clone of the original * SKB, or a fresh unique copy made by the retransmit engine. */ void tcp_transmit_skb(struct sock *sk, struct sk_buff *skb) { if(skb != NULL) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); int tcp_header_size = tp->tcp_header_len; struct tcphdr *th; int sysctl_flags; #define SYSCTL_FLAG_TSTAMPS 0x1 #define SYSCTL_FLAG_WSCALE 0x2 #define SYSCTL_FLAG_SACK 0x4 sysctl_flags = 0; if(tcb->flags & TCPCB_FLAG_SYN) { tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS; if(sysctl_tcp_timestamps) { tcp_header_size += TCPOLEN_TSTAMP_ALIGNED; sysctl_flags |= SYSCTL_FLAG_TSTAMPS; } if(sysctl_tcp_window_scaling) { tcp_header_size += TCPOLEN_WSCALE_ALIGNED; sysctl_flags |= SYSCTL_FLAG_WSCALE; } if(sysctl_tcp_sack) { sysctl_flags |= SYSCTL_FLAG_SACK; if(!(sysctl_flags & SYSCTL_FLAG_TSTAMPS)) tcp_header_size += TCPOLEN_SACKPERM_ALIGNED; } } else if(tp->sack_ok && tp->num_sacks) { /* A SACK is 2 pad bytes, a 2 byte header, plus * 2 32-bit sequence numbers for each SACK block. */ tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED + (tp->num_sacks * TCPOLEN_SACK_PERBLOCK)); } th = (struct tcphdr *) skb_push(skb, tcp_header_size); skb->h.th = th; skb_set_owner_w(skb, sk); /* Build TCP header and checksum it. */ th->source = sk->sport; th->dest = sk->dport; th->seq = htonl(TCP_SKB_CB(skb)->seq); th->ack_seq = htonl(tp->rcv_nxt); th->doff = (tcp_header_size >> 2); th->res1 = 0; *(((__u8 *)th) + 13) = tcb->flags; if(!(tcb->flags & TCPCB_FLAG_SYN)) th->window = htons(tcp_select_window(sk)); th->check = 0; th->urg_ptr = ntohs(tcb->urg_ptr); if(tcb->flags & TCPCB_FLAG_SYN) { /* RFC1323: The window in SYN & SYN/ACK segments * is never scaled. */ th->window = htons(tp->rcv_wnd); tcp_syn_build_options((__u32 *)(th + 1), tp->mss_clamp, (sysctl_flags & SYSCTL_FLAG_TSTAMPS), (sysctl_flags & SYSCTL_FLAG_SACK), (sysctl_flags & SYSCTL_FLAG_WSCALE), tp->rcv_wscale, TCP_SKB_CB(skb)->when, tp->ts_recent); } else { tcp_build_and_update_options((__u32 *)(th + 1), tp, TCP_SKB_CB(skb)->when); } tp->af_specific->send_check(sk, th, skb->len, skb); clear_delayed_acks(sk); tp->last_ack_sent = tp->rcv_nxt; tcp_statistics.TcpOutSegs++; tp->af_specific->queue_xmit(skb); } #undef SYSCTL_FLAG_TSTAMPS #undef SYSCTL_FLAG_WSCALE #undef SYSCTL_FLAG_SACK } /* This is the main buffer sending routine. We queue the buffer * and decide whether to queue or transmit now. */ void tcp_send_skb(struct sock *sk, struct sk_buff *skb, int force_queue) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); /* Advance write_seq and place onto the write_queue. */ tp->write_seq += (TCP_SKB_CB(skb)->end_seq - TCP_SKB_CB(skb)->seq); __skb_queue_tail(&sk->write_queue, skb); if (!force_queue && tp->send_head == NULL && tcp_snd_test(sk, skb)) { /* Send it out now. */ TCP_SKB_CB(skb)->when = tcp_time_stamp; tp->snd_nxt = TCP_SKB_CB(skb)->end_seq; tp->packets_out++; tcp_transmit_skb(sk, skb_clone(skb, GFP_KERNEL)); if(!tcp_timer_is_set(sk, TIME_RETRANS)) tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto); } else { /* Queue it, remembering where we must start sending. */ if (tp->send_head == NULL) tp->send_head = skb; if (!force_queue && tp->packets_out == 0 && !tp->pending) { tp->pending = TIME_PROBE0; tcp_reset_xmit_timer(sk, TIME_PROBE0, tp->rto); } } } /* Function to create two new TCP segments. Shrinks the given segment * to the specified size and appends a new segment with the rest of the * packet to the list. This won't be called frequently, I hope. * Remember, these are still headerless SKBs at this point. */ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len) { struct sk_buff *buff; int nsize = skb->len - len; u16 flags; /* Get a new skb... force flag on. */ buff = sock_wmalloc(sk, (nsize + MAX_HEADER + sk->prot->max_header), 1, GFP_ATOMIC); if (buff == NULL) return -1; /* We'll just try again later. */ /* Reserve space for headers. */ skb_reserve(buff, MAX_HEADER + sk->prot->max_header); /* Correct the sequence numbers. */ TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len; TCP_SKB_CB(buff)->end_seq = TCP_SKB_CB(skb)->end_seq; /* PSH and FIN should only be set in the second packet. */ flags = TCP_SKB_CB(skb)->flags; TCP_SKB_CB(skb)->flags = flags & ~(TCPCB_FLAG_FIN | TCPCB_FLAG_PSH); if(flags & TCPCB_FLAG_URG) { u16 old_urg_ptr = TCP_SKB_CB(skb)->urg_ptr; /* Urgent data is always a pain in the ass. */ if(old_urg_ptr > len) { TCP_SKB_CB(skb)->flags &= ~(TCPCB_FLAG_URG); TCP_SKB_CB(skb)->urg_ptr = 0; TCP_SKB_CB(buff)->urg_ptr = old_urg_ptr - len; } else { flags &= ~(TCPCB_FLAG_URG); } } if(!(flags & TCPCB_FLAG_URG)) TCP_SKB_CB(buff)->urg_ptr = 0; TCP_SKB_CB(buff)->flags = flags; TCP_SKB_CB(buff)->sacked = 0; /* Copy and checksum data tail into the new buffer. */ buff->csum = csum_partial_copy(skb->data + len, skb_put(buff, nsize), nsize, 0); /* This takes care of the FIN sequence number too. */ TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(buff)->seq; skb_trim(skb, len); /* Rechecksum original buffer. */ skb->csum = csum_partial(skb->data, skb->len, 0); /* Looks stupid, but our code really uses when of * skbs, which it never sent before. --ANK */ TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; /* Link BUFF into the send queue. */ __skb_append(skb, buff); return 0; } /* This function synchronize snd mss to current pmtu/exthdr set. tp->user_mss is mss set by user by TCP_MAXSEG. It does NOT counts for TCP options, but includes only bare TCP header. tp->mss_clamp is mss negotiated at connection setup. It is minimum of user_mss and mss received with SYN. It also does not include TCP options. tp->pmtu_cookie is last pmtu, seen by this function. tp->mss_cache is current effective sending mss, including all tcp options except for SACKs. It is evaluated, taking into account current pmtu, but never exceeds tp->mss_clamp. NOTE1. rfc1122 clearly states that advertised MSS DOES NOT include either tcp or ip options. NOTE2. tp->pmtu_cookie and tp->mss_cache are READ ONLY outside this function. --ANK (980731) */ int tcp_sync_mss(struct sock *sk, u32 pmtu) { struct tcp_opt *tp = &sk->tp_pinfo.af_tcp; int mss_now; /* Calculate base mss without TCP options: It is MMS_S - sizeof(tcphdr) of rfc1122 */ mss_now = pmtu - tp->af_specific->net_header_len - sizeof(struct tcphdr); /* Clamp it (mss_clamp does not include tcp options) */ if (mss_now > tp->mss_clamp) mss_now = tp->mss_clamp; /* Now subtract TCP options size, not including SACKs */ mss_now -= tp->tcp_header_len - sizeof(struct tcphdr); /* Now subtract optional transport overhead */ mss_now -= tp->ext_header_len; /* It we got too small (or even negative) value, clamp it by 8 from below. Why 8 ? Well, it could be 1 with the same success, but if IP accepted segment of length 1, it would love 8 even more 8) --ANK (980731) */ if (mss_now < 8) mss_now = 8; /* And store cached results */ tp->pmtu_cookie = pmtu; tp->mss_cache = mss_now; return mss_now; } /* This routine writes packets to the network. It advances the * send_head. This happens as incoming acks open up the remote * window for us. */ void tcp_write_xmit(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); unsigned int mss_now; /* Account for SACKS, we may need to fragment due to this. * It is just like the real MSS changing on us midstream. * We also handle things correctly when the user adds some * IP options mid-stream. Silly to do, but cover it. */ mss_now = tcp_current_mss(sk); /* If we are zapped, the bytes will have to remain here. * In time closedown will empty the write queue and all * will be happy. */ if(!sk->zapped) { struct sk_buff *skb; int sent_pkts = 0; /* Anything on the transmit queue that fits the window can * be added providing we are: * * a) following SWS avoidance [and Nagle algorithm] * b) not exceeding our congestion window. * c) not retransmitting [Nagle] */ while((skb = tp->send_head) && tcp_snd_test(sk, skb)) { if (skb->len > mss_now) { if (tcp_fragment(sk, skb, mss_now)) break; } /* Advance the send_head. This one is going out. */ update_send_head(sk); TCP_SKB_CB(skb)->when = tcp_time_stamp; tp->snd_nxt = TCP_SKB_CB(skb)->end_seq; tp->packets_out++; tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)); sent_pkts = 1; } /* If we sent anything, make sure the retransmit * timer is active. */ if (sent_pkts && !tcp_timer_is_set(sk, TIME_RETRANS)) tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto); } } /* This function returns the amount that we can raise the * usable window based on the following constraints * * 1. The window can never be shrunk once it is offered (RFC 793) * 2. We limit memory per socket * * RFC 1122: * "the suggested [SWS] avoidance algorithm for the receiver is to keep * RECV.NEXT + RCV.WIN fixed until: * RCV.BUFF - RCV.USER - RCV.WINDOW >= min(1/2 RCV.BUFF, MSS)" * * i.e. don't raise the right edge of the window until you can raise * it at least MSS bytes. * * Unfortunately, the recommended algorithm breaks header prediction, * since header prediction assumes th->window stays fixed. * * Strictly speaking, keeping th->window fixed violates the receiver * side SWS prevention criteria. The problem is that under this rule * a stream of single byte packets will cause the right side of the * window to always advance by a single byte. * * Of course, if the sender implements sender side SWS prevention * then this will not be a problem. * * BSD seems to make the following compromise: * * If the free space is less than the 1/4 of the maximum * space available and the free space is less than 1/2 mss, * then set the window to 0. * Otherwise, just prevent the window from shrinking * and from being larger than the largest representable value. * * This prevents incremental opening of the window in the regime * where TCP is limited by the speed of the reader side taking * data out of the TCP receive queue. It does nothing about * those cases where the window is constrained on the sender side * because the pipeline is full. * * BSD also seems to "accidentally" limit itself to windows that are a * multiple of MSS, at least until the free space gets quite small. * This would appear to be a side effect of the mbuf implementation. * Combining these two algorithms results in the observed behavior * of having a fixed window size at almost all times. * * Below we obtain similar behavior by forcing the offered window to * a multiple of the mss when it is feasible to do so. * * Note, we don't "adjust" for TIMESTAMP or SACK option bytes. */ u32 __tcp_select_window(struct sock *sk) { struct tcp_opt *tp = &sk->tp_pinfo.af_tcp; unsigned int mss = tp->mss_cache; int free_space; u32 window; /* Sometimes free_space can be < 0. */ free_space = (sk->rcvbuf - atomic_read(&sk->rmem_alloc)) / 2; if (tp->window_clamp) { if (free_space > ((int) tp->window_clamp)) free_space = tp->window_clamp; mss = min(tp->window_clamp, mss); } else { printk("tcp_select_window: tp->window_clamp == 0.\n"); } if (mss < 1) { mss = 1; printk("tcp_select_window: sk->mss fell to 0.\n"); } if ((free_space < (sk->rcvbuf/4)) && (free_space < ((int) (mss/2)))) { window = 0; tp->pred_flags = 0; } else { /* Get the largest window that is a nice multiple of mss. * Window clamp already applied above. * If our current window offering is within 1 mss of the * free space we just keep it. This prevents the divide * and multiply from happening most of the time. * We also don't do any window rounding when the free space * is too small. */ window = tp->rcv_wnd; if ((((int) window) <= (free_space - ((int) mss))) || (((int) window) > free_space)) window = (((unsigned int) free_space)/mss)*mss; } return window; } /* Attempt to collapse two adjacent SKB's during retransmission. */ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int mss_now) { struct sk_buff *next_skb = skb->next; /* The first test we must make is that neither of these two * SKB's are still referenced by someone else. */ if(!skb_cloned(skb) && !skb_cloned(next_skb)) { int skb_size = skb->len, next_skb_size = next_skb->len; u16 flags = TCP_SKB_CB(skb)->flags; /* Punt if the first SKB has URG set. */ if(flags & TCPCB_FLAG_URG) return; /* Also punt if next skb has been SACK'd. */ if(TCP_SKB_CB(next_skb)->sacked & TCPCB_SACKED_ACKED) return; /* Punt if not enough space exists in the first SKB for * the data in the second, or the total combined payload * would exceed the MSS. */ if ((next_skb_size > skb_tailroom(skb)) || ((skb_size + next_skb_size) > mss_now)) return; /* Ok. We will be able to collapse the packet. */ __skb_unlink(next_skb, next_skb->list); if(skb->len % 4) { /* Must copy and rechecksum all data. */ memcpy(skb_put(skb, next_skb_size), next_skb->data, next_skb_size); skb->csum = csum_partial(skb->data, skb->len, 0); } else { /* Optimize, actually we could also combine next_skb->csum * to skb->csum using a single add w/carry operation too. */ skb->csum = csum_partial_copy(next_skb->data, skb_put(skb, next_skb_size), next_skb_size, skb->csum); } /* Update sequence range on original skb. */ TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(next_skb)->end_seq; /* Merge over control information. */ flags |= TCP_SKB_CB(next_skb)->flags; /* This moves PSH/FIN etc. over */ if(flags & TCPCB_FLAG_URG) { u16 urgptr = TCP_SKB_CB(next_skb)->urg_ptr; TCP_SKB_CB(skb)->urg_ptr = urgptr + skb_size; } TCP_SKB_CB(skb)->flags = flags; /* All done, get rid of second SKB and account for it so * packet counting does not break. */ kfree_skb(next_skb); sk->tp_pinfo.af_tcp.packets_out--; } } /* Do a simple retransmit without using the backoff mechanisms in * tcp_timer. This is used for path mtu discovery. * The socket is already locked here. */ void tcp_simple_retransmit(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *skb, *old_next_skb; unsigned int mss = tcp_current_mss(sk); /* Don't muck with the congestion window here. */ tp->dup_acks = 0; tp->high_seq = tp->snd_nxt; tp->retrans_head = NULL; /* Input control flow will see that this was retransmitted * and not use it for RTT calculation in the absence of * the timestamp option. */ for (old_next_skb = skb = skb_peek(&sk->write_queue); ((skb != tp->send_head) && (skb != (struct sk_buff *)&sk->write_queue)); skb = skb->next) { int resend_skb = 0; /* Our goal is to push out the packets which we * sent already, but are being chopped up now to * account for the PMTU information we have. * * As we resend the queue, packets are fragmented * into two pieces, and when we try to send the * second piece it may be collapsed together with * a subsequent packet, and so on. -DaveM */ if (old_next_skb != skb || skb->len > mss) resend_skb = 1; old_next_skb = skb->next; if (resend_skb != 0) tcp_retransmit_skb(sk, skb); } } static __inline__ void update_retrans_head(struct sock *sk) { struct tcp_opt *tp = &sk->tp_pinfo.af_tcp; tp->retrans_head = tp->retrans_head->next; if((tp->retrans_head == tp->send_head) || (tp->retrans_head == (struct sk_buff *) &sk->write_queue)) { tp->retrans_head = NULL; tp->rexmt_done = 1; } } /* This retransmits one SKB. Policy decisions and retransmit queue * state updates are done by the caller. Returns non-zero if an * error occurred which prevented the send. */ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); unsigned int cur_mss = tcp_current_mss(sk); if(skb->len > cur_mss) { if(tcp_fragment(sk, skb, cur_mss)) return 1; /* We'll try again later. */ /* New SKB created, account for it. */ tp->packets_out++; } /* Collapse two adjacent packets if worthwhile and we can. */ if(!(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_SYN) && (skb->len < (cur_mss >> 1)) && (skb->next != tp->send_head) && (skb->next != (struct sk_buff *)&sk->write_queue) && (sysctl_tcp_retrans_collapse != 0)) tcp_retrans_try_collapse(sk, skb, cur_mss); if(tp->af_specific->rebuild_header(sk)) return 1; /* Routing failure or similar. */ /* Some Solaris stacks overoptimize and ignore the FIN on a * retransmit when old data is attached. So strip it off * since it is cheap to do so and saves bytes on the network. */ if(skb->len > 0 && (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) { TCP_SKB_CB(skb)->seq = TCP_SKB_CB(skb)->end_seq - 1; skb_trim(skb, 0); skb->csum = 0; } /* Ok, we're gonna send it out, update state. */ TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_RETRANS; tp->retrans_out++; /* Make a copy, if the first transmission SKB clone we made * is still in somebody's hands, else make a clone. */ TCP_SKB_CB(skb)->when = tcp_time_stamp; if(skb_cloned(skb)) skb = skb_copy(skb, GFP_ATOMIC); else skb = skb_clone(skb, GFP_ATOMIC); tcp_transmit_skb(sk, skb); /* Update global TCP statistics and return success. */ sk->prot->retransmits++; tcp_statistics.TcpRetransSegs++; return 0; } /* This gets called after a retransmit timeout, and the initially * retransmitted data is acknowledged. It tries to continue * resending the rest of the retransmit queue, until either * we've sent it all or the congestion window limit is reached. * If doing SACK, the first ACK which comes back for a timeout * based retransmit packet might feed us FACK information again. * If so, we use it to avoid unnecessarily retransmissions. */ void tcp_xmit_retransmit_queue(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *skb; if (tp->retrans_head == NULL && tp->rexmt_done == 0) tp->retrans_head = skb_peek(&sk->write_queue); if (tp->retrans_head == tp->send_head) tp->retrans_head = NULL; /* Each time, advance the retrans_head if we got * a packet out or we skipped one because it was * SACK'd. -DaveM */ while ((skb = tp->retrans_head) != NULL) { /* If it has been ack'd by a SACK block, we don't * retransmit it. */ if(!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) { /* Send it out, punt if error occurred. */ if(tcp_retransmit_skb(sk, skb)) break; update_retrans_head(sk); /* Stop retransmitting if we've hit the congestion * window limit. */ if (tp->retrans_out >= tp->snd_cwnd) break; } else { update_retrans_head(sk); } } } /* Using FACK information, retransmit all missing frames at the receiver * up to the forward most SACK'd packet (tp->fackets_out) if the packet * has not been retransmitted already. */ void tcp_fack_retransmit(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *skb = skb_peek(&sk->write_queue); int packet_cnt = 0; while((skb != NULL) && (skb != tp->send_head) && (skb != (struct sk_buff *)&sk->write_queue)) { __u8 sacked = TCP_SKB_CB(skb)->sacked; if(sacked & (TCPCB_SACKED_ACKED | TCPCB_SACKED_RETRANS)) goto next_packet; /* Ok, retransmit it. */ if(tcp_retransmit_skb(sk, skb)) break; if(tcp_packets_in_flight(tp) >= tp->snd_cwnd) break; next_packet: packet_cnt++; if(packet_cnt >= tp->fackets_out) break; skb = skb->next; } } /* Send a fin. The caller locks the socket for us. This cannot be * allowed to fail queueing a FIN frame under any circumstances. */ void tcp_send_fin(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *skb = skb_peek_tail(&sk->write_queue); unsigned int mss_now; /* Optimization, tack on the FIN if we have a queue of * unsent frames. But be careful about outgoing SACKS * and IP options. */ mss_now = tcp_current_mss(sk); if((tp->send_head != NULL) && (skb->len < mss_now)) { /* tcp_write_xmit() takes care of the rest. */ TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_FIN; TCP_SKB_CB(skb)->end_seq++; tp->write_seq++; /* Special case to avoid Nagle bogosity. If this * segment is the last segment, and it was queued * due to Nagle/SWS-avoidance, send it out now. */ if(tp->send_head == skb && !sk->nonagle && skb->len < (tp->mss_cache >> 1) && tp->packets_out && !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_URG)) { update_send_head(sk); TCP_SKB_CB(skb)->when = tcp_time_stamp; tp->snd_nxt = TCP_SKB_CB(skb)->end_seq; tp->packets_out++; tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)); if(!tcp_timer_is_set(sk, TIME_RETRANS)) tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto); } } else { /* Socket is locked, keep trying until memory is available. */ do { skb = sock_wmalloc(sk, (MAX_HEADER + sk->prot->max_header), 1, GFP_KERNEL); } while (skb == NULL); /* Reserve space for headers and prepare control bits. */ skb_reserve(skb, MAX_HEADER + sk->prot->max_header); skb->csum = 0; TCP_SKB_CB(skb)->flags = (TCPCB_FLAG_ACK | TCPCB_FLAG_FIN); TCP_SKB_CB(skb)->sacked = 0; TCP_SKB_CB(skb)->urg_ptr = 0; /* FIN eats a sequence byte, write_seq advanced by tcp_send_skb(). */ TCP_SKB_CB(skb)->seq = tp->write_seq; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq + 1; tcp_send_skb(sk, skb, 0); } } /* We get here when a process closes a file descriptor (either due to * an explicit close() or as a byproduct of exit()'ing) and there * was unread data in the receive queue. This behavior is recommended * by draft-ietf-tcpimpl-prob-03.txt section 3.10. -DaveM */ void tcp_send_active_reset(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *skb; /* NOTE: No TCP options attached and we never retransmit this. */ skb = alloc_skb(MAX_HEADER + sk->prot->max_header, GFP_KERNEL); if (!skb) return; /* Reserve space for headers and prepare control bits. */ skb_reserve(skb, MAX_HEADER + sk->prot->max_header); skb->csum = 0; TCP_SKB_CB(skb)->flags = (TCPCB_FLAG_ACK | TCPCB_FLAG_RST); TCP_SKB_CB(skb)->sacked = 0; TCP_SKB_CB(skb)->urg_ptr = 0; /* Send it off. */ TCP_SKB_CB(skb)->seq = tp->write_seq; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq; TCP_SKB_CB(skb)->when = tcp_time_stamp; tcp_transmit_skb(sk, skb); } /* WARNING: This routine must only be called when we have already sent * a SYN packet that crossed the incoming SYN that caused this routine * to get called. If this assumption fails then the initial rcv_wnd * and rcv_wscale values will not be correct. */ int tcp_send_synack(struct sock *sk) { struct tcp_opt* tp = &(sk->tp_pinfo.af_tcp); struct sk_buff* skb; skb = sock_wmalloc(sk, (MAX_HEADER + sk->prot->max_header), 1, GFP_ATOMIC); if (skb == NULL) return -ENOMEM; /* Reserve space for headers and prepare control bits. */ skb_reserve(skb, MAX_HEADER + sk->prot->max_header); skb->csum = 0; TCP_SKB_CB(skb)->flags = (TCPCB_FLAG_ACK | TCPCB_FLAG_SYN); TCP_SKB_CB(skb)->sacked = 0; TCP_SKB_CB(skb)->urg_ptr = 0; /* SYN eats a sequence byte. */ TCP_SKB_CB(skb)->seq = tp->snd_una; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq + 1; __skb_queue_tail(&sk->write_queue, skb); TCP_SKB_CB(skb)->when = tcp_time_stamp; tp->packets_out++; tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)); return 0; } /* * Prepare a SYN-ACK. */ struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, struct open_request *req, int mss) { struct tcphdr *th; int tcp_header_size; struct sk_buff *skb; skb = sock_wmalloc(sk, MAX_HEADER + sk->prot->max_header, 1, GFP_ATOMIC); if (skb == NULL) return NULL; /* Reserve space for headers. */ skb_reserve(skb, MAX_HEADER + sk->prot->max_header); skb->dst = dst_clone(dst); /* Don't offer more than they did. * This way we don't have to memorize who said what. * FIXME: maybe this should be changed for better performance * with syncookies. */ req->mss = min(mss, req->mss); if (req->mss < 8) { printk(KERN_DEBUG "initial req->mss below 8\n"); req->mss = 8; } tcp_header_size = (sizeof(struct tcphdr) + TCPOLEN_MSS + (req->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0) + (req->wscale_ok ? TCPOLEN_WSCALE_ALIGNED : 0) + /* SACK_PERM is in the place of NOP NOP of TS */ ((req->sack_ok && !req->tstamp_ok) ? TCPOLEN_SACKPERM_ALIGNED : 0)); skb->h.th = th = (struct tcphdr *) skb_push(skb, tcp_header_size); memset(th, 0, sizeof(struct tcphdr)); th->syn = 1; th->ack = 1; th->source = sk->sport; th->dest = req->rmt_port; TCP_SKB_CB(skb)->seq = req->snt_isn; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq + 1; th->seq = htonl(TCP_SKB_CB(skb)->seq); th->ack_seq = htonl(req->rcv_isn + 1); if (req->rcv_wnd == 0) { /* ignored for retransmitted syns */ __u8 rcv_wscale; /* Set this up on the first call only */ req->window_clamp = skb->dst->window; tcp_select_initial_window(sock_rspace(sk)/2,req->mss, &req->rcv_wnd, &req->window_clamp, req->wscale_ok, &rcv_wscale); req->rcv_wscale = rcv_wscale; } /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ th->window = htons(req->rcv_wnd); TCP_SKB_CB(skb)->when = tcp_time_stamp; tcp_syn_build_options((__u32 *)(th + 1), req->mss, req->tstamp_ok, req->sack_ok, req->wscale_ok, req->rcv_wscale, TCP_SKB_CB(skb)->when, req->ts_recent); skb->csum = 0; th->doff = (tcp_header_size >> 2); tcp_statistics.TcpOutSegs++; return skb; } void tcp_connect(struct sock *sk, struct sk_buff *buff, int mtu) { struct dst_entry *dst = sk->dst_cache; struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); /* Reserve space for headers. */ skb_reserve(buff, MAX_HEADER + sk->prot->max_header); tp->snd_wnd = 0; tp->snd_wl1 = 0; tp->snd_wl2 = tp->write_seq; tp->snd_una = tp->write_seq; tp->rcv_nxt = 0; sk->err = 0; sk->done = 0; /* We'll fix this up when we get a response from the other end. * See tcp_input.c:tcp_rcv_state_process case TCP_SYN_SENT. */ tp->tcp_header_len = sizeof(struct tcphdr) + (sysctl_tcp_timestamps ? TCPOLEN_TSTAMP_ALIGNED : 0); /* If user gave his TCP_MAXSEG, record it to clamp */ if (tp->user_mss) tp->mss_clamp = tp->user_mss; tcp_sync_mss(sk, mtu); /* Now unpleasant action: if initial pmtu is too low set lower clamp. I am not sure that it is good. To be more exact, I do not think that clamping at value, which is apparently transient and may improve in future is good idea. It would be better to wait until peer will returns its MSS (probably 65535 too) and now advertise something sort of 65535 or at least first hop device mtu. Is it clear, what I mean? We should tell peer what maximal mss we expect to RECEIVE, it has nothing to do with pmtu. I am afraid someone will be confused by such huge value. --ANK (980731) */ if (tp->mss_cache + tp->tcp_header_len - sizeof(struct tcphdr) < tp->mss_clamp ) tp->mss_clamp = tp->mss_cache + tp->tcp_header_len - sizeof(struct tcphdr); TCP_SKB_CB(buff)->flags = TCPCB_FLAG_SYN; TCP_SKB_CB(buff)->sacked = 0; TCP_SKB_CB(buff)->urg_ptr = 0; buff->csum = 0; TCP_SKB_CB(buff)->seq = tp->write_seq++; TCP_SKB_CB(buff)->end_seq = tp->write_seq; tp->snd_nxt = TCP_SKB_CB(buff)->end_seq; tp->window_clamp = dst->window; tcp_select_initial_window(sock_rspace(sk)/2,tp->mss_clamp, &tp->rcv_wnd, &tp->window_clamp, sysctl_tcp_window_scaling, &tp->rcv_wscale); /* Ok, now lock the socket before we make it visible to * the incoming packet engine. */ lock_sock(sk); /* Socket identity change complete, no longer * in TCP_CLOSE, so enter ourselves into the * hash tables. */ tcp_set_state(sk,TCP_SYN_SENT); sk->prot->hash(sk); tp->rto = dst->rtt; tcp_init_xmit_timers(sk); tp->retransmits = 0; tp->fackets_out = 0; tp->retrans_out = 0; /* Send it off. */ __skb_queue_tail(&sk->write_queue, buff); TCP_SKB_CB(buff)->when = tcp_time_stamp; tp->packets_out++; tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL)); tcp_statistics.TcpActiveOpens++; /* Timer for repeating the SYN until an answer. */ tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto); /* Now, it is safe to release the socket. */ release_sock(sk); } /* Send out a delayed ack, the caller does the policy checking * to see if we should even be here. See tcp_input.c:tcp_ack_snd_check() * for details. */ void tcp_send_delayed_ack(struct tcp_opt *tp, int max_timeout) { unsigned long timeout; /* Stay within the limit we were given */ timeout = tp->ato; if (timeout > max_timeout) timeout = max_timeout; timeout += jiffies; /* Use new timeout only if there wasn't a older one earlier. */ if (!tp->delack_timer.prev) { tp->delack_timer.expires = timeout; add_timer(&tp->delack_timer); } else { if (time_before(timeout, tp->delack_timer.expires)) mod_timer(&tp->delack_timer, timeout); } } /* This routine sends an ack and also updates the window. */ void tcp_send_ack(struct sock *sk) { /* If we have been reset, we may not send again. */ if(!sk->zapped) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *buff; /* We are not putting this on the write queue, so * tcp_transmit_skb() will set the ownership to this * sock. */ buff = alloc_skb(MAX_HEADER + sk->prot->max_header, GFP_ATOMIC); if (buff == NULL) { /* Force it to send an ack. We don't have to do this * (ACK is unreliable) but it's much better use of * bandwidth on slow links to send a spare ack than * resend packets. * * This is the one possible way that we can delay an * ACK and have tp->ato indicate that we are in * quick ack mode, so clear it. */ if(tcp_in_quickack_mode(tp)) tcp_exit_quickack_mode(tp); tcp_send_delayed_ack(tp, HZ/2); return; } /* Reserve space for headers and prepare control bits. */ skb_reserve(buff, MAX_HEADER + sk->prot->max_header); buff->csum = 0; TCP_SKB_CB(buff)->flags = TCPCB_FLAG_ACK; TCP_SKB_CB(buff)->sacked = 0; TCP_SKB_CB(buff)->urg_ptr = 0; /* Send it off, this clears delayed acks for us. */ TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tp->snd_nxt; TCP_SKB_CB(buff)->when = tcp_time_stamp; tcp_transmit_skb(sk, buff); } } /* This routine sends a packet with an out of date sequence * number. It assumes the other end will try to ack it. */ void tcp_write_wakeup(struct sock *sk) { /* After a valid reset we can send no more. */ if (!sk->zapped) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); struct sk_buff *skb; /* Write data can still be transmitted/retransmitted in the * following states. If any other state is encountered, return. * [listen/close will never occur here anyway] */ if ((1 << sk->state) & ~(TCPF_ESTABLISHED|TCPF_CLOSE_WAIT|TCPF_FIN_WAIT1| TCPF_LAST_ACK|TCPF_CLOSING)) return; if (before(tp->snd_nxt, tp->snd_una + tp->snd_wnd) && ((skb = tp->send_head) != NULL)) { unsigned long win_size; /* We are probing the opening of a window * but the window size is != 0 * must have been a result SWS avoidance ( sender ) */ win_size = tp->snd_wnd - (tp->snd_nxt - tp->snd_una); if (win_size < TCP_SKB_CB(skb)->end_seq - TCP_SKB_CB(skb)->seq) { if (tcp_fragment(sk, skb, win_size)) return; /* Let a retransmit get it. */ } update_send_head(sk); TCP_SKB_CB(skb)->when = tcp_time_stamp; tp->snd_nxt = TCP_SKB_CB(skb)->end_seq; tp->packets_out++; tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC)); if (!tcp_timer_is_set(sk, TIME_RETRANS)) tcp_reset_xmit_timer(sk, TIME_RETRANS, tp->rto); } else { /* We don't queue it, tcp_transmit_skb() sets ownership. */ skb = alloc_skb(MAX_HEADER + sk->prot->max_header, GFP_ATOMIC); if (skb == NULL) return; /* Reserve space for headers and set control bits. */ skb_reserve(skb, MAX_HEADER + sk->prot->max_header); skb->csum = 0; TCP_SKB_CB(skb)->flags = TCPCB_FLAG_ACK; TCP_SKB_CB(skb)->sacked = 0; TCP_SKB_CB(skb)->urg_ptr = 0; /* Use a previous sequence. This should cause the other * end to send an ack. Don't queue or clone SKB, just * send it. */ TCP_SKB_CB(skb)->seq = tp->snd_nxt - 1; TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq; TCP_SKB_CB(skb)->when = tcp_time_stamp; tcp_transmit_skb(sk, skb); } } } /* A window probe timeout has occurred. If window is not closed send * a partial packet else a zero probe. */ void tcp_send_probe0(struct sock *sk) { struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); tcp_write_wakeup(sk); tp->pending = TIME_PROBE0; tp->backoff++; tp->probes_out++; tcp_reset_xmit_timer (sk, TIME_PROBE0, min(tp->rto << tp->backoff, 120*HZ)); }
gpl-2.0
totalspectrum/binutils-propeller
bfd/elf32-tic6x.c
127774
/* 32-bit ELF support for TI C6X Copyright (C) 2010-2017 Free Software Foundation, Inc. Contributed by Joseph Myers <joseph@codesourcery.com> Bernd Schmidt <bernds@codesourcery.com> This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sysdep.h" #include <limits.h> #include "bfd.h" #include "libbfd.h" #include "libiberty.h" #include "elf-bfd.h" #include "elf/tic6x.h" #include "elf32-tic6x.h" #define ELF_DYNAMIC_INTERPRETER "/lib/ld-uClibc.so.0" /* DSBT binaries have a default 128K stack. */ #define DEFAULT_STACK_SIZE 0x20000 /* The size in bytes of an entry in the procedure linkage table. */ #define PLT_ENTRY_SIZE 24 /* TI C6X ELF linker hash table. */ struct elf32_tic6x_link_hash_table { struct elf_link_hash_table elf; /* C6X specific command line arguments. */ struct elf32_tic6x_params params; /* Small local sym cache. */ struct sym_cache sym_cache; /* The output BFD, for convenience. */ bfd *obfd; /* The .dsbt section. */ asection *dsbt; }; /* Get the TI C6X ELF linker hash table from a link_info structure. */ #define elf32_tic6x_hash_table(p) \ ((struct elf32_tic6x_link_hash_table *) ((p)->hash)) /* TI C6X ELF linker hash entry. */ struct elf32_tic6x_link_hash_entry { struct elf_link_hash_entry elf; /* Track dynamic relocs copied for this symbol. */ struct elf_dyn_relocs *dyn_relocs; }; typedef enum { DELETE_EXIDX_ENTRY, INSERT_EXIDX_CANTUNWIND_AT_END } tic6x_unwind_edit_type; /* A (sorted) list of edits to apply to an unwind table. */ typedef struct tic6x_unwind_table_edit { tic6x_unwind_edit_type type; /* Note: we sometimes want to insert an unwind entry corresponding to a section different from the one we're currently writing out, so record the (text) section this edit relates to here. */ asection *linked_section; unsigned int index; struct tic6x_unwind_table_edit *next; } tic6x_unwind_table_edit; typedef struct _tic6x_elf_section_data { /* Information about mapping symbols. */ struct bfd_elf_section_data elf; /* Information about unwind tables. */ union { /* Unwind info attached to a text section. */ struct { asection *tic6x_exidx_sec; } text; /* Unwind info attached to an .c6xabi.exidx section. */ struct { tic6x_unwind_table_edit *unwind_edit_list; tic6x_unwind_table_edit *unwind_edit_tail; } exidx; } u; } _tic6x_elf_section_data; #define elf32_tic6x_section_data(sec) \ ((_tic6x_elf_section_data *) elf_section_data (sec)) struct elf32_tic6x_obj_tdata { struct elf_obj_tdata root; /* Whether to use RELA relocations when generating relocations. This is a per-object flag to allow the assembler to generate REL relocations for use in linker testcases. */ bfd_boolean use_rela_p; }; #define elf32_tic6x_tdata(abfd) \ ((struct elf32_tic6x_obj_tdata *) (abfd)->tdata.any) #define is_tic6x_elf(bfd) \ (bfd_get_flavour (bfd) == bfd_target_elf_flavour \ && elf_tdata (bfd) != NULL \ && elf_object_id (bfd) == TIC6X_ELF_DATA) /* C6X ELF uses two common sections. One is the usual one, and the other is for small objects. All the small objects are kept together, and then referenced via the gp pointer, which yields faster assembler code. This is what we use for the small common section. This approach is copied from ecoff.c. */ static asection tic6x_elf_scom_section; static asymbol tic6x_elf_scom_symbol; static asymbol *tic6x_elf_scom_symbol_ptr; static reloc_howto_type elf32_tic6x_howto_table[] = { HOWTO (R_C6000_NONE, /* type */ 0, /* rightshift */ 3, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_NONE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS32", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS8", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x000000ff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S21, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ TRUE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S21", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0fffff80, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S12, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ TRUE, /* pc_relative */ 16, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S12", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0fff0000, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S10, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 10, /* bitsize */ TRUE, /* pc_relative */ 13, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S10", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fe000, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S7, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 7, /* bitsize */ TRUE, /* pc_relative */ 16, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S7", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007f0000, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_ABS_S16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS_S16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS_L16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS_L16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS_H16, /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS_H16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_U15_B, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_U15_B", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_U15_H, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_U15_H", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_U15_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_U15_W", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_S16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_S16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_L16_B, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_L16_B", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_L16_H, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_L16_H", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_L16_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_L16_W", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_H16_B, /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_H16_B", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_H16_H, /* type */ 17, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_H16_H", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_H16_W, /* type */ 18, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_H16_W", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_GOT_U15_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_GOT_U15_W",/* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_GOT_L16_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_GOT_L16_W",/* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_GOT_H16_W, /* type */ 18, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_GOT_H16_W",/* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_DSBT_INDEX, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_DSBT_INDEX", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_PREL31, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 31, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PREL31", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x7fffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_COPY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_COPY", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_JUMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_JUMP_SLOT", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_EHTYPE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_EHTYPE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_PCR_H16, /* type */ 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_H16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_L16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ TRUE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_L16", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0x007fff80, /* dst_mask */ TRUE), /* pcrel_offset */ EMPTY_HOWTO (31), EMPTY_HOWTO (32), EMPTY_HOWTO (33), EMPTY_HOWTO (34), EMPTY_HOWTO (35), EMPTY_HOWTO (36), EMPTY_HOWTO (37), EMPTY_HOWTO (38), EMPTY_HOWTO (39), EMPTY_HOWTO (40), EMPTY_HOWTO (41), EMPTY_HOWTO (42), EMPTY_HOWTO (43), EMPTY_HOWTO (44), EMPTY_HOWTO (45), EMPTY_HOWTO (46), EMPTY_HOWTO (47), EMPTY_HOWTO (48), EMPTY_HOWTO (49), EMPTY_HOWTO (50), EMPTY_HOWTO (51), EMPTY_HOWTO (52), EMPTY_HOWTO (53), EMPTY_HOWTO (54), EMPTY_HOWTO (55), EMPTY_HOWTO (56), EMPTY_HOWTO (57), EMPTY_HOWTO (58), EMPTY_HOWTO (59), EMPTY_HOWTO (60), EMPTY_HOWTO (61), EMPTY_HOWTO (62), EMPTY_HOWTO (63), EMPTY_HOWTO (64), EMPTY_HOWTO (65), EMPTY_HOWTO (66), EMPTY_HOWTO (67), EMPTY_HOWTO (68), EMPTY_HOWTO (69), EMPTY_HOWTO (70), EMPTY_HOWTO (71), EMPTY_HOWTO (72), EMPTY_HOWTO (73), EMPTY_HOWTO (74), EMPTY_HOWTO (75), EMPTY_HOWTO (76), EMPTY_HOWTO (77), EMPTY_HOWTO (78), EMPTY_HOWTO (79), EMPTY_HOWTO (80), EMPTY_HOWTO (81), EMPTY_HOWTO (82), EMPTY_HOWTO (83), EMPTY_HOWTO (84), EMPTY_HOWTO (85), EMPTY_HOWTO (86), EMPTY_HOWTO (87), EMPTY_HOWTO (88), EMPTY_HOWTO (89), EMPTY_HOWTO (90), EMPTY_HOWTO (91), EMPTY_HOWTO (92), EMPTY_HOWTO (93), EMPTY_HOWTO (94), EMPTY_HOWTO (95), EMPTY_HOWTO (96), EMPTY_HOWTO (97), EMPTY_HOWTO (98), EMPTY_HOWTO (99), EMPTY_HOWTO (100), EMPTY_HOWTO (101), EMPTY_HOWTO (102), EMPTY_HOWTO (103), EMPTY_HOWTO (104), EMPTY_HOWTO (105), EMPTY_HOWTO (106), EMPTY_HOWTO (107), EMPTY_HOWTO (108), EMPTY_HOWTO (109), EMPTY_HOWTO (110), EMPTY_HOWTO (111), EMPTY_HOWTO (112), EMPTY_HOWTO (113), EMPTY_HOWTO (114), EMPTY_HOWTO (115), EMPTY_HOWTO (116), EMPTY_HOWTO (117), EMPTY_HOWTO (118), EMPTY_HOWTO (119), EMPTY_HOWTO (120), EMPTY_HOWTO (121), EMPTY_HOWTO (122), EMPTY_HOWTO (123), EMPTY_HOWTO (124), EMPTY_HOWTO (125), EMPTY_HOWTO (126), EMPTY_HOWTO (127), EMPTY_HOWTO (128), EMPTY_HOWTO (129), EMPTY_HOWTO (130), EMPTY_HOWTO (131), EMPTY_HOWTO (132), EMPTY_HOWTO (133), EMPTY_HOWTO (134), EMPTY_HOWTO (135), EMPTY_HOWTO (136), EMPTY_HOWTO (137), EMPTY_HOWTO (138), EMPTY_HOWTO (139), EMPTY_HOWTO (140), EMPTY_HOWTO (141), EMPTY_HOWTO (142), EMPTY_HOWTO (143), EMPTY_HOWTO (144), EMPTY_HOWTO (145), EMPTY_HOWTO (146), EMPTY_HOWTO (147), EMPTY_HOWTO (148), EMPTY_HOWTO (149), EMPTY_HOWTO (150), EMPTY_HOWTO (151), EMPTY_HOWTO (152), EMPTY_HOWTO (153), EMPTY_HOWTO (154), EMPTY_HOWTO (155), EMPTY_HOWTO (156), EMPTY_HOWTO (157), EMPTY_HOWTO (158), EMPTY_HOWTO (159), EMPTY_HOWTO (160), EMPTY_HOWTO (161), EMPTY_HOWTO (162), EMPTY_HOWTO (163), EMPTY_HOWTO (164), EMPTY_HOWTO (165), EMPTY_HOWTO (166), EMPTY_HOWTO (167), EMPTY_HOWTO (168), EMPTY_HOWTO (169), EMPTY_HOWTO (170), EMPTY_HOWTO (171), EMPTY_HOWTO (172), EMPTY_HOWTO (173), EMPTY_HOWTO (174), EMPTY_HOWTO (175), EMPTY_HOWTO (176), EMPTY_HOWTO (177), EMPTY_HOWTO (178), EMPTY_HOWTO (179), EMPTY_HOWTO (180), EMPTY_HOWTO (181), EMPTY_HOWTO (182), EMPTY_HOWTO (183), EMPTY_HOWTO (184), EMPTY_HOWTO (185), EMPTY_HOWTO (186), EMPTY_HOWTO (187), EMPTY_HOWTO (188), EMPTY_HOWTO (189), EMPTY_HOWTO (190), EMPTY_HOWTO (191), EMPTY_HOWTO (192), EMPTY_HOWTO (193), EMPTY_HOWTO (194), EMPTY_HOWTO (195), EMPTY_HOWTO (196), EMPTY_HOWTO (197), EMPTY_HOWTO (198), EMPTY_HOWTO (199), EMPTY_HOWTO (200), EMPTY_HOWTO (201), EMPTY_HOWTO (202), EMPTY_HOWTO (203), EMPTY_HOWTO (204), EMPTY_HOWTO (205), EMPTY_HOWTO (206), EMPTY_HOWTO (207), EMPTY_HOWTO (208), EMPTY_HOWTO (209), EMPTY_HOWTO (210), EMPTY_HOWTO (211), EMPTY_HOWTO (212), EMPTY_HOWTO (213), EMPTY_HOWTO (214), EMPTY_HOWTO (215), EMPTY_HOWTO (216), EMPTY_HOWTO (217), EMPTY_HOWTO (218), EMPTY_HOWTO (219), EMPTY_HOWTO (220), EMPTY_HOWTO (221), EMPTY_HOWTO (222), EMPTY_HOWTO (223), EMPTY_HOWTO (224), EMPTY_HOWTO (225), EMPTY_HOWTO (226), EMPTY_HOWTO (227), EMPTY_HOWTO (228), EMPTY_HOWTO (229), EMPTY_HOWTO (230), EMPTY_HOWTO (231), EMPTY_HOWTO (232), EMPTY_HOWTO (233), EMPTY_HOWTO (234), EMPTY_HOWTO (235), EMPTY_HOWTO (236), EMPTY_HOWTO (237), EMPTY_HOWTO (238), EMPTY_HOWTO (239), EMPTY_HOWTO (240), EMPTY_HOWTO (241), EMPTY_HOWTO (242), EMPTY_HOWTO (243), EMPTY_HOWTO (244), EMPTY_HOWTO (245), EMPTY_HOWTO (246), EMPTY_HOWTO (247), EMPTY_HOWTO (248), EMPTY_HOWTO (249), EMPTY_HOWTO (250), EMPTY_HOWTO (251), EMPTY_HOWTO (252), HOWTO (R_C6000_ALIGN, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ALIGN", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_FPHEAD, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_FPHEAD", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_NOCMP, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_NOCMP", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE) /* pcrel_offset */ }; static reloc_howto_type elf32_tic6x_howto_table_rel[] = { HOWTO (R_C6000_NONE, /* type */ 0, /* rightshift */ 3, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_NONE", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS32", /* name */ TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS16", /* name */ TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS8", /* name */ TRUE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S21, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ TRUE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S21", /* name */ TRUE, /* partial_inplace */ 0x0fffff80, /* src_mask */ 0x0fffff80, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S12, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ TRUE, /* pc_relative */ 16, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S12", /* name */ TRUE, /* partial_inplace */ 0x0fff0000, /* src_mask */ 0x0fff0000, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S10, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 10, /* bitsize */ TRUE, /* pc_relative */ 13, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S10", /* name */ TRUE, /* partial_inplace */ 0x007fe000, /* src_mask */ 0x007fe000, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_PCR_S7, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 7, /* bitsize */ TRUE, /* pc_relative */ 16, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PCR_S7", /* name */ TRUE, /* partial_inplace */ 0x007f0000, /* src_mask */ 0x007f0000, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_ABS_S16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS_S16", /* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_ABS_L16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ABS_L16", /* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ EMPTY_HOWTO (R_C6000_ABS_H16), HOWTO (R_C6000_SBR_U15_B, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_U15_B", /* name */ TRUE, /* partial_inplace */ 0x007fff00, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_U15_H, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_U15_H", /* name */ TRUE, /* partial_inplace */ 0x007fff00, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_U15_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_U15_W", /* name */ TRUE, /* partial_inplace */ 0x007fff00, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_S16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_S16", /* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_L16_B, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_L16_B", /* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_L16_H, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_L16_H", /* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_L16_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_L16_W", /* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ EMPTY_HOWTO (R_C6000_SBR_H16_B), EMPTY_HOWTO (R_C6000_SBR_H16_H), EMPTY_HOWTO (R_C6000_SBR_H16_W), HOWTO (R_C6000_SBR_GOT_U15_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_GOT_U15_W",/* name */ TRUE, /* partial_inplace */ 0x007fff00, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_SBR_GOT_L16_W, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ FALSE, /* pc_relative */ 7, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_SBR_GOT_L16_W",/* name */ TRUE, /* partial_inplace */ 0x007fff80, /* src_mask */ 0x007fff80, /* dst_mask */ FALSE), /* pcrel_offset */ EMPTY_HOWTO (R_C6000_SBR_GOT_H16_W), HOWTO (R_C6000_DSBT_INDEX, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 15, /* bitsize */ FALSE, /* pc_relative */ 8, /* bitpos */ complain_overflow_unsigned,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_DSBT_INDEX", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0x007fff00, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_PREL31, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 31, /* bitsize */ TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_PREL31", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0x7fffffff, /* dst_mask */ TRUE), /* pcrel_offset */ HOWTO (R_C6000_COPY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_COPY", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_JUMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_JUMP_SLOT", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_EHTYPE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_EHTYPE", /* name */ FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ FALSE), /* pcrel_offset */ EMPTY_HOWTO (R_C6000_PCR_H16), EMPTY_HOWTO (R_C6000_PCR_L16), EMPTY_HOWTO (31), EMPTY_HOWTO (32), EMPTY_HOWTO (33), EMPTY_HOWTO (34), EMPTY_HOWTO (35), EMPTY_HOWTO (36), EMPTY_HOWTO (37), EMPTY_HOWTO (38), EMPTY_HOWTO (39), EMPTY_HOWTO (40), EMPTY_HOWTO (41), EMPTY_HOWTO (42), EMPTY_HOWTO (43), EMPTY_HOWTO (44), EMPTY_HOWTO (45), EMPTY_HOWTO (46), EMPTY_HOWTO (47), EMPTY_HOWTO (48), EMPTY_HOWTO (49), EMPTY_HOWTO (50), EMPTY_HOWTO (51), EMPTY_HOWTO (52), EMPTY_HOWTO (53), EMPTY_HOWTO (54), EMPTY_HOWTO (55), EMPTY_HOWTO (56), EMPTY_HOWTO (57), EMPTY_HOWTO (58), EMPTY_HOWTO (59), EMPTY_HOWTO (60), EMPTY_HOWTO (61), EMPTY_HOWTO (62), EMPTY_HOWTO (63), EMPTY_HOWTO (64), EMPTY_HOWTO (65), EMPTY_HOWTO (66), EMPTY_HOWTO (67), EMPTY_HOWTO (68), EMPTY_HOWTO (69), EMPTY_HOWTO (70), EMPTY_HOWTO (71), EMPTY_HOWTO (72), EMPTY_HOWTO (73), EMPTY_HOWTO (74), EMPTY_HOWTO (75), EMPTY_HOWTO (76), EMPTY_HOWTO (77), EMPTY_HOWTO (78), EMPTY_HOWTO (79), EMPTY_HOWTO (80), EMPTY_HOWTO (81), EMPTY_HOWTO (82), EMPTY_HOWTO (83), EMPTY_HOWTO (84), EMPTY_HOWTO (85), EMPTY_HOWTO (86), EMPTY_HOWTO (87), EMPTY_HOWTO (88), EMPTY_HOWTO (89), EMPTY_HOWTO (90), EMPTY_HOWTO (91), EMPTY_HOWTO (92), EMPTY_HOWTO (93), EMPTY_HOWTO (94), EMPTY_HOWTO (95), EMPTY_HOWTO (96), EMPTY_HOWTO (97), EMPTY_HOWTO (98), EMPTY_HOWTO (99), EMPTY_HOWTO (100), EMPTY_HOWTO (101), EMPTY_HOWTO (102), EMPTY_HOWTO (103), EMPTY_HOWTO (104), EMPTY_HOWTO (105), EMPTY_HOWTO (106), EMPTY_HOWTO (107), EMPTY_HOWTO (108), EMPTY_HOWTO (109), EMPTY_HOWTO (110), EMPTY_HOWTO (111), EMPTY_HOWTO (112), EMPTY_HOWTO (113), EMPTY_HOWTO (114), EMPTY_HOWTO (115), EMPTY_HOWTO (116), EMPTY_HOWTO (117), EMPTY_HOWTO (118), EMPTY_HOWTO (119), EMPTY_HOWTO (120), EMPTY_HOWTO (121), EMPTY_HOWTO (122), EMPTY_HOWTO (123), EMPTY_HOWTO (124), EMPTY_HOWTO (125), EMPTY_HOWTO (126), EMPTY_HOWTO (127), EMPTY_HOWTO (128), EMPTY_HOWTO (129), EMPTY_HOWTO (130), EMPTY_HOWTO (131), EMPTY_HOWTO (132), EMPTY_HOWTO (133), EMPTY_HOWTO (134), EMPTY_HOWTO (135), EMPTY_HOWTO (136), EMPTY_HOWTO (137), EMPTY_HOWTO (138), EMPTY_HOWTO (139), EMPTY_HOWTO (140), EMPTY_HOWTO (141), EMPTY_HOWTO (142), EMPTY_HOWTO (143), EMPTY_HOWTO (144), EMPTY_HOWTO (145), EMPTY_HOWTO (146), EMPTY_HOWTO (147), EMPTY_HOWTO (148), EMPTY_HOWTO (149), EMPTY_HOWTO (150), EMPTY_HOWTO (151), EMPTY_HOWTO (152), EMPTY_HOWTO (153), EMPTY_HOWTO (154), EMPTY_HOWTO (155), EMPTY_HOWTO (156), EMPTY_HOWTO (157), EMPTY_HOWTO (158), EMPTY_HOWTO (159), EMPTY_HOWTO (160), EMPTY_HOWTO (161), EMPTY_HOWTO (162), EMPTY_HOWTO (163), EMPTY_HOWTO (164), EMPTY_HOWTO (165), EMPTY_HOWTO (166), EMPTY_HOWTO (167), EMPTY_HOWTO (168), EMPTY_HOWTO (169), EMPTY_HOWTO (170), EMPTY_HOWTO (171), EMPTY_HOWTO (172), EMPTY_HOWTO (173), EMPTY_HOWTO (174), EMPTY_HOWTO (175), EMPTY_HOWTO (176), EMPTY_HOWTO (177), EMPTY_HOWTO (178), EMPTY_HOWTO (179), EMPTY_HOWTO (180), EMPTY_HOWTO (181), EMPTY_HOWTO (182), EMPTY_HOWTO (183), EMPTY_HOWTO (184), EMPTY_HOWTO (185), EMPTY_HOWTO (186), EMPTY_HOWTO (187), EMPTY_HOWTO (188), EMPTY_HOWTO (189), EMPTY_HOWTO (190), EMPTY_HOWTO (191), EMPTY_HOWTO (192), EMPTY_HOWTO (193), EMPTY_HOWTO (194), EMPTY_HOWTO (195), EMPTY_HOWTO (196), EMPTY_HOWTO (197), EMPTY_HOWTO (198), EMPTY_HOWTO (199), EMPTY_HOWTO (200), EMPTY_HOWTO (201), EMPTY_HOWTO (202), EMPTY_HOWTO (203), EMPTY_HOWTO (204), EMPTY_HOWTO (205), EMPTY_HOWTO (206), EMPTY_HOWTO (207), EMPTY_HOWTO (208), EMPTY_HOWTO (209), EMPTY_HOWTO (210), EMPTY_HOWTO (211), EMPTY_HOWTO (212), EMPTY_HOWTO (213), EMPTY_HOWTO (214), EMPTY_HOWTO (215), EMPTY_HOWTO (216), EMPTY_HOWTO (217), EMPTY_HOWTO (218), EMPTY_HOWTO (219), EMPTY_HOWTO (220), EMPTY_HOWTO (221), EMPTY_HOWTO (222), EMPTY_HOWTO (223), EMPTY_HOWTO (224), EMPTY_HOWTO (225), EMPTY_HOWTO (226), EMPTY_HOWTO (227), EMPTY_HOWTO (228), EMPTY_HOWTO (229), EMPTY_HOWTO (230), EMPTY_HOWTO (231), EMPTY_HOWTO (232), EMPTY_HOWTO (233), EMPTY_HOWTO (234), EMPTY_HOWTO (235), EMPTY_HOWTO (236), EMPTY_HOWTO (237), EMPTY_HOWTO (238), EMPTY_HOWTO (239), EMPTY_HOWTO (240), EMPTY_HOWTO (241), EMPTY_HOWTO (242), EMPTY_HOWTO (243), EMPTY_HOWTO (244), EMPTY_HOWTO (245), EMPTY_HOWTO (246), EMPTY_HOWTO (247), EMPTY_HOWTO (248), EMPTY_HOWTO (249), EMPTY_HOWTO (250), EMPTY_HOWTO (251), EMPTY_HOWTO (252), HOWTO (R_C6000_ALIGN, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_ALIGN", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_FPHEAD, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_FPHEAD", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE), /* pcrel_offset */ HOWTO (R_C6000_NOCMP, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_C6000_NOCMP", /* name */ TRUE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ FALSE) /* pcrel_offset */ }; /* Map BFD relocations to ELF relocations. */ typedef struct { bfd_reloc_code_real_type bfd_reloc_val; enum elf_tic6x_reloc_type elf_reloc_val; } tic6x_reloc_map; static const tic6x_reloc_map elf32_tic6x_reloc_map[] = { { BFD_RELOC_NONE, R_C6000_NONE }, { BFD_RELOC_32, R_C6000_ABS32 }, { BFD_RELOC_16, R_C6000_ABS16 }, { BFD_RELOC_8, R_C6000_ABS8 }, { BFD_RELOC_C6000_PCR_S21, R_C6000_PCR_S21 }, { BFD_RELOC_C6000_PCR_S12, R_C6000_PCR_S12 }, { BFD_RELOC_C6000_PCR_S10, R_C6000_PCR_S10 }, { BFD_RELOC_C6000_PCR_S7, R_C6000_PCR_S7 }, { BFD_RELOC_C6000_ABS_S16, R_C6000_ABS_S16 }, { BFD_RELOC_C6000_ABS_L16, R_C6000_ABS_L16 }, { BFD_RELOC_C6000_ABS_H16, R_C6000_ABS_H16 }, { BFD_RELOC_C6000_SBR_U15_B, R_C6000_SBR_U15_B }, { BFD_RELOC_C6000_SBR_U15_H, R_C6000_SBR_U15_H }, { BFD_RELOC_C6000_SBR_U15_W, R_C6000_SBR_U15_W }, { BFD_RELOC_C6000_SBR_S16, R_C6000_SBR_S16 }, { BFD_RELOC_C6000_SBR_L16_B, R_C6000_SBR_L16_B }, { BFD_RELOC_C6000_SBR_L16_H, R_C6000_SBR_L16_H }, { BFD_RELOC_C6000_SBR_L16_W, R_C6000_SBR_L16_W }, { BFD_RELOC_C6000_SBR_H16_B, R_C6000_SBR_H16_B }, { BFD_RELOC_C6000_SBR_H16_H, R_C6000_SBR_H16_H }, { BFD_RELOC_C6000_SBR_H16_W, R_C6000_SBR_H16_W }, { BFD_RELOC_C6000_SBR_GOT_U15_W, R_C6000_SBR_GOT_U15_W }, { BFD_RELOC_C6000_SBR_GOT_L16_W, R_C6000_SBR_GOT_L16_W }, { BFD_RELOC_C6000_SBR_GOT_H16_W, R_C6000_SBR_GOT_H16_W }, { BFD_RELOC_C6000_DSBT_INDEX, R_C6000_DSBT_INDEX }, { BFD_RELOC_C6000_PREL31, R_C6000_PREL31 }, { BFD_RELOC_C6000_COPY, R_C6000_COPY }, { BFD_RELOC_C6000_JUMP_SLOT, R_C6000_JUMP_SLOT }, { BFD_RELOC_C6000_EHTYPE, R_C6000_EHTYPE }, { BFD_RELOC_C6000_PCR_H16, R_C6000_PCR_H16 }, { BFD_RELOC_C6000_PCR_L16, R_C6000_PCR_L16 }, { BFD_RELOC_C6000_ALIGN, R_C6000_ALIGN }, { BFD_RELOC_C6000_FPHEAD, R_C6000_FPHEAD }, { BFD_RELOC_C6000_NOCMP, R_C6000_NOCMP } }; static reloc_howto_type * elf32_tic6x_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { unsigned int i; for (i = 0; i < ARRAY_SIZE (elf32_tic6x_reloc_map); i++) if (elf32_tic6x_reloc_map[i].bfd_reloc_val == code) { enum elf_tic6x_reloc_type elf_reloc_val; reloc_howto_type *howto; elf_reloc_val = elf32_tic6x_reloc_map[i].elf_reloc_val; if (elf32_tic6x_tdata (abfd)->use_rela_p) howto = &elf32_tic6x_howto_table[elf_reloc_val]; else howto = &elf32_tic6x_howto_table_rel[elf_reloc_val]; /* Some relocations are RELA-only; do not return them for REL. */ if (howto->name == NULL) howto = NULL; return howto; } return NULL; } static reloc_howto_type * elf32_tic6x_reloc_name_lookup (bfd *abfd, const char *r_name) { if (elf32_tic6x_tdata (abfd)->use_rela_p) { unsigned int i; for (i = 0; i < ARRAY_SIZE (elf32_tic6x_howto_table); i++) if (elf32_tic6x_howto_table[i].name != NULL && strcasecmp (elf32_tic6x_howto_table[i].name, r_name) == 0) return &elf32_tic6x_howto_table[i]; } else { unsigned int i; for (i = 0; i < ARRAY_SIZE (elf32_tic6x_howto_table_rel); i++) if (elf32_tic6x_howto_table_rel[i].name != NULL && strcasecmp (elf32_tic6x_howto_table_rel[i].name, r_name) == 0) return &elf32_tic6x_howto_table_rel[i]; } return NULL; } static void elf32_tic6x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { unsigned int r_type; r_type = ELF32_R_TYPE (elf_reloc->r_info); if (r_type >= ARRAY_SIZE (elf32_tic6x_howto_table)) bfd_reloc->howto = NULL; else bfd_reloc->howto = &elf32_tic6x_howto_table[r_type]; } static void elf32_tic6x_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { unsigned int r_type; r_type = ELF32_R_TYPE (elf_reloc->r_info); if (r_type >= ARRAY_SIZE (elf32_tic6x_howto_table_rel)) bfd_reloc->howto = NULL; else bfd_reloc->howto = &elf32_tic6x_howto_table_rel[r_type]; } void elf32_tic6x_set_use_rela_p (bfd *abfd, bfd_boolean use_rela_p) { elf32_tic6x_tdata (abfd)->use_rela_p = use_rela_p; } /* Create an entry in a C6X ELF linker hash table. */ static struct bfd_hash_entry * elf32_tic6x_link_hash_newfunc (struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ if (entry == NULL) { entry = bfd_hash_allocate (table, sizeof (struct elf32_tic6x_link_hash_entry)); if (entry == NULL) return entry; } /* Call the allocation method of the superclass. */ entry = _bfd_elf_link_hash_newfunc (entry, table, string); if (entry != NULL) { struct elf32_tic6x_link_hash_entry *eh; eh = (struct elf32_tic6x_link_hash_entry *) entry; eh->dyn_relocs = NULL; } return entry; } /* Create a C6X ELF linker hash table. */ static struct bfd_link_hash_table * elf32_tic6x_link_hash_table_create (bfd *abfd) { struct elf32_tic6x_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf32_tic6x_link_hash_table); ret = bfd_zmalloc (amt); if (ret == NULL) return NULL; if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, elf32_tic6x_link_hash_newfunc, sizeof (struct elf32_tic6x_link_hash_entry), TIC6X_ELF_DATA)) { free (ret); return NULL; } ret->obfd = abfd; ret->elf.is_relocatable_executable = 1; return &ret->elf.root; } static bfd_boolean elf32_tic6x_final_link (bfd *abfd, struct bfd_link_info *info) { if (bfd_link_pic (info)) { obj_attribute *out_attr; out_attr = elf_known_obj_attributes_proc (abfd); if (out_attr[Tag_ABI_PIC].i == 0) { _bfd_error_handler (_("warning: generating a shared library " "containing non-PIC code")); } if (out_attr[Tag_ABI_PID].i == 0) { _bfd_error_handler (_("warning: generating a shared library " "containing non-PID code")); } } /* Invoke the regular ELF backend linker to do all the work. */ if (!bfd_elf_final_link (abfd, info)) return FALSE; return TRUE; } /* Called to pass PARAMS to the backend. We store them in the hash table associated with INFO. */ void elf32_tic6x_setup (struct bfd_link_info *info, struct elf32_tic6x_params *params) { struct elf32_tic6x_link_hash_table *htab = elf32_tic6x_hash_table (info); htab->params = *params; } /* Determine if we're dealing with a DSBT object. */ static bfd_boolean elf32_tic6x_using_dsbt (bfd *abfd) { return bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC, Tag_ABI_DSBT); } /* Create .plt, .rela.plt, .got, .got.plt, .rela.got and .dsbt sections in DYNOBJ, and set up shortcuts to them in our hash table. */ static bfd_boolean elf32_tic6x_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { struct elf32_tic6x_link_hash_table *htab; flagword flags; htab = elf32_tic6x_hash_table (info); if (htab == NULL) return FALSE; if (!_bfd_elf_create_dynamic_sections (dynobj, info)) return FALSE; /* Create .dsbt */ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); htab->dsbt = bfd_make_section_anyway_with_flags (dynobj, ".dsbt", flags); if (htab->dsbt == NULL || ! bfd_set_section_alignment (dynobj, htab->dsbt, 2) || ! bfd_set_section_alignment (dynobj, htab->elf.splt, 5)) return FALSE; return TRUE; } static bfd_boolean elf32_tic6x_mkobject (bfd *abfd) { bfd_boolean ret; ret = bfd_elf_allocate_object (abfd, sizeof (struct elf32_tic6x_obj_tdata), TIC6X_ELF_DATA); if (ret) elf32_tic6x_set_use_rela_p (abfd, TRUE); return ret; } /* Install relocation RELA into section SRELA, incrementing its reloc_count. */ static void elf32_tic6x_install_rela (bfd *output_bfd, asection *srela, Elf_Internal_Rela *rela) { bfd_byte *loc; bfd_vma off = srela->reloc_count++ * sizeof (Elf32_External_Rela); loc = srela->contents + off; BFD_ASSERT (off < srela->size); bfd_elf32_swap_reloca_out (output_bfd, rela, loc); } /* Create a dynamic reloc against the GOT at offset OFFSET. The contents of the GOT at this offset have been initialized with the relocation. */ static void elf32_tic6x_make_got_dynreloc (bfd *output_bfd, struct elf32_tic6x_link_hash_table *htab, asection *sym_sec, bfd_vma offset) { asection *sgot = htab->elf.sgot; Elf_Internal_Rela outrel; int dynindx; outrel.r_offset = sgot->output_section->vma + sgot->output_offset + offset; outrel.r_addend = bfd_get_32 (output_bfd, sgot->contents + offset); if (sym_sec && sym_sec->output_section && ! bfd_is_abs_section (sym_sec->output_section) && ! bfd_is_und_section (sym_sec->output_section)) { dynindx = elf_section_data (sym_sec->output_section)->dynindx; outrel.r_addend -= sym_sec->output_section->vma; } else { dynindx = 0; } outrel.r_info = ELF32_R_INFO (dynindx, R_C6000_ABS32); elf32_tic6x_install_rela (output_bfd, htab->elf.srelgot, &outrel); } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ static bfd_boolean elf32_tic6x_finish_dynamic_symbol (bfd * output_bfd, struct bfd_link_info *info, struct elf_link_hash_entry *h, Elf_Internal_Sym * sym) { struct elf32_tic6x_link_hash_table *htab; htab = elf32_tic6x_hash_table (info); if (h->plt.offset != (bfd_vma) -1) { bfd_vma plt_index; bfd_vma got_section_offset, got_dp_offset, rela_offset; Elf_Internal_Rela rela; bfd_byte *loc; asection *plt, *gotplt, *relplt; const struct elf_backend_data *bed; bed = get_elf_backend_data (output_bfd); BFD_ASSERT (htab->elf.splt != NULL); plt = htab->elf.splt; gotplt = htab->elf.sgotplt; relplt = htab->elf.srelplt; /* This symbol has an entry in the procedure linkage table. Set it up. */ if ((h->dynindx == -1 && !((h->forced_local || bfd_link_executable (info)) && h->def_regular && h->type == STT_GNU_IFUNC)) || plt == NULL || gotplt == NULL || relplt == NULL) abort (); /* Get the index in the procedure linkage table which corresponds to this symbol. This is the index of this symbol in all the symbols for which we are making plt entries. The first entry in the procedure linkage table is reserved. Get the offset into the .got table of the entry that corresponds to this function. Each .got entry is 4 bytes. The first three are reserved. For static executables, we don't reserve anything. */ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1; got_section_offset = plt_index + bed->got_header_size / 4; got_dp_offset = got_section_offset + htab->params.dsbt_size; rela_offset = plt_index * sizeof (Elf32_External_Rela); got_section_offset *= 4; /* Fill in the entry in the procedure linkage table. */ /* ldw .d2t2 *+B14($GOT(f)), b2 */ bfd_put_32 (output_bfd, got_dp_offset << 8 | 0x0100006e, plt->contents + h->plt.offset); /* mvk .s2 low(rela_offset), b0 */ bfd_put_32 (output_bfd, (rela_offset & 0xffff) << 7 | 0x0000002a, plt->contents + h->plt.offset + 4); /* mvkh .s2 high(rela_offset), b0 */ bfd_put_32 (output_bfd, ((rela_offset >> 16) & 0xffff) << 7 | 0x0000006a, plt->contents + h->plt.offset + 8); /* nop 2 */ bfd_put_32 (output_bfd, 0x00002000, plt->contents + h->plt.offset + 12); /* b .s2 b2 */ bfd_put_32 (output_bfd, 0x00080362, plt->contents + h->plt.offset + 16); /* nop 5 */ bfd_put_32 (output_bfd, 0x00008000, plt->contents + h->plt.offset + 20); /* Fill in the entry in the global offset table. */ bfd_put_32 (output_bfd, (plt->output_section->vma + plt->output_offset), gotplt->contents + got_section_offset); /* Fill in the entry in the .rel.plt section. */ rela.r_offset = (gotplt->output_section->vma + gotplt->output_offset + got_section_offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_C6000_JUMP_SLOT); rela.r_addend = 0; loc = relplt->contents + rela_offset; bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); if (!h->def_regular) { /* Mark the symbol as undefined, rather than as defined in the .plt section. */ sym->st_shndx = SHN_UNDEF; sym->st_value = 0; } } if (h->got.offset != (bfd_vma) -1) { asection *sgot; asection *srela; /* This symbol has an entry in the global offset table. Set it up. */ sgot = htab->elf.sgot; srela = htab->elf.srelgot; BFD_ASSERT (sgot != NULL && srela != NULL); /* If this is a -Bsymbolic link, and the symbol is defined locally, we just want to emit a RELATIVE reloc. Likewise if the symbol was forced to be local because of a version file. The entry in the global offset table will already have been initialized in the relocate_section function. */ if (bfd_link_pic (info) && (SYMBOLIC_BIND (info, h) || h->dynindx == -1 || h->forced_local) && h->def_regular) { asection *s = h->root.u.def.section; elf32_tic6x_make_got_dynreloc (output_bfd, htab, s, h->got.offset & ~(bfd_vma) 1); } else { Elf_Internal_Rela outrel; bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + (h->got.offset & ~(bfd_vma) 1)); outrel.r_offset = (sgot->output_section->vma + sgot->output_offset + (h->got.offset & ~(bfd_vma) 1)); outrel.r_info = ELF32_R_INFO (h->dynindx, R_C6000_ABS32); outrel.r_addend = 0; elf32_tic6x_install_rela (output_bfd, srela, &outrel); } } if (h->needs_copy) { Elf_Internal_Rela rel; asection *s; /* This symbol needs a copy reloc. Set it up. */ if (h->dynindx == -1 || (h->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) || htab->elf.srelbss == NULL || htab->elf.sreldynrelro == NULL) abort (); rel.r_offset = (h->root.u.def.value + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_C6000_COPY); rel.r_addend = 0; if (h->root.u.def.section == htab->elf.sdynrelro) s = htab->elf.sreldynrelro; else s = htab->elf.srelbss; elf32_tic6x_install_rela (output_bfd, s, &rel); } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ if (h == elf_hash_table (info)->hdynamic || h == elf_hash_table (info)->hgot) sym->st_shndx = SHN_ABS; return TRUE; } /* Unwinding tables are not referenced directly. This pass marks them as required if the corresponding code section is marked. */ static bfd_boolean elf32_tic6x_gc_mark_extra_sections (struct bfd_link_info *info, elf_gc_mark_hook_fn gc_mark_hook) { bfd *sub; Elf_Internal_Shdr **elf_shdrp; bfd_boolean again; _bfd_elf_gc_mark_extra_sections (info, gc_mark_hook); /* Marking EH data may cause additional code sections to be marked, requiring multiple passes. */ again = TRUE; while (again) { again = FALSE; for (sub = info->input_bfds; sub != NULL; sub = sub->link.next) { asection *o; if (! is_tic6x_elf (sub)) continue; elf_shdrp = elf_elfsections (sub); for (o = sub->sections; o != NULL; o = o->next) { Elf_Internal_Shdr *hdr; hdr = &elf_section_data (o)->this_hdr; if (hdr->sh_type == SHT_C6000_UNWIND && hdr->sh_link && hdr->sh_link < elf_numsections (sub) && !o->gc_mark && elf_shdrp[hdr->sh_link]->bfd_section->gc_mark) { again = TRUE; if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) return FALSE; } } } } return TRUE; } /* Return TRUE if this is an unwinding table index. */ static bfd_boolean is_tic6x_elf_unwind_section_name (const char *name) { return (CONST_STRNEQ (name, ELF_STRING_C6000_unwind) || CONST_STRNEQ (name, ELF_STRING_C6000_unwind_once)); } /* Set the type and flags for an unwinding index table. We do this by the section name, which is a hack, but ought to work. */ static bfd_boolean elf32_tic6x_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Shdr *hdr, asection *sec) { const char * name; name = bfd_get_section_name (abfd, sec); if (is_tic6x_elf_unwind_section_name (name)) { hdr->sh_type = SHT_C6000_UNWIND; hdr->sh_flags |= SHF_LINK_ORDER; } return TRUE; } /* Update the got entry reference counts for the section being removed. */ static bfd_boolean elf32_tic6x_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, asection *sec, const Elf_Internal_Rela *relocs) { struct elf32_tic6x_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; if (bfd_link_relocatable (info)) return TRUE; htab = elf32_tic6x_hash_table (info); if (htab == NULL) return FALSE; elf_section_data (sec)->local_dynrel = NULL; symtab_hdr = &elf_symtab_hdr (abfd); sym_hashes = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) { unsigned long r_symndx; unsigned int r_type; struct elf_link_hash_entry *h = NULL; r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx >= symtab_hdr->sh_info) { struct elf32_tic6x_link_hash_entry *eh; struct elf_dyn_relocs **pp; struct elf_dyn_relocs *p; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; eh = (struct elf32_tic6x_link_hash_entry *) h; for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) if (p->sec == sec) { /* Everything must go for SEC. */ *pp = p->next; break; } } r_type = ELF32_R_TYPE (rel->r_info); switch (r_type) { case R_C6000_SBR_GOT_U15_W: case R_C6000_SBR_GOT_L16_W: case R_C6000_SBR_GOT_H16_W: case R_C6000_EHTYPE: if (h != NULL) { if (h->got.refcount > 0) h->got.refcount -= 1; } else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) local_got_refcounts[r_symndx] -= 1; } break; default: break; } } return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the dynamic object, but we're not including those sections. We have to change the definition to something the rest of the link can understand. */ static bfd_boolean elf32_tic6x_adjust_dynamic_symbol (struct bfd_link_info *info, struct elf_link_hash_entry *h) { struct elf32_tic6x_link_hash_table *htab; bfd *dynobj; asection *s, *srel; dynobj = elf_hash_table (info)->dynobj; /* Make sure we know what is going on here. */ BFD_ASSERT (dynobj != NULL && (h->needs_plt || h->u.weakdef != NULL || (h->def_dynamic && h->ref_regular && !h->def_regular))); /* If this is a function, put it in the procedure linkage table. We will fill in the contents of the procedure linkage table later, when we know the address of the .got section. */ if (h->type == STT_FUNC || h->needs_plt) { if (h->plt.refcount <= 0 || SYMBOL_CALLS_LOCAL (info, h) || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic object, or if all references were garbage collected. In such a case, we don't actually need to build a procedure linkage table, and we can just do a PC32 reloc instead. */ h->plt.offset = (bfd_vma) -1; h->needs_plt = 0; } return TRUE; } /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the real definition first, and we can just use the same value. */ if (h->u.weakdef != NULL) { BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined || h->u.weakdef->root.type == bfd_link_hash_defweak); h->root.u.def.section = h->u.weakdef->root.u.def.section; h->root.u.def.value = h->u.weakdef->root.u.def.value; h->non_got_ref = h->u.weakdef->non_got_ref; return TRUE; } /* This is a reference to a symbol defined by a dynamic object which is not a function. */ /* If we are creating a shared library, we must presume that the only references to the symbol are via the global offset table. For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (bfd_link_pic (info)) return TRUE; /* If there are no references to this symbol that do not use the GOT, we don't need to generate a copy reloc. */ if (!h->non_got_ref) return TRUE; /* If -z nocopyreloc was given, we won't generate them either. */ if (info->nocopyreloc) { h->non_got_ref = 0; return TRUE; } htab = elf32_tic6x_hash_table (info); if (htab == NULL) return FALSE; /* We must allocate the symbol in our .dynbss section, which will become part of the .bss section of the executable. There will be an entry for this symbol in the .dynsym section. The dynamic object will contain position independent code, so all references from the dynamic object to this symbol will go through the global offset table. The dynamic linker will use the .dynsym entry to determine the address it must put in the global offset table, so both the dynamic object and the regular object will refer to the same memory location for the variable. */ /* We must generate a R_C6000_COPY reloc to tell the dynamic linker to copy the initial value out of the dynamic object and into the runtime process image. */ if ((h->root.u.def.section->flags & SEC_READONLY) != 0) { s = htab->elf.sdynrelro; srel = htab->elf.sreldynrelro; } else { s = htab->elf.sdynbss; srel = htab->elf.srelbss; } if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) { srel->size += sizeof (Elf32_External_Rela); h->needs_copy = 1; } return _bfd_elf_adjust_dynamic_copy (info, h, s); } static bfd_boolean elf32_tic6x_new_section_hook (bfd *abfd, asection *sec) { bfd_boolean ret; /* Allocate target specific section data. */ if (!sec->used_by_bfd) { _tic6x_elf_section_data *sdata; bfd_size_type amt = sizeof (*sdata); sdata = (_tic6x_elf_section_data *) bfd_zalloc (abfd, amt); if (sdata == NULL) return FALSE; sec->used_by_bfd = sdata; } ret = _bfd_elf_new_section_hook (abfd, sec); sec->use_rela_p = elf32_tic6x_tdata (abfd)->use_rela_p; return ret; } /* Return true if relocation REL against section SEC is a REL rather than RELA relocation. RELOCS is the first relocation in the section and ABFD is the bfd that contains SEC. */ static bfd_boolean elf32_tic6x_rel_relocation_p (bfd *abfd, asection *sec, const Elf_Internal_Rela *relocs, const Elf_Internal_Rela *rel) { Elf_Internal_Shdr *rel_hdr; const struct elf_backend_data *bed; /* To determine which flavor of relocation this is, we depend on the fact that the INPUT_SECTION's REL_HDR is read before RELA_HDR. */ rel_hdr = elf_section_data (sec)->rel.hdr; if (rel_hdr == NULL) return FALSE; bed = get_elf_backend_data (abfd); return ((size_t) (rel - relocs) < NUM_SHDR_ENTRIES (rel_hdr) * bed->s->int_rels_per_ext_rel); } /* We need dynamic symbols for every section, since segments can relocate independently. */ static bfd_boolean elf32_tic6x_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info ATTRIBUTE_UNUSED, asection *p) { switch (elf_section_data (p)->this_hdr.sh_type) { case SHT_PROGBITS: case SHT_NOBITS: /* If sh_type is yet undecided, assume it could be SHT_PROGBITS/SHT_NOBITS. */ case SHT_NULL: return FALSE; /* There shouldn't be section relative relocations against any other section. */ default: return TRUE; } } static bfd_boolean elf32_tic6x_relocate_section (bfd *output_bfd, struct bfd_link_info *info, bfd *input_bfd, asection *input_section, bfd_byte *contents, Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, asection **local_sections) { struct elf32_tic6x_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_vma *local_got_offsets; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; bfd_boolean ok = TRUE; htab = elf32_tic6x_hash_table (info); symtab_hdr = & elf_symtab_hdr (input_bfd); sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); relend = relocs + input_section->reloc_count; for (rel = relocs; rel < relend; rel ++) { int r_type; unsigned long r_symndx; arelent bfd_reloc; reloc_howto_type *howto; Elf_Internal_Sym *sym; asection *sec; struct elf_link_hash_entry *h; bfd_vma off, off2, relocation; bfd_boolean unresolved_reloc; bfd_reloc_status_type r; struct bfd_link_hash_entry *sbh; bfd_boolean is_rel; r_type = ELF32_R_TYPE (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info); is_rel = elf32_tic6x_rel_relocation_p (input_bfd, input_section, relocs, rel); if (is_rel) elf32_tic6x_info_to_howto_rel (input_bfd, &bfd_reloc, rel); else elf32_tic6x_info_to_howto (input_bfd, &bfd_reloc, rel); howto = bfd_reloc.howto; if (howto == NULL) { bfd_set_error (bfd_error_bad_value); return FALSE; } h = NULL; sym = NULL; sec = NULL; unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); } else { bfd_boolean warned, ignored; RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, r_symndx, symtab_hdr, sym_hashes, h, sec, relocation, unresolved_reloc, warned, ignored); } if (sec != NULL && discarded_section (sec)) RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, rel, 1, relend, howto, 0, contents); if (bfd_link_relocatable (info)) { if (is_rel && sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) { rel->r_addend = 0; relocation = sec->output_offset + sym->st_value; r = _bfd_relocate_contents (howto, input_bfd, relocation, contents + rel->r_offset); goto done_reloc; } continue; } switch (r_type) { case R_C6000_NONE: case R_C6000_ALIGN: case R_C6000_FPHEAD: case R_C6000_NOCMP: /* No action needed. */ continue; case R_C6000_PCR_S21: /* A branch to an undefined weak symbol is turned into a "b .s2 B3" instruction if the existing insn is of the form "b .s2 symbol". */ if (h ? h->root.type == bfd_link_hash_undefweak && (htab->elf.splt == NULL || h->plt.offset == (bfd_vma) -1) : r_symndx != STN_UNDEF && bfd_is_und_section (sec)) { unsigned long oldval; oldval = bfd_get_32 (input_bfd, contents + rel->r_offset); if ((oldval & 0x7e) == 0x12) { oldval &= 0xF0000001; bfd_put_32 (input_bfd, oldval | 0x000c0362, contents + rel->r_offset); r = bfd_reloc_ok; goto done_reloc; } } /* Fall through. */ case R_C6000_PCR_S12: case R_C6000_PCR_S10: case R_C6000_PCR_S7: if (h != NULL && h->plt.offset != (bfd_vma) -1 && htab->elf.splt != NULL) { relocation = (htab->elf.splt->output_section->vma + htab->elf.splt->output_offset + h->plt.offset); } /* Generic PC-relative handling produces a value relative to the exact location of the relocation. Adjust it to be relative to the start of the fetch packet instead. */ relocation += (input_section->output_section->vma + input_section->output_offset + rel->r_offset) & 0x1f; unresolved_reloc = FALSE; break; case R_C6000_PCR_H16: case R_C6000_PCR_L16: off = (input_section->output_section->vma + input_section->output_offset + rel->r_offset); /* These must be calculated as R = S - FP(FP(PC) - A). PC, here, is the value we just computed in OFF. RELOCATION has the address of S + A. */ relocation -= rel->r_addend; off2 = ((off & ~(bfd_vma)0x1f) - rel->r_addend) & (bfd_vma)~0x1f; off2 = relocation - off2; relocation = off + off2; break; case R_C6000_DSBT_INDEX: relocation = elf32_tic6x_hash_table (info)->params.dsbt_index; if (!bfd_link_pic (info) || relocation != 0) break; /* fall through */ case R_C6000_ABS32: case R_C6000_ABS16: case R_C6000_ABS8: case R_C6000_ABS_S16: case R_C6000_ABS_L16: case R_C6000_ABS_H16: /* When generating a shared object or relocatable executable, these relocations are copied into the output file to be resolved at run time. */ if ((bfd_link_pic (info) || elf32_tic6x_using_dsbt (output_bfd)) && (input_section->flags & SEC_ALLOC) && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT || h->root.type != bfd_link_hash_undefweak)) { Elf_Internal_Rela outrel; bfd_boolean skip, relocate; asection *sreloc; unresolved_reloc = FALSE; sreloc = elf_section_data (input_section)->sreloc; BFD_ASSERT (sreloc != NULL && sreloc->contents != NULL); skip = FALSE; relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) skip = TRUE, relocate = TRUE; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); if (skip) memset (&outrel, 0, sizeof outrel); else if (h != NULL && h->dynindx != -1 && (!bfd_link_pic (info) || !SYMBOLIC_BIND (info, h) || !h->def_regular)) { outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; } else { long indx; outrel.r_addend = relocation + rel->r_addend; if (bfd_is_abs_section (sec)) indx = 0; else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); return FALSE; } else { asection *osec; osec = sec->output_section; indx = elf_section_data (osec)->dynindx; outrel.r_addend -= osec->vma; BFD_ASSERT (indx != 0); } outrel.r_info = ELF32_R_INFO (indx, r_type); } elf32_tic6x_install_rela (output_bfd, sreloc, &outrel); /* If this reloc is against an external symbol, we do not want to fiddle with the addend. Otherwise, we need to include the symbol value so that it becomes an addend for the dynamic reloc. */ if (! relocate) continue; } /* Generic logic OK. */ break; case R_C6000_SBR_U15_B: case R_C6000_SBR_U15_H: case R_C6000_SBR_U15_W: case R_C6000_SBR_S16: case R_C6000_SBR_L16_B: case R_C6000_SBR_L16_H: case R_C6000_SBR_L16_W: case R_C6000_SBR_H16_B: case R_C6000_SBR_H16_H: case R_C6000_SBR_H16_W: sbh = bfd_link_hash_lookup (info->hash, "__c6xabi_DSBT_BASE", FALSE, FALSE, TRUE); if (sbh != NULL && (sbh->type == bfd_link_hash_defined || sbh->type == bfd_link_hash_defweak)) { if (h ? (h->root.type == bfd_link_hash_undefweak && (htab->elf.splt == NULL || h->plt.offset == (bfd_vma) -1)) : r_symndx != STN_UNDEF && bfd_is_und_section (sec)) relocation = 0; else relocation -= (sbh->u.def.value + sbh->u.def.section->output_section->vma + sbh->u.def.section->output_offset); } else { _bfd_error_handler (_("%B: SB-relative relocation but " "__c6xabi_DSBT_BASE not defined"), input_bfd); ok = FALSE; continue; } break; case R_C6000_SBR_GOT_U15_W: case R_C6000_SBR_GOT_L16_W: case R_C6000_SBR_GOT_H16_W: case R_C6000_EHTYPE: /* Relocation is to the entry for this symbol in the global offset table. */ if (htab->elf.sgot == NULL) abort (); if (h != NULL) { bfd_boolean dyn; off = h->got.offset; dyn = htab->elf.dynamic_sections_created; if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h) || (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) || (ELF_ST_VISIBILITY (h->other) && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined locally, or the symbol was forced to be local because of a version file. We must initialize this entry in the global offset table. Since the offset must always be a multiple of 4, we use the least significant bit to record whether we have initialized it already. When doing a dynamic link, we create a .rel.got relocation entry to initialize the value. This is done in the finish_dynamic_symbol routine. */ if ((off & 1) != 0) off &= ~1; else { bfd_put_32 (output_bfd, relocation, htab->elf.sgot->contents + off); h->got.offset |= 1; if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h) && !(ELF_ST_VISIBILITY (h->other) && h->root.type == bfd_link_hash_undefweak)) elf32_tic6x_make_got_dynreloc (output_bfd, htab, sec, off); } } else unresolved_reloc = FALSE; } else { if (local_got_offsets == NULL) abort (); off = local_got_offsets[r_symndx]; /* The offset must always be a multiple of 4. We use the least significant bit to record whether we have already generated the necessary reloc. */ if ((off & 1) != 0) off &= ~1; else { bfd_put_32 (output_bfd, relocation, htab->elf.sgot->contents + off); if (bfd_link_pic (info) || elf32_tic6x_using_dsbt (output_bfd)) elf32_tic6x_make_got_dynreloc (output_bfd, htab, sec, off); local_got_offsets[r_symndx] |= 1; } } if (off >= (bfd_vma) -2) abort (); if (htab->dsbt) relocation = (htab->elf.sgot->output_section->vma + htab->elf.sgot->output_offset + off - htab->dsbt->output_section->vma - htab->dsbt->output_offset); else relocation = (htab->elf.sgot->output_section->vma + htab->elf.sgot->output_offset + off - htab->elf.sgotplt->output_section->vma - htab->elf.sgotplt->output_offset); if (rel->r_addend != 0) { /* We can't do anything for a relocation which is against a symbol *plus offset*. GOT holds relocations for symbols. Make this an error; the compiler isn't allowed to pass us these kinds of things. */ if (h == NULL) _bfd_error_handler /* xgettext:c-format */ (_("%B, section %A: relocation %s with non-zero addend %d" " against local symbol"), input_bfd, input_section, elf32_tic6x_howto_table[r_type].name, rel->r_addend); else _bfd_error_handler /* xgettext:c-format */ (_("%B, section %A: relocation %s with non-zero addend %d" " against symbol `%s'"), input_bfd, input_section, elf32_tic6x_howto_table[r_type].name, rel->r_addend, h->root.root.string[0] != '\0' ? h->root.root.string : _("[whose name is lost]")); bfd_set_error (bfd_error_bad_value); return FALSE; } break; case R_C6000_PREL31: if (h != NULL && h->plt.offset != (bfd_vma) -1 && htab->elf.splt != NULL) { relocation = (htab->elf.splt->output_section->vma + htab->elf.splt->output_offset + h->plt.offset); } break; case R_C6000_COPY: /* Invalid in relocatable object. */ default: /* Unknown relocation. */ /* xgettext:c-format */ _bfd_error_handler (_("%B: invalid relocation type %d"), input_bfd, r_type); ok = FALSE; continue; } r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); done_reloc: if (r == bfd_reloc_ok && howto->complain_on_overflow == complain_overflow_bitfield) { /* Generic overflow handling accepts cases the ABI says should be rejected for R_C6000_ABS16 and R_C6000_ABS8. */ bfd_vma value = (relocation + rel->r_addend) & 0xffffffff; bfd_vma sbit = 1 << (howto->bitsize - 1); bfd_vma sbits = (-(bfd_vma) sbit) & 0xffffffff; bfd_vma value_sbits = value & sbits; if (value_sbits != 0 && value_sbits != sbit && value_sbits != sbits) r = bfd_reloc_overflow; } if (r != bfd_reloc_ok) { const char *name; const char *error_message; if (h != NULL) name = h->root.root.string; else { name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); if (name == NULL) return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } switch (r) { case bfd_reloc_overflow: /* If the overflowing reloc was to an undefined symbol, we have already printed one error message and there is no point complaining again. */ if (!h || h->root.type != bfd_link_hash_undefined) (*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset); break; case bfd_reloc_undefined: (*info->callbacks->undefined_symbol) (info, name, input_bfd, input_section, rel->r_offset, TRUE); break; case bfd_reloc_outofrange: error_message = _("out of range"); goto common_error; case bfd_reloc_notsupported: error_message = _("unsupported relocation"); goto common_error; case bfd_reloc_dangerous: error_message = _("dangerous relocation"); goto common_error; default: error_message = _("unknown error"); /* Fall through. */ common_error: BFD_ASSERT (error_message != NULL); (*info->callbacks->reloc_dangerous) (info, error_message, input_bfd, input_section, rel->r_offset); break; } } } return ok; } /* Look through the relocs for a section during the first phase, and calculate needed space in the global offset table, procedure linkage table, and dynamic reloc sections. */ static bfd_boolean elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, const Elf_Internal_Rela *relocs) { struct elf32_tic6x_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; if (bfd_link_relocatable (info)) return TRUE; htab = elf32_tic6x_hash_table (info); symtab_hdr = &elf_symtab_hdr (abfd); sym_hashes = elf_sym_hashes (abfd); /* Create dynamic sections for relocatable executables so that we can copy relocations. */ if ((bfd_link_pic (info) || elf32_tic6x_using_dsbt (abfd)) && ! htab->elf.dynamic_sections_created) { if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) return FALSE; } sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; Elf_Internal_Sym *isym; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ _bfd_error_handler (_("%B: bad symbol index: %d"), abfd, r_symndx); return FALSE; } if (r_symndx < symtab_hdr->sh_info) { /* A local symbol. */ isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); if (isym == NULL) return FALSE; h = NULL; } else { isym = NULL; h = sym_hashes[r_symndx - symtab_hdr->sh_info]; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; /* PR15323, ref flags aren't set for references in the same object. */ h->root.non_ir_ref = 1; } switch (r_type) { case R_C6000_PCR_S21: case R_C6000_PREL31: /* This symbol requires a procedure linkage table entry. We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code which is never referenced by a dynamic object, in which case we don't need to generate a procedure linkage table entry after all. */ /* If this is a local symbol, we resolve it directly without creating a procedure linkage table entry. */ if (h == NULL) continue; h->needs_plt = 1; h->plt.refcount += 1; break; case R_C6000_SBR_GOT_U15_W: case R_C6000_SBR_GOT_L16_W: case R_C6000_SBR_GOT_H16_W: case R_C6000_EHTYPE: /* This symbol requires a global offset table entry. */ if (h != NULL) { h->got.refcount += 1; } else { bfd_signed_vma *local_got_refcounts; /* This is a global offset table entry for a local symbol. */ local_got_refcounts = elf_local_got_refcounts (abfd); if (local_got_refcounts == NULL) { bfd_size_type size; size = symtab_hdr->sh_info; size *= (sizeof (bfd_signed_vma) + sizeof (bfd_vma) + sizeof(char)); local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return FALSE; elf_local_got_refcounts (abfd) = local_got_refcounts; } local_got_refcounts[r_symndx] += 1; } if (htab->elf.sgot == NULL) { if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; if (!_bfd_elf_create_got_section (htab->elf.dynobj, info)) return FALSE; } break; case R_C6000_DSBT_INDEX: /* We'd like to check for nonzero dsbt_index here, but it's set up only after check_relocs is called. Instead, we store the number of R_C6000_DSBT_INDEX relocs in the pc_count field, and potentially discard the extra space in elf32_tic6x_allocate_dynrelocs. */ if (!bfd_link_pic (info)) break; /* fall through */ case R_C6000_ABS32: case R_C6000_ABS16: case R_C6000_ABS8: case R_C6000_ABS_S16: case R_C6000_ABS_L16: case R_C6000_ABS_H16: /* If we are creating a shared library, and this is a reloc against a global symbol, or a non PC relative reloc against a local symbol, then we need to copy the reloc into the shared library. However, if we are linking with -Bsymbolic, we do not need to copy a reloc against a global symbol which is defined in an object we are including in the link (i.e., DEF_REGULAR is set). At this point we have not seen all the input files, so it is possible that DEF_REGULAR is not set now but will be set later (it is never cleared). In case of a weak definition, DEF_REGULAR may be cleared later by a strong definition in a shared library. We account for that possibility below by storing information in the relocs_copied field of the hash table entry. A similar situation occurs when creating shared libraries and symbol visibility changes render the symbol local. If on the other hand, we are creating an executable, we may need to keep relocations for symbols satisfied by a dynamic library if we manage to avoid copy relocs for the symbol. */ if ((bfd_link_pic (info) || elf32_tic6x_using_dsbt (abfd)) && (sec->flags & SEC_ALLOC) != 0) { struct elf_dyn_relocs *p; struct elf_dyn_relocs **head; /* We must copy these reloc types into the output file. Create a reloc section in dynobj and make room for this reloc. */ if (sreloc == NULL) { if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; sreloc = _bfd_elf_make_dynamic_reloc_section (sec, htab->elf.dynobj, 2, abfd, /*rela? */ TRUE); if (sreloc == NULL) return FALSE; } /* If this is a global symbol, we count the number of relocations we need for this symbol. */ if (h != NULL) { head = &((struct elf32_tic6x_link_hash_entry *) h)->dyn_relocs; } else { /* Track dynamic relocs needed for local syms too. We really need local syms available to do this easily. Oh well. */ void **vpp; asection *s; s = bfd_section_from_elf_index (abfd, isym->st_shndx); if (s == NULL) s = sec; vpp = &elf_section_data (s)->local_dynrel; head = (struct elf_dyn_relocs **)vpp; } p = *head; if (p == NULL || p->sec != sec) { bfd_size_type amt = sizeof *p; p = bfd_alloc (htab->elf.dynobj, amt); if (p == NULL) return FALSE; p->next = *head; *head = p; p->sec = sec; p->count = 0; p->pc_count = 0; } p->count += 1; if (r_type == R_C6000_DSBT_INDEX) p->pc_count += 1; } break; case R_C6000_SBR_U15_B: case R_C6000_SBR_U15_H: case R_C6000_SBR_U15_W: case R_C6000_SBR_S16: case R_C6000_SBR_L16_B: case R_C6000_SBR_L16_H: case R_C6000_SBR_L16_W: case R_C6000_SBR_H16_B: case R_C6000_SBR_H16_H: case R_C6000_SBR_H16_W: if (h != NULL && bfd_link_executable (info)) { /* For B14-relative addresses, we might need a copy reloc. */ h->non_got_ref = 1; } break; default: break; } } return TRUE; } static bfd_boolean elf32_tic6x_add_symbol_hook (bfd *abfd, struct bfd_link_info *info ATTRIBUTE_UNUSED, Elf_Internal_Sym *sym, const char **namep ATTRIBUTE_UNUSED, flagword *flagsp ATTRIBUTE_UNUSED, asection **secp, bfd_vma *valp) { switch (sym->st_shndx) { case SHN_TIC6X_SCOMMON: *secp = bfd_make_section_old_way (abfd, ".scommon"); (*secp)->flags |= SEC_IS_COMMON; *valp = sym->st_size; (void) bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value)); break; } return TRUE; } static void elf32_tic6x_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, asymbol *asym) { elf_symbol_type *elfsym; elfsym = (elf_symbol_type *) asym; switch (elfsym->internal_elf_sym.st_shndx) { case SHN_TIC6X_SCOMMON: if (tic6x_elf_scom_section.name == NULL) { /* Initialize the small common section. */ tic6x_elf_scom_section.name = ".scommon"; tic6x_elf_scom_section.flags = SEC_IS_COMMON; tic6x_elf_scom_section.output_section = &tic6x_elf_scom_section; tic6x_elf_scom_section.symbol = &tic6x_elf_scom_symbol; tic6x_elf_scom_section.symbol_ptr_ptr = &tic6x_elf_scom_symbol_ptr; tic6x_elf_scom_symbol.name = ".scommon"; tic6x_elf_scom_symbol.flags = BSF_SECTION_SYM; tic6x_elf_scom_symbol.section = &tic6x_elf_scom_section; tic6x_elf_scom_symbol_ptr = &tic6x_elf_scom_symbol; } asym->section = &tic6x_elf_scom_section; asym->value = elfsym->internal_elf_sym.st_size; break; } } static int elf32_tic6x_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED, Elf_Internal_Sym *sym, asection *input_sec, struct elf_link_hash_entry *h ATTRIBUTE_UNUSED) { /* If we see a common symbol, which implies a relocatable link, then if a symbol was small common in an input file, mark it as small common in the output file. */ if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0) sym->st_shndx = SHN_TIC6X_SCOMMON; return 1; } static bfd_boolean elf32_tic6x_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, int *retval) { if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0) { *retval = SHN_TIC6X_SCOMMON; return TRUE; } return FALSE; } /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ static bfd_boolean elf32_tic6x_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct elf32_tic6x_link_hash_table *htab; struct elf32_tic6x_link_hash_entry *eh; struct elf_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) return TRUE; eh = (struct elf32_tic6x_link_hash_entry *) h; info = (struct bfd_link_info *) inf; htab = elf32_tic6x_hash_table (info); if (htab->elf.dynamic_sections_created && h->plt.refcount > 0) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && !h->forced_local) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } if (bfd_link_pic (info) || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->elf.splt; /* If this is the first .plt entry, make room for the special first entry. */ if (s->size == 0) s->size += PLT_ENTRY_SIZE; h->plt.offset = s->size; /* If this symbol is not defined in a regular file, and we are not generating a shared library, then set the symbol to this location in the .plt. This is required to make function pointers compare as equal between the normal executable and the shared library. */ if (! bfd_link_pic (info) && !h->def_regular) { h->root.u.def.section = s; h->root.u.def.value = h->plt.offset; } /* Make room for this entry. */ s->size += PLT_ENTRY_SIZE; /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ htab->elf.sgotplt->size += 4; /* We also need to make an entry in the .rel.plt section. */ htab->elf.srelplt->size += sizeof (Elf32_External_Rela); } else { h->plt.offset = (bfd_vma) -1; h->needs_plt = 0; } } else { h->plt.offset = (bfd_vma) -1; h->needs_plt = 0; } if (h->got.refcount > 0) { asection *s; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && !h->forced_local) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } s = htab->elf.sgot; h->got.offset = s->size; s->size += 4; if (!(ELF_ST_VISIBILITY (h->other) && h->root.type == bfd_link_hash_undefweak)) htab->elf.srelgot->size += sizeof (Elf32_External_Rela); } else h->got.offset = (bfd_vma) -1; if (eh->dyn_relocs == NULL) return TRUE; /* Discard relocs on undefined weak syms with non-default visibility. */ if (bfd_link_pic (info) || elf32_tic6x_using_dsbt (htab->obfd)) { /* We use the pc_count field to hold the number of R_C6000_DSBT_INDEX relocs. */ if (htab->params.dsbt_index != 0) { struct elf_dyn_relocs **pp; for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) { p->count -= p->pc_count; p->pc_count = 0; if (p->count == 0) *pp = p->next; else pp = &p->next; } } if (eh->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak) { if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) eh->dyn_relocs = NULL; /* Make sure undefined weak symbols are output as a dynamic symbol in PIEs. */ else if (h->dynindx == -1 && !h->forced_local) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; } } } /* Finally, allocate space. */ for (p = eh->dyn_relocs; p != NULL; p = p->next) { asection *sreloc; sreloc = elf_section_data (p->sec)->sreloc; BFD_ASSERT (sreloc != NULL); sreloc->size += p->count * sizeof (Elf32_External_Rela); } return TRUE; } /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean elf32_tic6x_readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct elf32_tic6x_link_hash_entry *eh; struct elf_dyn_relocs *p; eh = (struct elf32_tic6x_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { asection *s = p->sec->output_section; if (s != NULL && (s->flags & SEC_READONLY) != 0) { struct bfd_link_info *info = (struct bfd_link_info *) inf; info->flags |= DF_TEXTREL; /* Not an error, just cut short the traversal. */ return FALSE; } } return TRUE; } /* Set the sizes of the dynamic sections. */ static bfd_boolean elf32_tic6x_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { struct elf32_tic6x_link_hash_table *htab; bfd *dynobj; asection *s; bfd_boolean relocs; bfd *ibfd; htab = elf32_tic6x_hash_table (info); dynobj = htab->elf.dynobj; if (dynobj == NULL) abort (); if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ if (bfd_link_executable (info) && !info->nointerp) { s = bfd_get_linker_section (dynobj, ".interp"); if (s == NULL) abort (); s->size = sizeof ELF_DYNAMIC_INTERPRETER; s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } } /* Set up .got offsets for local syms, and space for local dynamic relocs. */ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srel; for (s = ibfd->sections; s != NULL; s = s->next) { struct elf_dyn_relocs *p; for (p = ((struct elf_dyn_relocs *) elf_section_data (s)->local_dynrel); p != NULL; p = p->next) { if (!bfd_is_abs_section (p->sec) && bfd_is_abs_section (p->sec->output_section)) { /* Input section has been discarded, either because it is a copy of a linkonce section or due to linker script /DISCARD/, so we'll be discarding the relocs too. */ } else if (p->count != 0) { srel = elf_section_data (p->sec)->sreloc; srel->size += p->count * sizeof (Elf32_External_Rela); if ((p->sec->output_section->flags & SEC_READONLY) != 0) info->flags |= DF_TEXTREL; } } } local_got = elf_local_got_refcounts (ibfd); if (!local_got) continue; symtab_hdr = &elf_symtab_hdr (ibfd); locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; s = htab->elf.sgot; srel = htab->elf.srelgot; for (; local_got < end_local_got; ++local_got) { if (*local_got > 0) { *local_got = s->size; s->size += 4; if (bfd_link_pic (info) || elf32_tic6x_using_dsbt (output_bfd)) { srel->size += sizeof (Elf32_External_Rela); } } else *local_got = (bfd_vma) -1; } } /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, elf32_tic6x_allocate_dynrelocs, info); /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { bfd_boolean strip_section = TRUE; if ((s->flags & SEC_LINKER_CREATED) == 0) continue; if (s == htab->dsbt) s->size = 4 * htab->params.dsbt_size; else if (s == htab->elf.splt || s == htab->elf.sgot || s == htab->elf.sgotplt || s == htab->elf.sdynbss || s == htab->elf.sdynrelro) { /* Strip this section if we don't need it; see the comment below. */ /* We'd like to strip these sections if they aren't needed, but if we've exported dynamic symbols from them we must leave them. It's too late to tell BFD to get rid of the symbols. */ if (htab->elf.hplt != NULL) strip_section = FALSE; /* Round up the size of the PLT section to a multiple of 32. */ if (s == htab->elf.splt && s->size > 0) s->size = (s->size + 31) & ~(bfd_vma)31; } else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) { if (s->size != 0 && s != htab->elf.srelplt) relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ s->reloc_count = 0; } else { /* It's not one of our sections, so don't allocate space. */ continue; } if (s->size == 0) { /* If we don't need this section, strip it from the output file. This is mostly to handle .rel.bss and .rel.plt. We must create both sections in create_dynamic_sections, because they must be created before the linker maps input sections to output sections. The linker does that before adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ if (strip_section) s->flags |= SEC_EXCLUDE; continue; } if ((s->flags & SEC_HAS_CONTENTS) == 0) continue; /* Allocate memory for the section contents. We use bfd_zalloc here in case unused entries are not reclaimed before the section's contents are written out. This should not happen, but this way if it does, we get a R_C6000_NONE reloc instead of garbage. */ s->contents = bfd_zalloc (dynobj, s->size); if (s->contents == NULL) return FALSE; } if (htab->elf.dynamic_sections_created) { /* Add some entries to the .dynamic section. We fill in the values later, in elf32_tic6x_finish_dynamic_sections, but we must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ _bfd_elf_add_dynamic_entry (info, TAG, VAL) if (bfd_link_executable (info)) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; } if (!add_dynamic_entry (DT_C6000_DSBT_BASE, 0) || !add_dynamic_entry (DT_C6000_DSBT_SIZE, htab->params.dsbt_size) || !add_dynamic_entry (DT_C6000_DSBT_INDEX, htab->params.dsbt_index)) return FALSE; if (htab->elf.splt->size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) return FALSE; } if (relocs) { if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) return FALSE; /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) elf_link_hash_traverse (&htab->elf, elf32_tic6x_readonly_dynrelocs, info); if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) return FALSE; } } } #undef add_dynamic_entry return TRUE; } /* This function is called after all the input files have been read, and the input sections have been assigned to output sections. */ static bfd_boolean elf32_tic6x_always_size_sections (bfd *output_bfd, struct bfd_link_info *info) { if (elf32_tic6x_using_dsbt (output_bfd) && !bfd_link_relocatable (info) && !bfd_elf_stack_segment_size (output_bfd, info, "__stacksize", DEFAULT_STACK_SIZE)) return FALSE; return TRUE; } static bfd_boolean elf32_tic6x_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { struct elf32_tic6x_link_hash_table *htab; bfd *dynobj; asection *sdyn; htab = elf32_tic6x_hash_table (info); dynobj = htab->elf.dynobj; sdyn = bfd_get_linker_section (dynobj, ".dynamic"); if (elf_hash_table (info)->dynamic_sections_created) { Elf32_External_Dyn * dyncon; Elf32_External_Dyn * dynconend; BFD_ASSERT (sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; asection *s; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); switch (dyn.d_tag) { default: break; case DT_C6000_DSBT_BASE: s = htab->dsbt; dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset); break; case DT_PLTGOT: s = htab->elf.sgotplt; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_JMPREL: s = htab->elf.srelplt; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_PLTRELSZ: s = htab->elf.srelplt; dyn.d_un.d_val = s->size; break; } bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); } /* Fill in the first entry in the procedure linkage table. */ if (htab->elf.splt && htab->elf.splt->size > 0) { bfd_vma got_offs = (htab->elf.sgotplt->output_section->vma + htab->elf.sgotplt->output_offset - htab->dsbt->output_section->vma - htab->dsbt->output_offset) / 4; /* ldw .D2T2 *+b14[$GOT(0)],b2 */ bfd_put_32 (output_bfd, got_offs << 8 | 0x0100006e, htab->elf.splt->contents); /* ldw .D2T2 *+b14[$GOT(4)],b1 */ bfd_put_32 (output_bfd, (got_offs + 1) << 8 | 0x0080006e, htab->elf.splt->contents + 4); /* nop 3 */ bfd_put_32 (output_bfd, 0x00004000, htab->elf.splt->contents + 8); /* b .s2 b2 */ bfd_put_32 (output_bfd, 0x00080362, htab->elf.splt->contents + 12); /* nop 5 */ bfd_put_32 (output_bfd, 0x00008000, htab->elf.splt->contents + 16); elf_section_data (htab->elf.splt->output_section) ->this_hdr.sh_entsize = PLT_ENTRY_SIZE; } } return TRUE; } /* Return address for Ith PLT stub in section PLT, for relocation REL or (bfd_vma) -1 if it should not be included. */ static bfd_vma elf32_tic6x_plt_sym_val (bfd_vma i, const asection *plt, const arelent *rel ATTRIBUTE_UNUSED) { return plt->vma + (i + 1) * PLT_ENTRY_SIZE; } static int elf32_tic6x_obj_attrs_arg_type (int tag) { if (tag == Tag_ABI_compatibility) return ATTR_TYPE_FLAG_INT_VAL | ATTR_TYPE_FLAG_STR_VAL; else if (tag & 1) return ATTR_TYPE_FLAG_STR_VAL; else return ATTR_TYPE_FLAG_INT_VAL; } static int elf32_tic6x_obj_attrs_order (int num) { if (num == LEAST_KNOWN_OBJ_ATTRIBUTE) return Tag_ABI_conformance; if ((num - 1) < Tag_ABI_conformance) return num - 1; return num; } static bfd_boolean elf32_tic6x_obj_attrs_handle_unknown (bfd *abfd, int tag) { if ((tag & 127) < 64) { _bfd_error_handler /* xgettext:c-format */ (_("%B: error: unknown mandatory EABI object attribute %d"), abfd, tag); bfd_set_error (bfd_error_bad_value); return FALSE; } else { _bfd_error_handler /* xgettext:c-format */ (_("%B: warning: unknown EABI object attribute %d"), abfd, tag); return TRUE; } } /* Merge the Tag_ISA attribute values ARCH1 and ARCH2 and return the merged value. At present, all merges succeed, so no return value for errors is defined. */ int elf32_tic6x_merge_arch_attributes (int arch1, int arch2) { int min_arch, max_arch; min_arch = (arch1 < arch2 ? arch1 : arch2); max_arch = (arch1 > arch2 ? arch1 : arch2); /* In most cases, the numerically greatest value is the correct merged value, but merging C64 and C67 results in C674X. */ if ((min_arch == C6XABI_Tag_ISA_C67X || min_arch == C6XABI_Tag_ISA_C67XP) && (max_arch == C6XABI_Tag_ISA_C64X || max_arch == C6XABI_Tag_ISA_C64XP)) return C6XABI_Tag_ISA_C674X; return max_arch; } /* Convert a Tag_ABI_array_object_alignment or Tag_ABI_array_object_align_expected tag value TAG to a corresponding alignment value; return the alignment, or -1 for an unknown tag value. */ static int elf32_tic6x_tag_to_array_alignment (int tag) { switch (tag) { case 0: return 8; case 1: return 4; case 2: return 16; default: return -1; } } /* Convert a Tag_ABI_array_object_alignment or Tag_ABI_array_object_align_expected alignment ALIGN to a corresponding tag value; return the tag value. */ static int elf32_tic6x_array_alignment_to_tag (int align) { switch (align) { case 8: return 0; case 4: return 1; case 16: return 2; default: abort (); } } /* Merge attributes from IBFD and OBFD, returning TRUE if the merge succeeded, FALSE otherwise. */ static bfd_boolean elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { bfd *obfd = info->output_bfd; bfd_boolean result = TRUE; obj_attribute *in_attr; obj_attribute *out_attr; int i; int array_align_in, array_align_out, array_expect_in, array_expect_out; if (!elf_known_obj_attributes_proc (obfd)[0].i) { /* This is the first object. Copy the attributes. */ _bfd_elf_copy_obj_attributes (ibfd, obfd); out_attr = elf_known_obj_attributes_proc (obfd); /* Use the Tag_null value to indicate the attributes have been initialized. */ out_attr[0].i = 1; return TRUE; } in_attr = elf_known_obj_attributes_proc (ibfd); out_attr = elf_known_obj_attributes_proc (obfd); /* No specification yet for handling of unknown attributes, so just ignore them and handle known ones. */ if (out_attr[Tag_ABI_stack_align_preserved].i < in_attr[Tag_ABI_stack_align_needed].i) { _bfd_error_handler /* xgettext:c-format */ (_("error: %B requires more stack alignment than %B preserves"), ibfd, obfd); result = FALSE; } if (in_attr[Tag_ABI_stack_align_preserved].i < out_attr[Tag_ABI_stack_align_needed].i) { _bfd_error_handler /* xgettext:c-format */ (_("error: %B requires more stack alignment than %B preserves"), obfd, ibfd); result = FALSE; } array_align_in = elf32_tic6x_tag_to_array_alignment (in_attr[Tag_ABI_array_object_alignment].i); if (array_align_in == -1) { _bfd_error_handler (_("error: unknown Tag_ABI_array_object_alignment value in %B"), ibfd); result = FALSE; } array_align_out = elf32_tic6x_tag_to_array_alignment (out_attr[Tag_ABI_array_object_alignment].i); if (array_align_out == -1) { _bfd_error_handler (_("error: unknown Tag_ABI_array_object_alignment value in %B"), obfd); result = FALSE; } array_expect_in = elf32_tic6x_tag_to_array_alignment (in_attr[Tag_ABI_array_object_align_expected].i); if (array_expect_in == -1) { _bfd_error_handler (_("error: unknown Tag_ABI_array_object_align_expected value in %B"), ibfd); result = FALSE; } array_expect_out = elf32_tic6x_tag_to_array_alignment (out_attr[Tag_ABI_array_object_align_expected].i); if (array_expect_out == -1) { _bfd_error_handler (_("error: unknown Tag_ABI_array_object_align_expected value in %B"), obfd); result = FALSE; } if (array_align_out < array_expect_in) { _bfd_error_handler /* xgettext:c-format */ (_("error: %B requires more array alignment than %B preserves"), ibfd, obfd); result = FALSE; } if (array_align_in < array_expect_out) { _bfd_error_handler /* xgettext:c-format */ (_("error: %B requires more array alignment than %B preserves"), obfd, ibfd); result = FALSE; } for (i = LEAST_KNOWN_OBJ_ATTRIBUTE; i < NUM_KNOWN_OBJ_ATTRIBUTES; i++) { switch (i) { case Tag_ISA: out_attr[i].i = elf32_tic6x_merge_arch_attributes (in_attr[i].i, out_attr[i].i); break; case Tag_ABI_wchar_t: if (out_attr[i].i == 0) out_attr[i].i = in_attr[i].i; if (out_attr[i].i != 0 && in_attr[i].i != 0 && out_attr[i].i != in_attr[i].i) { _bfd_error_handler /* xgettext:c-format */ (_("warning: %B and %B differ in wchar_t size"), obfd, ibfd); } break; case Tag_ABI_stack_align_needed: if (out_attr[i].i < in_attr[i].i) out_attr[i].i = in_attr[i].i; break; case Tag_ABI_stack_align_preserved: if (out_attr[i].i > in_attr[i].i) out_attr[i].i = in_attr[i].i; break; case Tag_ABI_DSBT: if (out_attr[i].i != in_attr[i].i) { _bfd_error_handler /* xgettext:c-format */ (_("warning: %B and %B differ in whether code is " "compiled for DSBT"), obfd, ibfd); } break; case Tag_ABI_PIC: case Tag_ABI_PID: if (out_attr[i].i > in_attr[i].i) out_attr[i].i = in_attr[i].i; break; case Tag_ABI_array_object_alignment: if (array_align_out != -1 && array_align_in != -1 && array_align_out > array_align_in) out_attr[i].i = elf32_tic6x_array_alignment_to_tag (array_align_in); break; case Tag_ABI_array_object_align_expected: if (array_expect_out != -1 && array_expect_in != -1 && array_expect_out < array_expect_in) out_attr[i].i = elf32_tic6x_array_alignment_to_tag (array_expect_in); break; case Tag_ABI_conformance: /* Merging for this attribute is not specified. As on ARM, treat a missing attribute as no claim to conform and only merge identical values. */ if (out_attr[i].s == NULL || in_attr[i].s == NULL || strcmp (out_attr[i].s, in_attr[i].s) != 0) out_attr[i].s = NULL; break; case Tag_ABI_compatibility: /* Merged in _bfd_elf_merge_object_attributes. */ break; default: result = result && _bfd_elf_merge_unknown_attribute_low (ibfd, obfd, i); break; } if (in_attr[i].type && !out_attr[i].type) out_attr[i].type = in_attr[i].type; } /* Merge Tag_ABI_compatibility attributes and any common GNU ones. */ if (!_bfd_elf_merge_object_attributes (ibfd, info)) return FALSE; result &= _bfd_elf_merge_unknown_attribute_list (ibfd, obfd); return result; } static bfd_boolean elf32_tic6x_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { if (!_bfd_generic_verify_endian_match (ibfd, info)) return FALSE; if (! is_tic6x_elf (ibfd) || ! is_tic6x_elf (info->output_bfd)) return TRUE; if (!elf32_tic6x_merge_attributes (ibfd, info)) return FALSE; return TRUE; } /* Add a new unwind edit to the list described by HEAD, TAIL. If TINDEX is zero, adds the edit to the start of the list. (The list must be built in order of ascending TINDEX: the function's callers are primarily responsible for maintaining that condition). */ static void elf32_tic6x_add_unwind_table_edit (tic6x_unwind_table_edit **head, tic6x_unwind_table_edit **tail, tic6x_unwind_edit_type type, asection *linked_section, unsigned int tindex) { tic6x_unwind_table_edit *new_edit = (tic6x_unwind_table_edit *) xmalloc (sizeof (tic6x_unwind_table_edit)); new_edit->type = type; new_edit->linked_section = linked_section; new_edit->index = tindex; if (tindex > 0) { new_edit->next = NULL; if (*tail) (*tail)->next = new_edit; (*tail) = new_edit; if (!*head) (*head) = new_edit; } else { new_edit->next = *head; if (!*tail) *tail = new_edit; *head = new_edit; } } static _tic6x_elf_section_data * get_tic6x_elf_section_data (asection * sec) { if (sec && sec->owner && is_tic6x_elf (sec->owner)) return elf32_tic6x_section_data (sec); else return NULL; } /* Increase the size of EXIDX_SEC by ADJUST bytes. ADJUST must be negative. */ static void elf32_tic6x_adjust_exidx_size (asection *exidx_sec, int adjust) { asection *out_sec; if (!exidx_sec->rawsize) exidx_sec->rawsize = exidx_sec->size; bfd_set_section_size (exidx_sec->owner, exidx_sec, exidx_sec->size + adjust); out_sec = exidx_sec->output_section; /* Adjust size of output section. */ bfd_set_section_size (out_sec->owner, out_sec, out_sec->size +adjust); } /* Insert an EXIDX_CANTUNWIND marker at the end of a section. */ static void elf32_tic6x_insert_cantunwind_after (asection *text_sec, asection *exidx_sec) { struct _tic6x_elf_section_data *exidx_data; exidx_data = get_tic6x_elf_section_data (exidx_sec); elf32_tic6x_add_unwind_table_edit ( &exidx_data->u.exidx.unwind_edit_list, &exidx_data->u.exidx.unwind_edit_tail, INSERT_EXIDX_CANTUNWIND_AT_END, text_sec, UINT_MAX); elf32_tic6x_adjust_exidx_size (exidx_sec, 8); } /* Scan .cx6abi.exidx tables, and create a list describing edits which should be made to those tables, such that: 1. Regions without unwind data are marked with EXIDX_CANTUNWIND entries. 2. Duplicate entries are merged together (EXIDX_CANTUNWIND, or unwind codes which have been inlined into the index). If MERGE_EXIDX_ENTRIES is false, duplicate entries are not merged. The edits are applied when the tables are written (in elf32_tic6x_write_section). */ bfd_boolean elf32_tic6x_fix_exidx_coverage (asection **text_section_order, unsigned int num_text_sections, struct bfd_link_info *info, bfd_boolean merge_exidx_entries) { bfd *inp; unsigned int last_second_word = 0, i; asection *last_exidx_sec = NULL; asection *last_text_sec = NULL; int last_unwind_type = -1; /* Walk over all EXIDX sections, and create backlinks from the corrsponding text sections. */ for (inp = info->input_bfds; inp != NULL; inp = inp->link.next) { asection *sec; for (sec = inp->sections; sec != NULL; sec = sec->next) { struct bfd_elf_section_data *elf_sec = elf_section_data (sec); Elf_Internal_Shdr *hdr = &elf_sec->this_hdr; if (!hdr || hdr->sh_type != SHT_C6000_UNWIND) continue; if (elf_sec->linked_to) { Elf_Internal_Shdr *linked_hdr = &elf_section_data (elf_sec->linked_to)->this_hdr; struct _tic6x_elf_section_data *linked_sec_tic6x_data = get_tic6x_elf_section_data (linked_hdr->bfd_section); if (linked_sec_tic6x_data == NULL) continue; /* Link this .c6xabi.exidx section back from the text section it describes. */ linked_sec_tic6x_data->u.text.tic6x_exidx_sec = sec; } } } /* Walk all text sections in order of increasing VMA. Eilminate duplicate index table entries (EXIDX_CANTUNWIND and inlined unwind opcodes), and add EXIDX_CANTUNWIND entries for sections with no unwind table data. */ for (i = 0; i < num_text_sections; i++) { asection *sec = text_section_order[i]; asection *exidx_sec; struct _tic6x_elf_section_data *tic6x_data = get_tic6x_elf_section_data (sec); struct _tic6x_elf_section_data *exidx_data; bfd_byte *contents = NULL; int deleted_exidx_bytes = 0; bfd_vma j; tic6x_unwind_table_edit *unwind_edit_head = NULL; tic6x_unwind_table_edit *unwind_edit_tail = NULL; Elf_Internal_Shdr *hdr; bfd *ibfd; if (tic6x_data == NULL) continue; exidx_sec = tic6x_data->u.text.tic6x_exidx_sec; if (exidx_sec == NULL) { /* Section has no unwind data. */ if (last_unwind_type == 0 || !last_exidx_sec) continue; /* Ignore zero sized sections. */ if (sec->size == 0) continue; elf32_tic6x_insert_cantunwind_after (last_text_sec, last_exidx_sec); last_unwind_type = 0; continue; } /* Skip /DISCARD/ sections. */ if (bfd_is_abs_section (exidx_sec->output_section)) continue; hdr = &elf_section_data (exidx_sec)->this_hdr; if (hdr->sh_type != SHT_C6000_UNWIND) continue; exidx_data = get_tic6x_elf_section_data (exidx_sec); if (exidx_data == NULL) continue; ibfd = exidx_sec->owner; if (hdr->contents != NULL) contents = hdr->contents; else if (! bfd_malloc_and_get_section (ibfd, exidx_sec, &contents)) /* An error? */ continue; for (j = 0; j < hdr->sh_size; j += 8) { unsigned int second_word = bfd_get_32 (ibfd, contents + j + 4); int unwind_type; int elide = 0; /* An EXIDX_CANTUNWIND entry. */ if (second_word == 1) { if (last_unwind_type == 0) elide = 1; unwind_type = 0; } /* Inlined unwinding data. Merge if equal to previous. */ else if ((second_word & 0x80000000) != 0) { if (merge_exidx_entries && last_second_word == second_word && last_unwind_type == 1) elide = 1; unwind_type = 1; last_second_word = second_word; } /* Normal table entry. In theory we could merge these too, but duplicate entries are likely to be much less common. */ else unwind_type = 2; if (elide) { elf32_tic6x_add_unwind_table_edit (&unwind_edit_head, &unwind_edit_tail, DELETE_EXIDX_ENTRY, NULL, j / 8); deleted_exidx_bytes += 8; } last_unwind_type = unwind_type; } /* Free contents if we allocated it ourselves. */ if (contents != hdr->contents) free (contents); /* Record edits to be applied later (in elf32_tic6x_write_section). */ exidx_data->u.exidx.unwind_edit_list = unwind_edit_head; exidx_data->u.exidx.unwind_edit_tail = unwind_edit_tail; if (deleted_exidx_bytes > 0) elf32_tic6x_adjust_exidx_size (exidx_sec, -deleted_exidx_bytes); last_exidx_sec = exidx_sec; last_text_sec = sec; } /* Add terminating CANTUNWIND entry. */ if (last_exidx_sec && last_unwind_type != 0) elf32_tic6x_insert_cantunwind_after (last_text_sec, last_exidx_sec); return TRUE; } /* Add ADDEND to lower 31 bits of VAL, leaving other bits unmodified. */ static unsigned long elf32_tic6x_add_low31 (unsigned long val, bfd_vma addend) { return (val & ~0x7ffffffful) | ((val + addend) & 0x7ffffffful); } /* Copy an .c6xabi.exidx table entry, adding OFFSET to (applied) PREL31 relocations. OFFSET is in bytes, and will be scaled before encoding. */ static void elf32_tic6x_copy_exidx_entry (bfd *output_bfd, bfd_byte *to, bfd_byte *from, bfd_vma offset) { unsigned long first_word = bfd_get_32 (output_bfd, from); unsigned long second_word = bfd_get_32 (output_bfd, from + 4); offset >>= 1; /* High bit of first word is supposed to be zero. */ if ((first_word & 0x80000000ul) == 0) first_word = elf32_tic6x_add_low31 (first_word, offset); /* If the high bit of the first word is clear, and the bit pattern is not 0x1 (EXIDX_CANTUNWIND), this is an offset to an .c6xabi.extab entry. */ if ((second_word != 0x1) && ((second_word & 0x80000000ul) == 0)) second_word = elf32_tic6x_add_low31 (second_word, offset); bfd_put_32 (output_bfd, first_word, to); bfd_put_32 (output_bfd, second_word, to + 4); } /* Do the actual mangling of exception index tables. */ static bfd_boolean elf32_tic6x_write_section (bfd *output_bfd, struct bfd_link_info *link_info, asection *sec, bfd_byte *contents) { _tic6x_elf_section_data *tic6x_data; struct elf32_tic6x_link_hash_table *globals = elf32_tic6x_hash_table (link_info); bfd_vma offset = sec->output_section->vma + sec->output_offset; if (globals == NULL) return FALSE; /* If this section has not been allocated an _tic6x_elf_section_data structure then we cannot record anything. */ tic6x_data = get_tic6x_elf_section_data (sec); if (tic6x_data == NULL) return FALSE; if (tic6x_data->elf.this_hdr.sh_type != SHT_C6000_UNWIND) return FALSE; tic6x_unwind_table_edit *edit_node = tic6x_data->u.exidx.unwind_edit_list; /* Now, sec->size is the size of the section we will write. The original size (before we merged duplicate entries and inserted EXIDX_CANTUNWIND markers) was sec->rawsize. (This isn't the case if we perform no edits, then rawsize will be zero and we should use size). */ bfd_byte *edited_contents = (bfd_byte *) bfd_malloc (sec->size); unsigned int input_size = sec->rawsize ? sec->rawsize : sec->size; unsigned int in_index, out_index; bfd_vma add_to_offsets = 0; for (in_index = 0, out_index = 0; in_index * 8 < input_size || edit_node;) { if (edit_node) { unsigned int edit_index = edit_node->index; if (in_index < edit_index && in_index * 8 < input_size) { elf32_tic6x_copy_exidx_entry (output_bfd, edited_contents + out_index * 8, contents + in_index * 8, add_to_offsets); out_index++; in_index++; } else if (in_index == edit_index || (in_index * 8 >= input_size && edit_index == UINT_MAX)) { switch (edit_node->type) { case DELETE_EXIDX_ENTRY: in_index++; add_to_offsets += 8; break; case INSERT_EXIDX_CANTUNWIND_AT_END: { asection *text_sec = edit_node->linked_section; bfd_vma text_offset = text_sec->output_section->vma + text_sec->output_offset + text_sec->size; bfd_vma exidx_offset = offset + out_index * 8; unsigned long prel31_offset; /* Note: this is meant to be equivalent to an R_C6000_PREL31 relocation. These synthetic EXIDX_CANTUNWIND markers are not relocated by the usual BFD method. */ prel31_offset = ((text_offset - exidx_offset) >> 1) & 0x7ffffffful; /* First address we can't unwind. */ bfd_put_32 (output_bfd, prel31_offset, &edited_contents[out_index * 8]); /* Code for EXIDX_CANTUNWIND. */ bfd_put_32 (output_bfd, 0x1, &edited_contents[out_index * 8 + 4]); out_index++; add_to_offsets -= 8; } break; } edit_node = edit_node->next; } } else { /* No more edits, copy remaining entries verbatim. */ elf32_tic6x_copy_exidx_entry (output_bfd, edited_contents + out_index * 8, contents + in_index * 8, add_to_offsets); out_index++; in_index++; } } if (!(sec->flags & SEC_EXCLUDE) && !(sec->flags & SEC_NEVER_LOAD)) bfd_set_section_contents (output_bfd, sec->output_section, edited_contents, (file_ptr) sec->output_offset, sec->size); return TRUE; } #define TARGET_LITTLE_SYM tic6x_elf32_le_vec #define TARGET_LITTLE_NAME "elf32-tic6x-le" #define TARGET_BIG_SYM tic6x_elf32_be_vec #define TARGET_BIG_NAME "elf32-tic6x-be" #define ELF_ARCH bfd_arch_tic6x #define ELF_TARGET_ID TIC6X_ELF_DATA #define ELF_MACHINE_CODE EM_TI_C6000 #define ELF_MAXPAGESIZE 0x1000 #define bfd_elf32_bfd_reloc_type_lookup elf32_tic6x_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup elf32_tic6x_reloc_name_lookup #define bfd_elf32_bfd_merge_private_bfd_data elf32_tic6x_merge_private_bfd_data #define bfd_elf32_mkobject elf32_tic6x_mkobject #define bfd_elf32_bfd_link_hash_table_create elf32_tic6x_link_hash_table_create #define bfd_elf32_new_section_hook elf32_tic6x_new_section_hook #define elf_backend_stack_align 8 #define elf_backend_can_gc_sections 1 #define elf_backend_default_use_rela_p 1 #define elf_backend_may_use_rel_p 1 #define elf_backend_may_use_rela_p 1 #define elf_backend_obj_attrs_arg_type elf32_tic6x_obj_attrs_arg_type #define elf_backend_obj_attrs_handle_unknown elf32_tic6x_obj_attrs_handle_unknown #define elf_backend_obj_attrs_order elf32_tic6x_obj_attrs_order #define elf_backend_obj_attrs_section ".c6xabi.attributes" #define elf_backend_obj_attrs_section_type SHT_C6000_ATTRIBUTES #define elf_backend_obj_attrs_vendor "c6xabi" #define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 1 #define elf_backend_want_dynbss 1 #define elf_backend_want_dynrelro 1 #define elf_backend_plt_readonly 1 #define elf_backend_rela_normal 1 #define elf_backend_got_header_size 8 #define elf_backend_fake_sections elf32_tic6x_fake_sections #define elf_backend_gc_sweep_hook elf32_tic6x_gc_sweep_hook #define elf_backend_gc_mark_extra_sections elf32_tic6x_gc_mark_extra_sections #define elf_backend_create_dynamic_sections \ elf32_tic6x_create_dynamic_sections #define elf_backend_adjust_dynamic_symbol \ elf32_tic6x_adjust_dynamic_symbol #define elf_backend_check_relocs elf32_tic6x_check_relocs #define elf_backend_add_symbol_hook elf32_tic6x_add_symbol_hook #define elf_backend_symbol_processing elf32_tic6x_symbol_processing #define elf_backend_link_output_symbol_hook \ elf32_tic6x_link_output_symbol_hook #define elf_backend_section_from_bfd_section \ elf32_tic6x_section_from_bfd_section #define elf_backend_relocate_section elf32_tic6x_relocate_section #define elf_backend_relocs_compatible _bfd_elf_relocs_compatible #define elf_backend_finish_dynamic_symbol \ elf32_tic6x_finish_dynamic_symbol #define elf_backend_always_size_sections \ elf32_tic6x_always_size_sections #define elf_backend_size_dynamic_sections \ elf32_tic6x_size_dynamic_sections #define elf_backend_finish_dynamic_sections \ elf32_tic6x_finish_dynamic_sections #define bfd_elf32_bfd_final_link \ elf32_tic6x_final_link #define elf_backend_write_section elf32_tic6x_write_section #define elf_info_to_howto elf32_tic6x_info_to_howto #define elf_info_to_howto_rel elf32_tic6x_info_to_howto_rel #undef elf_backend_omit_section_dynsym #define elf_backend_omit_section_dynsym elf32_tic6x_link_omit_section_dynsym #define elf_backend_plt_sym_val elf32_tic6x_plt_sym_val #include "elf32-target.h" #undef elf32_bed #define elf32_bed elf32_tic6x_linux_bed #undef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM tic6x_elf32_linux_le_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-tic6x-linux-le" #undef TARGET_BIG_SYM #define TARGET_BIG_SYM tic6x_elf32_linux_be_vec #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf32-tic6x-linux-be" #undef ELF_OSABI #define ELF_OSABI ELFOSABI_C6000_LINUX #include "elf32-target.h" #undef elf32_bed #define elf32_bed elf32_tic6x_elf_bed #undef TARGET_LITTLE_SYM #define TARGET_LITTLE_SYM tic6x_elf32_c6000_le_vec #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-tic6x-elf-le" #undef TARGET_BIG_SYM #define TARGET_BIG_SYM tic6x_elf32_c6000_be_vec #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elf32-tic6x-elf-be" #undef ELF_OSABI #define ELF_OSABI ELFOSABI_C6000_ELFABI #include "elf32-target.h"
gpl-2.0
sguha-work/fiddletest
fiddles/Gauge/Pointer/Pointer-Hover-Effect._667/demo.html
604
<div id="chart-container">FusionCharts will render here</div> <!-- Sample for : Pointer Hover Effect. HLinearGauge showing Customer Satisfaction Score. Deviation from theme: # valueAbovePointer - Set to 0 # valueFontColor - Set to #ffffff # valueFontSize - Set to 14 # pointerBgColor - Set to #ffffff Attributes in pointer for hover effect: # showHoverEffect - Set to 1 # borderHoverAlpha - Set to 50 # borderHoverThickness - Set to 5 # bgHoverColor - Set to #FF0000 # bgHoverAlpha - Set to 70 -->
gpl-2.0
lbule/ALPS.L0.MP6.V3.18_LCSH6795_LWT_L_KERNEL
drivers/misc/mediatek/dispsys/mt6795/ddp_color.c
61709
#include <linux/kernel.h> #include <linux/types.h> #include <linux/xlog.h> #include <linux/spinlock.h> #include <linux/of.h> #include <linux/of_address.h> #include <mach/mt_clkmgr.h> #include "ddp_reg.h" #include "ddp_path.h" #include "ddp_drv.h" #include "ddp_color.h" #include "cmdq_def.h" // global PQ param for kernel space static DISP_PQ_PARAM g_Color_Param[2] = { { u4SHPGain:2, u4SatGain:4, u4HueAdj:{9,9,9,9}, u4SatAdj:{0,0,0,0}, u4Contrast:4, u4Brightness:4, }, { u4SHPGain:2, u4SatGain:4, u4HueAdj:{9,9,9,9}, u4SatAdj:{0,0,0,0}, u4Contrast:4, u4Brightness:4 } }; static DISP_PQ_PARAM g_Color_Cam_Param = { u4SHPGain:0, u4SatGain:4, u4HueAdj:{9,9,9,9}, u4SatAdj:{0,0,0,0}, u4Contrast:4, u4Brightness:4 }; static DISP_PQ_PARAM g_Color_Gal_Param = { u4SHPGain:2, u4SatGain:4, u4HueAdj:{9,9,9,9}, u4SatAdj:{0,0,0,0}, u4Contrast:4, u4Brightness:4, }; static DISP_PQ_DC_PARAM g_PQ_DC_Param = { param: { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0x0A, 0x30, 0x40, 0x06, 0x12, 40, 0x40, 0x80, 0x40, 0x40, 1, 0x80, 0x60, 0x80, 0x10, 0x34, 0x40, 0x40, 1, 0x80, 0xa, 0x19, 0x00, 0x20, 0, 0, 1, 2, 1, 80, 1 } }; //initialize index (because system default is 0, need fill with 0x80) static DISPLAY_PQ_T g_Color_Index = { GLOBAL_SAT : {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, //0~9 CONTRAST : {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80}, //0~9 BRIGHTNESS : {0x400,0x400,0x400,0x400,0x400,0x400,0x400,0x400,0x400,0x400}, //0~9 PARTIAL_Y : {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, PURP_TONE_S : {//hue 0~10 {//0 disable {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//1 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//2 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//3 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//4 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//5 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//6 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 7 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 8 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 9 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//10 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//11 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//12 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//13 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//14 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 15 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 16 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 17 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {// 18 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} } }, SKIN_TONE_S: { {//0 disable {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//1 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//2 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//3 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//4 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//5 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//6 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//7 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//8 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//9 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//10 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//11 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//12 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//13 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//14 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//15 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//16 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//17 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//18 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} } }, GRASS_TONE_S: { {//0 disable {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//1 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//2 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//3 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//4 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//5 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//6 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//7 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//8 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//9 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//10 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//11 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//12 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//13 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//14 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//15 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//16 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//17 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, {//18 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} } }, SKY_TONE_S: { {//0 disable {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//1 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//2 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//3 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//4 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//5 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//6 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//7 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//8 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//9 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//10 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//11 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//12 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//13 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//14 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//15 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//16 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//17 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, {//18 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} } }, PURP_TONE_H : { //hue 0~2 {0x80, 0x80, 0x80},//3 {0x80, 0x80, 0x80},//4 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80},//3 {0x80, 0x80, 0x80},//4 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80},//4 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80},//3 {0x80, 0x80, 0x80},//4 {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} }, SKIN_TONE_H: { //hue 3~16 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, GRASS_TONE_H : { // hue 17~24 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, {0x80, 0x80, 0x80, 0x80, 0x80, 0x80} }, SKY_TONE_H: { {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80}, {0x80, 0x80, 0x80} } }; int color_dbg_en = 1; #define COLOR_ERR(fmt, arg...) printk(KERN_ERR "[COLOR] " fmt "\n", ##arg) #define COLOR_DBG(fmt, arg...) \ do { if (color_dbg_en) printk(KERN_DEBUG "[COLOR] " fmt "\n", ##arg); } while (0) #define COLOR_NLOG(fmt, arg...) printk(KERN_NOTICE "[COLOR] " fmt "\n", ##arg) static ddp_module_notify g_color_cb = NULL; static DISPLAY_TDSHP_T g_TDSHP_Index; static unsigned int g_split_en = 0; static unsigned int g_split_window_x = 0xFFFF0000; static unsigned int g_split_window_y = 0xFFFF0000; static unsigned long g_color_window = 0x40106051; static unsigned long g_color0_dst_w = 0; static unsigned long g_color0_dst_h = 0; static unsigned long g_color1_dst_w = 0; static unsigned long g_color1_dst_h = 0; static int g_color_bypass = 0; static int g_tdshp_flag = 0; // 0: normal, 1: tuning mode int ncs_tuning_mode = 0; #define TDSHP_PA_BASE 0x14009000 #define TDSHP1_PA_BASE 0x1400A000 static unsigned long g_tdshp_va = 0; static unsigned long g_tdshp1_va = 0; void disp_color_set_window(unsigned int sat_upper, unsigned int sat_lower, unsigned int hue_upper, unsigned int hue_lower) { g_color_window = (sat_upper << 24) | (sat_lower << 16) | (hue_upper << 8) | (hue_lower); } /* *g_Color_Param */ DISP_PQ_PARAM * get_Color_config(int id) { return &g_Color_Param[id]; } DISP_PQ_PARAM * get_Color_Cam_config(void) { return &g_Color_Cam_Param; } DISP_PQ_PARAM * get_Color_Gal_config(void) { return &g_Color_Gal_Param; } /* *g_Color_Index */ DISPLAY_PQ_T * get_Color_index() { return &g_Color_Index; } DISPLAY_TDSHP_T *get_TDSHP_index(void) { return &g_TDSHP_Index; } static void _color_reg_set(void* __cmdq, unsigned long addr, unsigned int value) { cmdqRecHandle cmdq = (cmdqRecHandle)__cmdq; DISP_REG_SET(cmdq, addr, value); } static void _color_reg_mask(void* __cmdq, unsigned long addr, unsigned int value, unsigned int mask) { cmdqRecHandle cmdq = (cmdqRecHandle)__cmdq; DISP_REG_MASK(cmdq, addr, value, mask); } static void _color_reg_set_field(void* __cmdq, unsigned int field_mask, unsigned long addr, unsigned int value) { cmdqRecHandle cmdq = (cmdqRecHandle)__cmdq; DISP_REG_SET_FIELD(cmdq, field_mask, addr, value); } void DpEngine_COLORonInit(DISP_MODULE_ENUM module, void* __cmdq) { //printk("===================init COLOR =======================\n"); int offset = C0_OFFSET; void* cmdq = __cmdq; if (DISP_MODULE_COLOR1 == module) { offset = C1_OFFSET; } if (g_color_bypass == 0) { _color_reg_set(cmdq, DISP_COLOR_CFG_MAIN + offset,(1<<29)); //color enable _color_reg_set(cmdq, DISP_COLOR_START + offset, 0x00000001); //color start } else { _color_reg_set_field(cmdq, CFG_MAIN_FLD_COLOR_DBUF_EN, DISP_COLOR_CFG_MAIN + offset, 0x1); _color_reg_set_field(cmdq, START_FLD_DISP_COLOR_START, DISP_COLOR_START + offset, 0x1); } COLOR_DBG("DpEngine_COLORonInit(), en[%d], x[0x%x], y[0x%x] \n", g_split_en, g_split_window_x, g_split_window_y); _color_reg_set(cmdq, DISP_COLOR_DBG_CFG_MAIN + offset, g_split_en << 3); _color_reg_set(cmdq, DISP_COLOR_WIN_X_MAIN + offset, g_split_window_x); _color_reg_set(cmdq, DISP_COLOR_WIN_Y_MAIN + offset, g_split_window_y); //enable interrupt _color_reg_set(cmdq, DISP_COLOR_INTEN + offset, 0x00000007); //Set 10bit->8bit Rounding _color_reg_set(cmdq, DISP_COLOR_OUT_SEL + offset, 0x333); #if defined (CONFIG_MTK_AAL_SUPPORT) // c-boost ??? _color_reg_set(cmdq, DISP_COLOR_C_BOOST_MAIN + offset, 0xFF402280); _color_reg_set(cmdq, DISP_COLOR_C_BOOST_MAIN_2 + offset, 0x00000000); #endif } void DpEngine_COLORonConfig(DISP_MODULE_ENUM module, unsigned int srcWidth,unsigned int srcHeight, void* __cmdq) { int index = 0; unsigned int u4Temp = 0; unsigned char h_series[20]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int offset = C0_OFFSET; DISP_PQ_PARAM *pq_param_p = &g_Color_Param[COLOR_ID_0]; void* cmdq = __cmdq; if (DISP_MODULE_COLOR1 == module) { offset = C1_OFFSET; pq_param_p = &g_Color_Param[COLOR_ID_1]; } if(pq_param_p->u4SatGain>= COLOR_TUNING_INDEX || pq_param_p->u4HueAdj[PURP_TONE] >= COLOR_TUNING_INDEX || pq_param_p->u4HueAdj[SKIN_TONE] >= COLOR_TUNING_INDEX || pq_param_p->u4HueAdj[GRASS_TONE] >= COLOR_TUNING_INDEX|| pq_param_p->u4HueAdj[SKY_TONE] >= COLOR_TUNING_INDEX || pq_param_p->u4SatAdj[PURP_TONE] >= COLOR_TUNING_INDEX || pq_param_p->u4SatAdj[SKIN_TONE] >= COLOR_TUNING_INDEX || pq_param_p->u4SatAdj[GRASS_TONE] >= COLOR_TUNING_INDEX|| pq_param_p->u4SatAdj[SKY_TONE] >= COLOR_TUNING_INDEX ) { COLOR_ERR("[PQ][COLOR] Tuning index range error !\n"); return; } //COLOR_ERR("DpEngine_COLORonConfig(%d)", module); //printk("==========config COLOR g_Color_Param [%d %d %d %d %d %d %d %d %d]\n===============\n", pq_param_p->u4SatGain, pq_param_p->u4HueAdj[PURP_TONE], pq_param_p->u4HueAdj[SKIN_TONE], pq_param_p->u4HueAdj[GRASS_TONE], pq_param_p->u4HueAdj[SKY_TONE], pq_param_p->u4SatAdj[PURP_TONE], pq_param_p->u4SatAdj[SKIN_TONE], pq_param_p->u4SatAdj[GRASS_TONE], pq_param_p->u4SatAdj[SKY_TONE]); _color_reg_set(cmdq, DISP_COLOR_INTERNAL_IP_WIDTH + offset, srcWidth); //wrapper width _color_reg_set(cmdq, DISP_COLOR_INTERNAL_IP_HEIGHT + offset, srcHeight); //wrapper height if (g_color_bypass == 0) { // enable R2Y/Y2R in Color Wrapper _color_reg_set(cmdq, DISP_COLOR_CM1_EN + offset, 1); _color_reg_set(cmdq, DISP_COLOR_CM2_EN + offset, 1); } // config parameter from customer color_index.h _color_reg_set(cmdq, DISP_COLOR_G_PIC_ADJ_MAIN_1, (g_Color_Index.BRIGHTNESS[pq_param_p->u4Brightness]<<16) |g_Color_Index.CONTRAST[pq_param_p->u4Contrast]); _color_reg_set(cmdq, DISP_COLOR_G_PIC_ADJ_MAIN_2, (0x200<<16) |g_Color_Index.GLOBAL_SAT[pq_param_p->u4SatGain]); // Partial Y Function for (index = 0; index < 8; index++) { _color_reg_set(cmdq, DISP_COLOR_Y_SLOPE_1_0_MAIN + 4 * index, (g_Color_Index.PARTIAL_Y[2 * index ] | g_Color_Index.PARTIAL_Y[2 * index + 1]<<16)); } // Partial Saturation Function _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN1_0 + offset, ( g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG1][0] | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG1][1] << 8 | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG1][2] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN1_1 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][1] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][2] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][3] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN1_2 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][5] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][6] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG1][7] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG1][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN1_3 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG1][1] | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG1][2] << 8 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG1][3] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG1][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN1_4 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG1][5] | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG1][0] << 8 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG1][1] << 16 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG1][2] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN2_0 + offset, ( g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG2][0] | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG2][1] << 8 | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG2][2] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN2_1 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][1] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][2] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][3] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN2_2 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][5] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][6] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG2][7] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG2][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN2_3 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG2][1] | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG2][2] << 8 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG2][3] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG2][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN2_4 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG2][5] | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG2][0] << 8 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG2][1] << 16 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG2][2] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN3_0 + offset, ( g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG3][0] | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG3][1] << 8 | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SG3][2] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN3_1 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][1] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][2] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][3] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN3_2 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][5] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][6] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SG3][7] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG3][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN3_3 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG3][1] | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG3][2] << 8 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG3][3] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG3][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_GAIN3_4 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SG3][5] | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG3][0] << 8 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG3][1] << 16 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SG3][2] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT1_0 + offset, ( g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SP1][0] | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SP1][1] << 8 | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SP1][2] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT1_1 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][1] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][2] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][3] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT1_2 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][5] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][6] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP1][7] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP1][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT1_3 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP1][1] | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP1][2] << 8 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP1][3] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP1][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT1_4 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP1][5] | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SP1][0] << 8 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SP1][1] << 16 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SP1][2] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT2_0 + offset, ( g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SP2][0] | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SP2][1] << 8 | g_Color_Index.PURP_TONE_S[pq_param_p->u4SatAdj[PURP_TONE]][SP2][2] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT2_1 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][1] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][2] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][3] << 16 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT2_2 + offset, ( g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][5] | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][6] << 8 | g_Color_Index.SKIN_TONE_S[pq_param_p->u4SatAdj[SKIN_TONE]][SP2][7] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP2][0] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT2_3 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP2][1] | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP2][2] << 8 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP2][3] << 16 | g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP2][4] << 24 )); _color_reg_set(cmdq, DISP_COLOR_PART_SAT_POINT2_4 + offset, ( g_Color_Index.GRASS_TONE_S[pq_param_p->u4SatAdj[GRASS_TONE]][SP2][5] | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SP2][0] << 8 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SP2][1] << 16 | g_Color_Index.SKY_TONE_S[pq_param_p->u4SatAdj[SKY_TONE]][SP2][2] << 24 )); for (index = 0; index < 3; index++) { h_series[index+PURP_TONE_START] = g_Color_Index.PURP_TONE_H[pq_param_p->u4HueAdj[PURP_TONE]][index]; } for (index = 0; index < 8; index++) { h_series[index+SKIN_TONE_START] = g_Color_Index.SKIN_TONE_H[pq_param_p->u4HueAdj[SKIN_TONE]][index]; } for (index = 0; index < 6; index++) { h_series[index+GRASS_TONE_START] = g_Color_Index.GRASS_TONE_H[pq_param_p->u4HueAdj[GRASS_TONE]][index]; } for (index = 0; index < 3; index++) { h_series[index+SKY_TONE_START] = g_Color_Index.SKY_TONE_H[pq_param_p->u4HueAdj[SKY_TONE]][index]; } for (index = 0; index < 5; index++) { u4Temp = (h_series[4 * index]) + (h_series[4 * index + 1] << 8) + (h_series[4 * index + 2] << 16) + (h_series[4 * index + 3] << 24); _color_reg_set(cmdq, DISP_COLOR_LOCAL_HUE_CD_0 + offset + 4 * index, u4Temp); } // color window _color_reg_set(cmdq, DISP_COLOR_TWO_D_WINDOW_1 + offset, g_color_window); } static void color_trigger_refresh(DISP_MODULE_ENUM module) { if (g_color_cb != NULL) { g_color_cb(module, DISP_PATH_EVENT_TRIGGER); } else { COLOR_ERR("ddp listener is NULL!! \n"); } } static void ddp_color_bypass_color(DISP_MODULE_ENUM module, int bypass, void* __cmdq) { int offset = C0_OFFSET; void* cmdq = __cmdq; if (DISP_MODULE_COLOR1 == module) { offset = C1_OFFSET; } if (bypass) { _color_reg_mask(cmdq, DISP_COLOR_CFG_MAIN + offset, (1<<7), 0x00000080); //bypass all } else { _color_reg_mask(cmdq, DISP_COLOR_CFG_MAIN + offset, (0<<7), 0x00000080); //resume all } } static void ddp_color_set_window(DISP_PQ_WIN_PARAM *win_param, void* __cmdq) { const int offset = C0_OFFSET; void* cmdq = __cmdq; // save to global, can be applied on following PQ param updating. if (win_param->split_en) { g_split_en = 1; g_split_window_x = (win_param->end_x << 16) | win_param->start_x; g_split_window_y = (win_param->end_y << 16) | win_param->start_y; } else { g_split_en = 0; g_split_window_x = 0xFFFF0000; g_split_window_y = 0xFFFF0000; } COLOR_DBG("ddp_color_set_window(), en[%d], x[0x%x], y[0x%x] \n", g_split_en, g_split_window_x, g_split_window_y); _color_reg_mask(cmdq, DISP_COLOR_DBG_CFG_MAIN + offset, (g_split_en<<3), 0x00000008); //split enable _color_reg_set(cmdq, DISP_COLOR_WIN_X_MAIN + offset, g_split_window_x); _color_reg_set(cmdq, DISP_COLOR_WIN_Y_MAIN + offset, g_split_window_y); } static unsigned long color_get_TDSHP_VA(void) { unsigned long VA; struct device_node *node = NULL; node = of_find_compatible_node(NULL, NULL, "mediatek,MDP_TDSHP0"); VA = (unsigned long)of_iomap(node, 0); COLOR_DBG("TDSHP VA: 0x%lx\n", VA); return VA; } static unsigned long color_get_TDSHP1_VA(void) { unsigned long VA; struct device_node *node = NULL; node = of_find_compatible_node(NULL, NULL, "mediatek,MDP_TDSHP1"); VA = (unsigned long)of_iomap(node, 0); COLOR_DBG("TDSHP1 VA: 0x%lx\n", VA); return VA; } static unsigned int color_is_reg_addr_valid(unsigned long addr) { unsigned int i=0; for (i = 0; i < DISP_REG_NUM; i++) { if((addr >= dispsys_reg[i]) && (addr < (dispsys_reg[i] + 0x1000))) { break; } } if(i < DISP_REG_NUM) { COLOR_DBG("addr valid, addr=0x%lx, module=%s!\n", addr, ddp_get_reg_module_name(i)); return 1; } else { // check if TDSHP base address if((addr >= g_tdshp_va) && (addr < (g_tdshp_va + 0x1000))) // TDSHP0 { COLOR_DBG("addr valid, addr=0x%lx, module=%s!\n", addr, "TDSHP0"); return 2; } else if((addr >= g_tdshp1_va) && (addr < (g_tdshp1_va + 0x1000))) // TDSHP1 { COLOR_DBG("addr valid, addr=0x%lx, module=%s!\n", addr, "TDSHP1"); return 2; } else { COLOR_ERR("invalid address! addr=0x%lx!\n", addr); return 0; } } } static unsigned long color_pa2va(unsigned int addr) { unsigned int i=0; // check disp module for (i = 0; i < DISP_REG_NUM; i++) { if((addr >= ddp_reg_pa_base[i]) && (addr < (ddp_reg_pa_base[i] + 0x1000))) { COLOR_DBG("color_pa2va(), COLOR PA:0x%x, PABase[0x%x], VABase[0x%lx] \n", addr, ddp_reg_pa_base[i], dispsys_reg[i]); return dispsys_reg[i] + (addr - ddp_reg_pa_base[i]); } } // TDSHP if ((TDSHP_PA_BASE <= addr) && (addr < (TDSHP_PA_BASE + 0x1000))) { COLOR_DBG("color_pa2va(), TDSHP PA:0x%x, PABase[0x%x], VABase[0x%lx] \n", addr, TDSHP_PA_BASE, g_tdshp_va); return g_tdshp_va + (addr - TDSHP_PA_BASE); } // TDSHP1 if ((TDSHP1_PA_BASE <= addr) && (addr < (TDSHP1_PA_BASE + 0x1000))) { COLOR_DBG("color_pa2va(), TDSHP1 PA:0x%x, PABase[0x%x], VABase[0x%lx] \n", addr, TDSHP1_PA_BASE, g_tdshp1_va); return g_tdshp1_va + (addr - TDSHP1_PA_BASE); } COLOR_ERR("color_pa2va(), NO FOUND VA!! PA:0x%x, PABase[0x%x], VABase[0x%lx] \n", addr, ddp_reg_pa_base[0], dispsys_reg[0]); return 0; } static unsigned int color_read_sw_reg(unsigned int reg_id) { unsigned int ret = 0; if (reg_id >= SWREG_PQDC_BLACK_EFFECT_ENABLE && reg_id <= SWREG_PQDC_DC_ENABLE) { ret = (unsigned int)g_PQ_DC_Param.param[reg_id - SWREG_PQDC_BLACK_EFFECT_ENABLE]; return ret; } switch (reg_id) { case SWREG_COLOR_BASE_ADDRESS: { ret = ddp_reg_pa_base[DISP_REG_COLOR0]; break; } case SWREG_GAMMA_BASE_ADDRESS: { ret = ddp_reg_pa_base[DISP_REG_GAMMA]; break; } case SWREG_AAL_BASE_ADDRESS: { ret = ddp_reg_pa_base[DISP_REG_AAL]; break; } case SWREG_TDSHP_BASE_ADDRESS: { ret = TDSHP_PA_BASE; break; } case SWREG_TDSHP_TUNING_MODE: { ret = (unsigned int)g_tdshp_flag; break; } case SWREG_MIRAVISION_VERSION: { ret = MIRAVISION_VERSION; break; } case SWREG_SW_VERSION_VIDEO_DC: { ret = SW_VERSION_VIDEO_DC; break; } case SWREG_SW_VERSION_AAL: { ret = SW_VERSION_AAL; break; } default: break; } return ret; } static void color_write_sw_reg(unsigned int reg_id, unsigned int value) { if (reg_id >= SWREG_PQDC_BLACK_EFFECT_ENABLE && reg_id <= SWREG_PQDC_DC_ENABLE) { g_PQ_DC_Param.param[reg_id - SWREG_PQDC_BLACK_EFFECT_ENABLE] = (int)value; return; } switch (reg_id) { case SWREG_TDSHP_TUNING_MODE: { g_tdshp_flag = (int)value; break; } default: break; } } static int _color_clock_on(DISP_MODULE_ENUM module, void *cmq_handle) { if (module == DISP_MODULE_COLOR0) { enable_clock(MT_CG_DISP0_DISP_COLOR0 , "DDP"); COLOR_DBG("color[0]_clock_on CG 0x%x \n",DISP_REG_GET(DISP_REG_CONFIG_MMSYS_CG_CON0)); } else { enable_clock(MT_CG_DISP0_DISP_COLOR1 , "DDP"); COLOR_DBG("color[1]_clock_on CG 0x%x \n",DISP_REG_GET(DISP_REG_CONFIG_MMSYS_CG_CON0)); } return 0; } static int _color_clock_off(DISP_MODULE_ENUM module, void *cmq_handle) { if (module == DISP_MODULE_COLOR0) { COLOR_DBG("color[0]_clock_off\n"); disable_clock(MT_CG_DISP0_DISP_COLOR0, "DDP"); } else { COLOR_DBG("color[1]_clock_off\n"); disable_clock(MT_CG_DISP0_DISP_COLOR1, "DDP"); } return 0; } static int _color_init(DISP_MODULE_ENUM module, void *cmq_handle) { _color_clock_on(module, cmq_handle); g_tdshp_va = color_get_TDSHP_VA(); g_tdshp1_va = color_get_TDSHP1_VA(); return 0; } static int _color_deinit(DISP_MODULE_ENUM module, void *cmq_handle) { _color_clock_off(module, cmq_handle); return 0; } static int _color_config(DISP_MODULE_ENUM module, disp_ddp_path_config* pConfig, void *cmq_handle) { if (!pConfig->dst_dirty) { return 0; } if (module == DISP_MODULE_COLOR0) { g_color0_dst_w = pConfig->dst_w; g_color0_dst_h = pConfig->dst_h; } else { g_color1_dst_w = pConfig->dst_w; g_color1_dst_h = pConfig->dst_h; /* set bypass to COLOR1 */ { const int offset = C1_OFFSET; void* cmdq = cmq_handle; // disable R2Y/Y2R in Color Wrapper _color_reg_set(cmdq, DISP_COLOR_CM1_EN + offset, 0); _color_reg_set(cmdq, DISP_COLOR_CM2_EN + offset, 0); _color_reg_set(cmdq, DISP_COLOR_CFG_MAIN + offset,(1<<7)); // all bypass _color_reg_set(cmdq, DISP_COLOR_START + offset, 0x00000003); //color start } return 0; } DpEngine_COLORonInit(module, cmq_handle); DpEngine_COLORonConfig(module, pConfig->dst_w, pConfig->dst_h, cmq_handle); return 0; } static int _color_set_listener(DISP_MODULE_ENUM module, ddp_module_notify notify) { g_color_cb = notify; return 0; } static int _color_io(DISP_MODULE_ENUM module, int msg, unsigned long arg, void *cmdq) { int ret = 0; int value = 0; DISP_PQ_PARAM * pq_param; DISPLAY_PQ_T * pq_index; DISPLAY_TDSHP_T * tdshp_index; COLOR_DBG("_color_io: msg %x\n", msg); //COLOR_ERR("_color_io: GET_PQPARAM %lx\n", DISP_IOCTL_GET_PQPARAM); //COLOR_ERR("_color_io: SET_PQPARAM %lx\n", DISP_IOCTL_SET_PQPARAM); //COLOR_ERR("_color_io: READ_REG %lx\n", DISP_IOCTL_READ_REG); //COLOR_ERR("_color_io: WRITE_REG %lx\n", DISP_IOCTL_WRITE_REG); switch (msg) { case DISP_IOCTL_SET_PQPARAM: //case DISP_IOCTL_SET_C0_PQPARAM: pq_param = get_Color_config(COLOR_ID_0); if(copy_from_user(pq_param, (void *)arg, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_SET_PQPARAM Copy from user failed\n"); return -EFAULT; } if(ncs_tuning_mode == 0) //normal mode { DpEngine_COLORonInit(DISP_MODULE_COLOR0, cmdq); DpEngine_COLORonConfig(DISP_MODULE_COLOR0, g_color0_dst_w, g_color0_dst_h, cmdq); color_trigger_refresh(DISP_MODULE_COLOR0); COLOR_DBG("SET_PQ_PARAM(0)\n"); } else { //ncs_tuning_mode = 0; COLOR_DBG("SET_PQ_PARAM(0), bypassed by ncs_tuning_mode = 1 \n"); } break; case DISP_IOCTL_GET_PQPARAM: //case DISP_IOCTL_GET_C0_PQPARAM: pq_param = get_Color_config(COLOR_ID_0); if(copy_to_user((void *)arg, pq_param, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_GET_PQPARAM Copy to user failed\n"); return -EFAULT; } break; #if 0 case DISP_IOCTL_SET_C1_PQPARAM: pq_param = get_Color_config(COLOR_ID_1); if(copy_from_user(pq_param, (void *)arg, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_SET_PQPARAM Copy from user failed\n"); return -EFAULT; } if(ncs_tuning_mode == 0) //normal mode { DpEngine_COLORonInit(DISP_MODULE_COLOR1, cmdq); DpEngine_COLORonConfig(DISP_MODULE_COLOR1, g_color1_dst_w, g_color1_dst_h, cmdq); color_trigger_refresh(DISP_MODULE_COLOR1); COLOR_DBG("SET_PQ_PARAM(1) \n"); } else { //ncs_tuning_mode = 0; COLOR_DBG("SET_PQ_PARAM(1), bypassed by ncs_tuning_mode = 1 \n"); } break; case DISP_IOCTL_GET_C1_PQPARAM: pq_param = get_Color_config(COLOR_ID_1); if(copy_to_user((void *)arg, pq_param, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_GET_PQPARAM Copy to user failed\n"); return -EFAULT; } break; #endif case DISP_IOCTL_SET_PQINDEX: COLOR_ERR("DISP_IOCTL_SET_PQINDEX!\n"); pq_index = get_Color_index(); if(copy_from_user(pq_index, (void *)arg, sizeof(DISPLAY_PQ_T))) { COLOR_ERR("DISP_IOCTL_SET_PQINDEX Copy from user failed\n"); return -EFAULT; } break; case DISP_IOCTL_GET_PQINDEX: pq_index = get_Color_index(); if(copy_to_user((void *)arg, pq_index, sizeof(DISPLAY_PQ_T))) { COLOR_ERR("DISP_IOCTL_GET_PQPARAM Copy to user failed\n"); return -EFAULT; } break; case DISP_IOCTL_SET_TDSHPINDEX: COLOR_ERR("DISP_IOCTL_SET_TDSHPINDEX!\n"); tdshp_index = get_TDSHP_index(); if(copy_from_user(tdshp_index, (void *)arg, sizeof(DISPLAY_TDSHP_T))) { COLOR_ERR("DISP_IOCTL_SET_TDSHPINDEX Copy from user failed\n"); return -EFAULT; } break; case DISP_IOCTL_GET_TDSHPINDEX: tdshp_index = get_TDSHP_index(); if(copy_to_user((void *)arg, tdshp_index, sizeof(DISPLAY_TDSHP_T))) { COLOR_ERR("DISP_IOCTL_GET_TDSHPINDEX Copy to user failed\n"); return -EFAULT; } break; case DISP_IOCTL_SET_PQ_CAM_PARAM: pq_param = get_Color_Cam_config(); if(copy_from_user(pq_param, (void *)arg, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_SET_PQ_CAM_PARAM Copy from user failed\n"); return -EFAULT; } break; case DISP_IOCTL_GET_PQ_CAM_PARAM: pq_param = get_Color_Cam_config(); if(copy_to_user((void *)arg, pq_param, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_GET_PQ_CAM_PARAM Copy to user failed\n"); return -EFAULT; } break; case DISP_IOCTL_SET_PQ_GAL_PARAM: pq_param = get_Color_Gal_config(); if(copy_from_user(pq_param, (void *)arg, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_SET_PQ_GAL_PARAM Copy from user failed\n"); return -EFAULT; } break; case DISP_IOCTL_GET_PQ_GAL_PARAM: pq_param = get_Color_Gal_config(); if(copy_to_user((void *)arg, pq_param, sizeof(DISP_PQ_PARAM))) { COLOR_ERR("DISP_IOCTL_GET_PQ_GAL_PARAM Copy to user failed\n"); return -EFAULT; } break; case DISP_IOCTL_MUTEX_CONTROL: if(copy_from_user(&value, (void *)arg, sizeof(int))) { COLOR_ERR("DISP_IOCTL_MUTEX_CONTROL Copy from user failed\n"); return -EFAULT; } if(value == 1) { ncs_tuning_mode = 1; COLOR_DBG("ncs_tuning_mode = 1 \n"); } else if(value == 2) { ncs_tuning_mode = 0; COLOR_DBG("ncs_tuning_mode = 0 \n"); color_trigger_refresh(DISP_MODULE_COLOR0); } else { COLOR_ERR("DISP_IOCTL_MUTEX_CONTROL invalid control\n"); return -EFAULT; } COLOR_DBG("DISP_IOCTL_MUTEX_CONTROL done: %d\n", value); break; case DISP_IOCTL_READ_REG: { DISP_READ_REG rParams; unsigned long va; unsigned int pa; if(copy_from_user(&rParams, (void *)arg, sizeof(DISP_READ_REG))) { COLOR_ERR("DISP_IOCTL_READ_REG, copy_from_user failed\n"); return -EFAULT; } pa = (unsigned int)rParams.reg; va = color_pa2va(pa); if(0 == color_is_reg_addr_valid(va)) { COLOR_ERR("reg read, addr invalid, pa:0x%x(va:0x%lx) \n", pa, va); return -EFAULT; } rParams.val = (DISP_REG_GET(va)) & rParams.mask; COLOR_NLOG("read pa:0x%x(va:0x%lx) = 0x%x (0x%x)\n", pa, va, rParams.val, rParams.mask); if(copy_to_user((void*)arg, &rParams, sizeof(DISP_READ_REG))) { COLOR_ERR("DISP_IOCTL_READ_REG, copy_to_user failed\n"); return -EFAULT; } break; } case DISP_IOCTL_WRITE_REG: { DISP_WRITE_REG wParams; unsigned int ret; unsigned long va; unsigned int pa; if(copy_from_user(&wParams, (void *)arg, sizeof(DISP_WRITE_REG))) { COLOR_ERR("DISP_IOCTL_WRITE_REG, copy_from_user failed\n"); return -EFAULT; } pa = (unsigned int)wParams.reg; va = color_pa2va(pa); ret = color_is_reg_addr_valid(va); if(ret == 0) { COLOR_ERR("reg write, addr invalid, pa:0x%x(va:0x%lx) \n", pa, va); return -EFAULT; } // if TDSHP, write PA directly if (ret == 2) { if(cmdq == NULL) { mt_reg_sync_writel((unsigned int)(INREG32(va)&~(wParams.mask))|(wParams.val),(volatile unsigned long*)(va) );\ } else { //cmdqRecWrite(cmdq, TDSHP_PA_BASE + (wParams.reg - g_tdshp_va), wParams.val, wParams.mask); cmdqRecWrite(cmdq, pa, wParams.val, wParams.mask); } } else { _color_reg_mask(cmdq, va, wParams.val, wParams.mask); } COLOR_NLOG("write pa:0x%x(va:0x%lx) = 0x%x (0x%x)\n", pa, va, wParams.val, wParams.mask); break; } case DISP_IOCTL_READ_SW_REG: { DISP_READ_REG rParams; if(copy_from_user(&rParams, (void *)arg, sizeof(DISP_READ_REG))) { COLOR_ERR("DISP_IOCTL_READ_SW_REG, copy_from_user failed\n"); return -EFAULT; } if(rParams.reg > DISP_COLOR_SWREG_END || rParams.reg<DISP_COLOR_SWREG_START) { COLOR_ERR("sw reg read, addr invalid, addr min=0x%x, max=0x%x, addr=0x%x \n", DISP_COLOR_SWREG_START, DISP_COLOR_SWREG_END, rParams.reg); return -EFAULT; } rParams.val = color_read_sw_reg(rParams.reg); COLOR_NLOG("read sw reg 0x%x = 0x%x\n", rParams.reg, rParams.val); if(copy_to_user((void*)arg, &rParams, sizeof(DISP_READ_REG))) { COLOR_ERR("DISP_IOCTL_READ_SW_REG, copy_to_user failed\n"); return -EFAULT; } break; } case DISP_IOCTL_WRITE_SW_REG: { DISP_WRITE_REG wParams; if(copy_from_user(&wParams, (void *)arg, sizeof(DISP_WRITE_REG))) { COLOR_ERR("DISP_IOCTL_WRITE_SW_REG, copy_from_user failed\n"); return -EFAULT; } if(wParams.reg>DISP_COLOR_SWREG_END || wParams.reg<DISP_COLOR_SWREG_START) { COLOR_ERR("sw reg write, addr invalid, addr min=0x%x, max=0x%x, addr=0x%x \n", DISP_COLOR_SWREG_START, DISP_COLOR_SWREG_END, wParams.reg); return -EFAULT; } color_write_sw_reg(wParams.reg, wParams.val); COLOR_NLOG("write sw reg 0x%x = 0x%x \n", wParams.reg, wParams.val); break; } case DISP_IOCTL_PQ_SET_BYPASS_COLOR: if(copy_from_user(&value, (void *)arg, sizeof(int))) { COLOR_ERR("DISP_IOCTL_PQ_SET_BYPASS_COLOR Copy from user failed\n"); return -EFAULT; } ddp_color_bypass_color(DISP_MODULE_COLOR0, value, cmdq); color_trigger_refresh(DISP_MODULE_COLOR0); break; case DISP_IOCTL_PQ_SET_WINDOW: { DISP_PQ_WIN_PARAM win_param; if(copy_from_user(&win_param, (void *)arg, sizeof(DISP_PQ_WIN_PARAM))) { COLOR_ERR("DISP_IOCTL_PQ_SET_WINDOW Copy from user failed\n"); return -EFAULT; } COLOR_DBG("DISP_IOCTL_PQ_SET_WINDOW, before set... en[%d], x[0x%x], y[0x%x] \n", g_split_en, g_split_window_x, g_split_window_y); ddp_color_set_window(&win_param, cmdq); color_trigger_refresh(DISP_MODULE_COLOR0); break; } case DISP_IOCTL_PQ_GET_TDSHP_FLAG: if(copy_to_user((void *)arg, &g_tdshp_flag, sizeof(int))) { COLOR_ERR("DISP_IOCTL_PQ_GET_TDSHP_FLAG Copy to user failed\n"); return -EFAULT; } break; case DISP_IOCTL_PQ_SET_TDSHP_FLAG: if(copy_from_user(&g_tdshp_flag, (void *)arg, sizeof(int))) { COLOR_ERR("DISP_IOCTL_PQ_SET_TDSHP_FLAG Copy from user failed\n"); return -EFAULT; } break; case DISP_IOCTL_PQ_GET_DC_PARAM: if(copy_to_user((void *)arg, &g_PQ_DC_Param, sizeof(DISP_PQ_DC_PARAM))) { COLOR_ERR("DISP_IOCTL_PQ_GET_DC_PARAM Copy to user failed\n"); return -EFAULT; } break; case DISP_IOCTL_PQ_SET_DC_PARAM: if(copy_from_user(&g_PQ_DC_Param, (void *)arg, sizeof(DISP_PQ_DC_PARAM))) { COLOR_ERR("DISP_IOCTL_PQ_SET_DC_PARAM Copy from user failed\n"); return -EFAULT; } break; default: { COLOR_DBG("ioctl not supported failed\n"); return -EFAULT; } } return ret; } static int _color_bypass(DISP_MODULE_ENUM module, int bypass) { int offset = C0_OFFSET; g_color_bypass = bypass; if (DISP_MODULE_COLOR1 == module) { offset = C1_OFFSET; } //_color_reg_set(NULL, DISP_COLOR_INTERNAL_IP_WIDTH + offset, srcWidth); //wrapper width //_color_reg_set(NULL, DISP_COLOR_INTERNAL_IP_HEIGHT + offset, srcHeight); //wrapper height if (bypass) { // disable R2Y/Y2R in Color Wrapper _color_reg_set(NULL, DISP_COLOR_CM1_EN + offset, 0); _color_reg_set(NULL, DISP_COLOR_CM2_EN + offset, 0); _color_reg_set(NULL, DISP_COLOR_CFG_MAIN + offset,(1<<7)); // all bypass _color_reg_set(NULL, DISP_COLOR_START + offset, 0x00000003); //color start } else { _color_reg_set(NULL, DISP_COLOR_CFG_MAIN + offset,(1<<29)); //color enable _color_reg_set(NULL, DISP_COLOR_START + offset, 0x00000001); //color start // enable R2Y/Y2R in Color Wrapper _color_reg_set(NULL, DISP_COLOR_CM1_EN + offset, 1); _color_reg_set(NULL, DISP_COLOR_CM2_EN + offset, 1); } return 0; } static int _color_build_cmdq(DISP_MODULE_ENUM module, void *cmdq_trigger_handle, CMDQ_STATE state) { int ret = 0; if(cmdq_trigger_handle == NULL) { COLOR_ERR("cmdq_trigger_handle is NULL\n"); return -1; } // only get COLOR HIST on primary display if((module == DISP_MODULE_COLOR0) && (state == CMDQ_AFTER_STREAM_EOF)) { ret = cmdqRecReadToDataRegister(cmdq_trigger_handle, ddp_reg_pa_base[DISP_REG_COLOR0] + (DISP_COLOR_TWO_D_W1_RESULT - DISPSYS_COLOR0_BASE), CMDQ_DATA_REG_PQ_COLOR); } return ret; } DDP_MODULE_DRIVER ddp_driver_color ={ .init = _color_init, .deinit = _color_deinit, .config = _color_config, .start = NULL, .trigger = NULL, .stop = NULL, .reset = NULL, .power_on = _color_clock_on, .power_off = _color_clock_off, .is_idle = NULL, .is_busy = NULL, .dump_info = NULL, .bypass = _color_bypass, .build_cmdq = _color_build_cmdq, .set_lcm_utils = NULL, .set_listener = _color_set_listener, .cmd = _color_io, };
gpl-2.0
bobocjusz/Qemu
hw/cs4231.c
4954
/* * QEMU Crystal CS4231 audio chip emulation * * Copyright (c) 2006 Fabrice Bellard * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "sun4m.h" #include "sysbus.h" /* debug CS4231 */ //#define DEBUG_CS /* * In addition to Crystal CS4231 there is a DMA controller on Sparc. */ #define CS_SIZE 0x40 #define CS_REGS 16 #define CS_DREGS 32 #define CS_MAXDREG (CS_DREGS - 1) typedef struct CSState { SysBusDevice busdev; qemu_irq irq; uint32_t regs[CS_REGS]; uint8_t dregs[CS_DREGS]; } CSState; #define CS_RAP(s) ((s)->regs[0] & CS_MAXDREG) #define CS_VER 0xa0 #define CS_CDC_VER 0x8a #ifdef DEBUG_CS #define DPRINTF(fmt, ...) \ do { printf("CS: " fmt , ## __VA_ARGS__); } while (0) #else #define DPRINTF(fmt, ...) #endif static void cs_reset(void *opaque) { CSState *s = opaque; memset(s->regs, 0, CS_REGS * 4); memset(s->dregs, 0, CS_DREGS); s->dregs[12] = CS_CDC_VER; s->dregs[25] = CS_VER; } static uint32_t cs_mem_readl(void *opaque, target_phys_addr_t addr) { CSState *s = opaque; uint32_t saddr, ret; saddr = addr >> 2; switch (saddr) { case 1: switch (CS_RAP(s)) { case 3: // Write only ret = 0; break; default: ret = s->dregs[CS_RAP(s)]; break; } DPRINTF("read dreg[%d]: 0x%8.8x\n", CS_RAP(s), ret); break; default: ret = s->regs[saddr]; DPRINTF("read reg[%d]: 0x%8.8x\n", saddr, ret); break; } return ret; } static void cs_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val) { CSState *s = opaque; uint32_t saddr; saddr = addr >> 2; DPRINTF("write reg[%d]: 0x%8.8x -> 0x%8.8x\n", saddr, s->regs[saddr], val); switch (saddr) { case 1: DPRINTF("write dreg[%d]: 0x%2.2x -> 0x%2.2x\n", CS_RAP(s), s->dregs[CS_RAP(s)], val); switch(CS_RAP(s)) { case 11: case 25: // Read only break; case 12: val &= 0x40; val |= CS_CDC_VER; // Codec version s->dregs[CS_RAP(s)] = val; break; default: s->dregs[CS_RAP(s)] = val; break; } break; case 2: // Read only break; case 4: if (val & 1) cs_reset(s); val &= 0x7f; s->regs[saddr] = val; break; default: s->regs[saddr] = val; break; } } static CPUReadMemoryFunc *cs_mem_read[3] = { cs_mem_readl, cs_mem_readl, cs_mem_readl, }; static CPUWriteMemoryFunc *cs_mem_write[3] = { cs_mem_writel, cs_mem_writel, cs_mem_writel, }; static void cs_save(QEMUFile *f, void *opaque) { CSState *s = opaque; unsigned int i; for (i = 0; i < CS_REGS; i++) qemu_put_be32s(f, &s->regs[i]); qemu_put_buffer(f, s->dregs, CS_DREGS); } static int cs_load(QEMUFile *f, void *opaque, int version_id) { CSState *s = opaque; unsigned int i; if (version_id > 1) return -EINVAL; for (i = 0; i < CS_REGS; i++) qemu_get_be32s(f, &s->regs[i]); qemu_get_buffer(f, s->dregs, CS_DREGS); return 0; } static void cs4231_init1(SysBusDevice *dev) { int io; CSState *s = FROM_SYSBUS(CSState, dev); io = cpu_register_io_memory(cs_mem_read, cs_mem_write, s); sysbus_init_mmio(dev, CS_SIZE, io); sysbus_init_irq(dev, &s->irq); register_savevm("cs4231", -1, 1, cs_save, cs_load, s); qemu_register_reset(cs_reset, s); cs_reset(s); } static SysBusDeviceInfo cs4231_info = { .init = cs4231_init1, .qdev.name = "SUNW,CS4231", .qdev.size = sizeof(CSState), .qdev.props = (Property[]) { {.name = NULL} } }; static void cs4231_register_devices(void) { sysbus_register_withprop(&cs4231_info); } device_init(cs4231_register_devices)
gpl-2.0
Shaaan/android_kernel_samsung_u8500-common
drivers/input/keyboard/nomadik-ske-keypad.c
18798
/* * Copyright (C) ST-Ericsson SA 2010 * * Author: Naveen Kumar G <naveen.gaddipati@stericsson.com> for ST-Ericsson * Author: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson * * License terms:GNU General Public License (GPL) version 2 * * Keypad controller driver for the SKE (Scroll Key Encoder) module used in * the Nomadik 8815 and Ux500 platforms. */ #include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/workqueue.h> #include <linux/spinlock.h> #include <linux/io.h> #include <linux/delay.h> #include <linux/input.h> #include <linux/slab.h> #include <linux/clk.h> #include <linux/regulator/consumer.h> #include <plat/ske.h> #include <plat/gpio.h> /* SKE_CR bits */ #define SKE_KPMLT (0x1 << 6) #define SKE_KPCN (0x7 << 3) #define SKE_KPASEN (0x1 << 2) #define SKE_KPASON (0x1 << 7) /* SKE_IMSC bits */ #define SKE_KPIMA (0x1 << 2) /* SKE_ICR bits */ #define SKE_KPICS (0x1 << 3) #define SKE_KPICA (0x1 << 2) /* SKE_RIS bits */ #define SKE_KPRISA (0x1 << 2) #define SKE_KEYPAD_ROW_SHIFT 3 #define SKE_KPD_KEYMAP_SIZE (8 * 8) /* keypad auto scan registers */ #define SKE_ASR0 0x20 #define SKE_ASR1 0x24 #define SKE_ASR2 0x28 #define SKE_ASR3 0x2C #define SKE_NUM_ASRX_REGISTERS (4) #define KEY_PRESSED_DELAY 10 /** * struct ske_keypad - data structure used by keypad driver * @irq: irq no * @reg_base: ske regsiters base address * @input: pointer to input device object * @board: keypad platform device * @keymap: matrix scan code table for keycodes * @clk: clock structure pointer * @enable: flag to enable the driver event * @regulator: pointer to the regulator used for ske kyepad * @gpio_input_irq: array for gpio irqs * @key_pressed: hold the key state * @work: delayed work variable for gpio switch * @ske_rows: rows gpio array for ske * @ske_cols: columns gpio array for ske * @gpio_row: gpio row * @gpio_col: gpio column * @gpio_work: delayed work variable for release gpio key */ struct ske_keypad { int irq; void __iomem *reg_base; struct input_dev *input; const struct ske_keypad_platform_data *board; unsigned short keymap[SKE_KPD_KEYMAP_SIZE]; struct clk *clk; spinlock_t ske_keypad_lock; bool enable; struct regulator *regulator; int gpio_input_irq[SKE_KPD_MAX_ROWS]; int key_pressed; struct delayed_work work; int ske_rows[SKE_KPD_MAX_ROWS]; int ske_cols[SKE_KPD_MAX_COLS]; int gpio_row; int gpio_col; struct delayed_work gpio_work; }; static void ske_keypad_set_bits(struct ske_keypad *keypad, u16 addr, u8 mask, u8 data) { u32 ret; spin_lock(&keypad->ske_keypad_lock); ret = readl(keypad->reg_base + addr); ret &= ~mask; ret |= data; writel(ret, keypad->reg_base + addr); spin_unlock(&keypad->ske_keypad_lock); } /* * ske_keypad_chip_init: init keypad controller configuration * * Enable Multi key press detection, auto scan mode */ static int __devinit ske_keypad_chip_init(struct ske_keypad *keypad) { u32 value; int timeout = keypad->board->debounce_ms; /* check SKE_RIS to be 0 */ while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--) cpu_relax(); if (!timeout) return -EINVAL; /* * set debounce value * keypad dbounce is configured in DBCR[15:8] * dbounce value in steps of 32/32.768 ms */ spin_lock(&keypad->ske_keypad_lock); value = readl(keypad->reg_base + SKE_DBCR); value = value & 0xff; value |= ((keypad->board->debounce_ms * 32000)/32768) << 8; writel(value, keypad->reg_base + SKE_DBCR); spin_unlock(&keypad->ske_keypad_lock); /* enable multi key detection */ ske_keypad_set_bits(keypad, SKE_CR, 0x0, SKE_KPMLT); /* * set up the number of columns * KPCN[5:3] defines no. of keypad columns to be auto scanned */ value = (keypad->board->kcol - 1) << 3; ske_keypad_set_bits(keypad, SKE_CR, SKE_KPCN, value); /* clear keypad interrupt for auto(and pending SW) scans */ ske_keypad_set_bits(keypad, SKE_ICR, 0x0, SKE_KPICA | SKE_KPICS); /* un-mask keypad interrupts */ ske_keypad_set_bits(keypad, SKE_IMSC, 0x0, SKE_KPIMA); /* enable automatic scan */ ske_keypad_set_bits(keypad, SKE_CR, 0x0, SKE_KPASEN); return 0; } static void ske_mode_enable(struct ske_keypad *keypad, bool enable) { int i; if (!enable) { writel(0, keypad->reg_base + SKE_CR); if (keypad->board->exit) keypad->board->exit(); for (i = 0; i < keypad->board->krow; i++) { enable_irq(keypad->gpio_input_irq[i]); enable_irq_wake(keypad->gpio_input_irq[i]); } clk_disable(keypad->clk); regulator_disable(keypad->regulator); } else { regulator_enable(keypad->regulator); clk_enable(keypad->clk); for (i = 0; i < keypad->board->krow; i++) { disable_irq_nosync(keypad->gpio_input_irq[i]); disable_irq_wake(keypad->gpio_input_irq[i]); } if (keypad->board->init) keypad->board->init(); ske_keypad_chip_init(keypad); } } static void ske_enable(struct ske_keypad *keypad, bool enable) { keypad->enable = enable; if (keypad->enable) { enable_irq(keypad->irq); ske_mode_enable(keypad, true); } else { ske_mode_enable(keypad, false); disable_irq(keypad->irq); } } static ssize_t ske_show_attr_enable(struct device *dev, struct device_attribute *attr, char *buf) { struct platform_device *pdev = to_platform_device(dev); struct ske_keypad *keypad = platform_get_drvdata(pdev); return sprintf(buf, "%d\n", keypad->enable); } static ssize_t ske_store_attr_enable(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct platform_device *pdev = to_platform_device(dev); struct ske_keypad *keypad = platform_get_drvdata(pdev); unsigned long val; if (strict_strtoul(buf, 0, &val)) return -EINVAL; if ((val != 0) && (val != 1)) return -EINVAL; if (keypad->enable != val) { keypad->enable = val ? true : false; ske_enable(keypad, keypad->enable); } return count; } static DEVICE_ATTR(enable, S_IWUSR | S_IRUGO, ske_show_attr_enable, ske_store_attr_enable); static struct attribute *ske_keypad_attrs[] = { &dev_attr_enable.attr, NULL, }; static struct attribute_group ske_attr_group = { .attrs = ske_keypad_attrs, }; static void ske_keypad_report(struct ske_keypad *keypad, u8 status, int col) { int row = 0, code, pos; struct input_dev *input = keypad->input; u32 ske_ris; int num_of_rows; /* find out the row */ num_of_rows = hweight8(status); do { pos = __ffs(status); row = pos; status &= ~(1 << pos); code = MATRIX_SCAN_CODE(row, col, SKE_KEYPAD_ROW_SHIFT); ske_ris = readl(keypad->reg_base + SKE_RIS); keypad->key_pressed = ske_ris & SKE_KPRISA; input_event(input, EV_MSC, MSC_SCAN, code); input_report_key(input, keypad->keymap[code], keypad->key_pressed); input_sync(input); num_of_rows--; } while (num_of_rows); } static void ske_keypad_read_data(struct ske_keypad *keypad) { u8 status; int col = 0; int ske_asr, i; /* * Read the auto scan registers * * Each SKE_ASRx (x=0 to x=3) contains two row values. * lower byte contains row value for column 2*x, * upper byte contains row value for column 2*x + 1 */ for (i = 0; i < SKE_NUM_ASRX_REGISTERS; i++) { ske_asr = readl(keypad->reg_base + SKE_ASR0 + (4 * i)); if (!ske_asr) continue; /* now that ASRx is zero, find out the coloumn x and row y */ status = ske_asr & 0xff; if (status) { col = i * 2; ske_keypad_report(keypad, status, col); } status = (ske_asr & 0xff00) >> 8; if (status) { col = (i * 2) + 1; ske_keypad_report(keypad, status, col); } } } static void ske_keypad_scan(struct ske_keypad *keypad) { int timeout = keypad->board->debounce_ms; /* disable auto scan interrupt; mask the interrupt generated */ ske_keypad_set_bits(keypad, SKE_IMSC, ~SKE_KPIMA, 0x0); ske_keypad_set_bits(keypad, SKE_ICR, 0x0, SKE_KPICA); while ((readl(keypad->reg_base + SKE_CR) & SKE_KPASON) && --timeout) cpu_relax(); /* SKEx registers are stable and can be read */ ske_keypad_read_data(keypad); /* wait until raw interrupt is clear */ while ((readl(keypad->reg_base + SKE_RIS)) && --timeout) msleep(KEY_PRESSED_DELAY); /* enable auto scan interrupts */ ske_keypad_set_bits(keypad, SKE_IMSC, 0x0, SKE_KPIMA); } static void ske_gpio_switch_work(struct work_struct *work) { struct ske_keypad *keypad = container_of(work, struct ske_keypad, work.work); ske_mode_enable(keypad, false); keypad->enable = false; } static void ske_gpio_release_work(struct work_struct *work) { int code; struct ske_keypad *keypad = container_of(work, struct ske_keypad, gpio_work.work); struct input_dev *input = keypad->input; code = MATRIX_SCAN_CODE(keypad->gpio_row, keypad->gpio_col, SKE_KEYPAD_ROW_SHIFT); input_event(input, EV_MSC, MSC_SCAN, code); input_report_key(input, keypad->keymap[code], 1); input_sync(input); input_report_key(input, keypad->keymap[code], 0); input_sync(input); } static int ske_read_get_gpio_row(struct ske_keypad *keypad) { int row; int value = 0; int ret; /* read all rows GPIO data register values */ for (row = 0; row < SKE_KPD_MAX_ROWS ; row++) { ret = gpio_get_value(keypad->ske_rows[row]); value += (1 << row) * ret; } /* get the exact row */ for (row = 0; row < keypad->board->krow; row++) { if (((1 << row) & value) == 0) return row; } return -1; } static void ske_set_cols(struct ske_keypad *keypad, int col) { int i ; int value; /* * Set all columns except the requested column * output pin as high */ for (i = 0; i < SKE_KPD_MAX_COLS; i++) { if (i == col) value = 0; else value = 1; gpio_request(keypad->ske_cols[i], "ske-kp"); gpio_direction_output(keypad->ske_cols[i], value); gpio_free(keypad->ske_cols[i]); } } static void ske_free_cols(struct ske_keypad *keypad) { int i ; for (i = 0; i < SKE_KPD_MAX_COLS; i++) { gpio_request(keypad->ske_cols[i], "ske-kp"); gpio_direction_output(keypad->ske_cols[i], 0); gpio_free(keypad->ske_cols[i]); } } static void ske_manual_scan(struct ske_keypad *keypad) { int row; int col; for (col = 0; col < keypad->board->kcol; col++) { ske_set_cols(keypad, col); row = ske_read_get_gpio_row(keypad); if (row >= 0) { keypad->key_pressed = 1; keypad->gpio_row = row; keypad->gpio_col = col; break; } } ske_free_cols(keypad); } static irqreturn_t ske_keypad_gpio_irq(int irq, void *dev_id) { struct ske_keypad *keypad = dev_id; if (!gpio_get_value(IRQ_TO_GPIO(irq))) { ske_manual_scan(keypad); if (!keypad->enable) { keypad->enable = true; ske_mode_enable(keypad, true); } /* * Schedule the work queue to change it to * report the key pressed, if it is not detected in SKE mode. */ if (keypad->key_pressed) schedule_delayed_work(&keypad->gpio_work, KEY_PRESSED_DELAY); } return IRQ_HANDLED; } static irqreturn_t ske_keypad_irq(int irq, void *dev_id) { struct ske_keypad *keypad = dev_id; cancel_delayed_work_sync(&keypad->gpio_work); cancel_delayed_work_sync(&keypad->work); ske_keypad_scan(keypad); /* * Schedule the work queue to change it to * GPIO mode, if there is no activity in SKE mode */ if (!keypad->key_pressed && keypad->enable) schedule_delayed_work(&keypad->work, keypad->board->switch_delay); return IRQ_HANDLED; } static int __devinit ske_keypad_probe(struct platform_device *pdev) { struct ske_keypad *keypad; struct resource *res = NULL; struct input_dev *input; struct clk *clk; void __iomem *reg_base; int ret = 0; int irq; int i; struct ske_keypad_platform_data *plat = pdev->dev.platform_data; if (!plat) { dev_err(&pdev->dev, "invalid keypad platform data\n"); return -EINVAL; } irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "failed to get keypad irq\n"); return -EINVAL; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (res == NULL) { dev_err(&pdev->dev, "missing platform resources\n"); return -ENXIO; } res = request_mem_region(res->start, resource_size(res), pdev->name); if (!res) { dev_err(&pdev->dev, "failed to request I/O memory\n"); return -EBUSY; } reg_base = ioremap(res->start, resource_size(res)); if (!reg_base) { dev_err(&pdev->dev, "failed to remap I/O memory\n"); ret = -ENXIO; goto out_freerequest_memregions; } clk = clk_get(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "failed to clk_get\n"); ret = PTR_ERR(clk); goto out_freeioremap; } /* resources are sane; we begin allocation */ keypad = kzalloc(sizeof(struct ske_keypad), GFP_KERNEL); if (!keypad) { dev_err(&pdev->dev, "failed to allocate keypad memory\n"); goto out_freeclk; } input = input_allocate_device(); if (!input) { dev_err(&pdev->dev, "failed to input_allocate_device\n"); ret = -ENOMEM; goto out_freekeypad; } keypad->regulator = regulator_get(&pdev->dev, "v-ape"); if (IS_ERR(keypad->regulator)) { dev_err(&pdev->dev, "regulator_get failed\n"); keypad->regulator = NULL; goto out_regulator_get; } else { ret = regulator_enable(keypad->regulator); if (ret < 0) { dev_err(&pdev->dev, "regulator_enable failed\n"); goto out_regulator_enable; } } input->id.bustype = BUS_HOST; input->name = "ux500-ske-keypad"; input->dev.parent = &pdev->dev; input->keycode = keypad->keymap; input->keycodesize = sizeof(keypad->keymap[0]); input->keycodemax = ARRAY_SIZE(keypad->keymap); input_set_capability(input, EV_MSC, MSC_SCAN); input_set_drvdata(input, keypad); __set_bit(EV_KEY, input->evbit); if (!plat->no_autorepeat) __set_bit(EV_REP, input->evbit); matrix_keypad_build_keymap(plat->keymap_data, SKE_KEYPAD_ROW_SHIFT, input->keycode, input->keybit); ret = input_register_device(input); if (ret) { dev_err(&pdev->dev, "unable to register input device: %d\n", ret); goto out_freeinput; } keypad->irq = irq; keypad->board = plat; keypad->input = input; keypad->reg_base = reg_base; keypad->clk = clk; INIT_DELAYED_WORK(&keypad->work, ske_gpio_switch_work); INIT_DELAYED_WORK(&keypad->gpio_work, ske_gpio_release_work); /* allocations are sane, we begin HW initialization */ clk_enable(keypad->clk); if (!keypad->board->init) { dev_err(&pdev->dev, "init funtion not defined\n"); ret = -EINVAL; goto out_unregisterinput; } if (keypad->board->init() < 0) { dev_err(&pdev->dev, "keyboard init config failed\n"); ret = -EINVAL; goto out_unregisterinput; } if (!keypad->board->exit) { dev_err(&pdev->dev, "exit funtion not defined\n"); ret = -EINVAL; goto out_unregisterinput; } if (keypad->board->exit() < 0) { dev_err(&pdev->dev, "keyboard exit config failed\n"); ret = -EINVAL; goto out_unregisterinput; } for (i = 0; i < SKE_KPD_MAX_ROWS; i++) { keypad->ske_rows[i] = *plat->gpio_input_pins; keypad->ske_cols[i] = *plat->gpio_output_pins; keypad->gpio_input_irq[i] = GPIO_TO_IRQ(keypad->ske_rows[i]); plat->gpio_input_pins++; plat->gpio_output_pins++; } for (i = 0; i < keypad->board->krow; i++) { ret = request_threaded_irq(keypad->gpio_input_irq[i], NULL, ske_keypad_gpio_irq, IRQF_TRIGGER_FALLING | IRQF_NO_SUSPEND, "ske-keypad-gpio", keypad); if (ret) { dev_err(&pdev->dev, "allocate gpio irq %d failed\n", keypad->gpio_input_irq[i]); goto out_unregisterinput; } enable_irq_wake(keypad->gpio_input_irq[i]); } ret = request_threaded_irq(keypad->irq, NULL, ske_keypad_irq, IRQF_ONESHOT, "ske-keypad", keypad); if (ret) { dev_err(&pdev->dev, "allocate irq %d failed\n", keypad->irq); goto out_unregisterinput; } /* sysfs implementation for dynamic enable/disable the input event */ ret = sysfs_create_group(&pdev->dev.kobj, &ske_attr_group); if (ret) { dev_err(&pdev->dev, "failed to create sysfs entries\n"); goto out_free_irq; } if (plat->wakeup_enable) device_init_wakeup(&pdev->dev, true); platform_set_drvdata(pdev, keypad); clk_disable(keypad->clk); regulator_disable(keypad->regulator); return 0; out_free_irq: free_irq(keypad->irq, keypad); out_unregisterinput: input_unregister_device(input); input = NULL; clk_disable(keypad->clk); out_freeinput: regulator_disable(keypad->regulator); out_regulator_enable: regulator_put(keypad->regulator); out_regulator_get: input_free_device(input); out_freekeypad: kfree(keypad); out_freeclk: clk_put(keypad->clk); out_freeioremap: iounmap(reg_base); out_freerequest_memregions: release_mem_region(res->start, resource_size(res)); return ret; } static int __devexit ske_keypad_remove(struct platform_device *pdev) { struct ske_keypad *keypad = platform_get_drvdata(pdev); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); cancel_delayed_work_sync(&keypad->gpio_work); cancel_delayed_work_sync(&keypad->work); free_irq(keypad->irq, keypad); input_unregister_device(keypad->input); sysfs_remove_group(&pdev->dev.kobj, &ske_attr_group); clk_disable(keypad->clk); clk_put(keypad->clk); if (keypad->board->exit) keypad->board->exit(); regulator_put(keypad->regulator); iounmap(keypad->reg_base); release_mem_region(res->start, resource_size(res)); kfree(keypad); return 0; } #ifdef CONFIG_PM static int ske_keypad_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct ske_keypad *keypad = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); if (device_may_wakeup(dev)) enable_irq_wake(irq); else { cancel_delayed_work_sync(&keypad->gpio_work); cancel_delayed_work_sync(&keypad->work); disable_irq(irq); if (keypad->enable) { ske_mode_enable(keypad, false); keypad->enable = false; } } return 0; } static int ske_keypad_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct ske_keypad *keypad = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); if (device_may_wakeup(dev)) disable_irq_wake(irq); else { if (!keypad->enable) { keypad->enable = true; ske_mode_enable(keypad, true); } enable_irq(irq); } return 0; } static const struct dev_pm_ops ske_keypad_dev_pm_ops = { .suspend = ske_keypad_suspend, .resume = ske_keypad_resume, }; #endif struct platform_driver ske_keypad_driver = { .driver = { .name = "nmk-ske-keypad", .owner = THIS_MODULE, #ifdef CONFIG_PM .pm = &ske_keypad_dev_pm_ops, #endif }, .probe = ske_keypad_probe, .remove = __devexit_p(ske_keypad_remove), }; static int __init ske_keypad_init(void) { return platform_driver_register(&ske_keypad_driver); } module_init(ske_keypad_init); static void __exit ske_keypad_exit(void) { platform_driver_unregister(&ske_keypad_driver); } module_exit(ske_keypad_exit); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Naveen Kumar <naveen.gaddipati@stericsson.com>"); MODULE_DESCRIPTION("Nomadik Scroll-Key-Encoder Keypad Driver"); MODULE_ALIAS("platform:nomadik-ske-keypad");
gpl-2.0
adapteva/epiphany-gdb
gdb/doc/refcard.tex
23463
%%%%%%%%%%%%%%%% gdb-refcard.tex %%%%%%%%%%%%%%%% %This file is TeX source for a reference card describing GDB, the GNU debugger. %Copyright (C) 1991-1993, 1996, 1998-2000, 2007-2012 Free Software %Foundation, Inc. %Permission is granted to make and distribute verbatim copies of %this reference provided the copyright notices and permission notices %are preserved on all copies. % %TeX markup is a programming language; accordingly this file is source %for a program to generate a reference. % %This program is free software; you can redistribute it and/or modify %it under the terms of the GNU General Public License as published by %the Free Software Foundation; either version 2, or (at your option) %any later version. % %This program is distributed in the hope that it will be useful, but %WITHOUT ANY WARRANTY; without even the implied warranty of %MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %General Public License for more details. % %You can find a copy of the GNU General Public License at the URL %http://www.gnu.org/copyleft/gpl.html; or write to the Free Software %Foundation, Inc., 51 Franklin Street, Fifth Floor, %Boston, MA 02110-1301, USA. %You can contact the maintainer at: doc@cygnus.com % % Documentation Department % Cygnus Solutions % 1325 Chesapeake Terrace % Sunnyvale, CA 94089 USA % % +1 800 CYGNUS-1 % % % % 22-AUG-1993 Andreas Vogel % % Modifications made in order to handle different papersizes correctly. % You only have to set the total width and height of the paper, the % horizontal and vertical margin space measured from *paper edge* % and the interline and interspec spacing. % In order to support a new papersize, you have to fiddle with the % latter four dimensions. Just try out a few values. % All other values will be computed at process time so it should be % quite easy to support different paper sizes - only four values to % guess :-) % % To find the configuration places, just search for the string % "CONFIGURATION". % % Andreas Vogel (av@ssw.de) % % % % Uncomment the following `magnification' command if you want to print % out in a larger font. Caution! You may need larger paper. You had % best avoid using 3-column output if you try this. See the ``Three % column format'' section below if you want to print in three column % format. % %\magnification=\magstep 1 % % NOTE ON INTENTIONAL OMISSIONS: This reference card includes most GDB % commands, but due to space constraints there are some things I chose % to omit. In general, not all synonyms for commands are covered, nor % all variations of a command. % The GDB-under-Emacs section omits gdb-mode functions without default % keybindings. GDB startup options are not described. % set print sevenbit-strings, set symbol-reloading omitted. % printsyms, printpsyms, omitted since they're for GDB maintenance primarily % share omitted due to obsolescence % set check range/type omitted at least til code is in GDB. % %-------------------- Three column format ----------------------- %%%% --- To disable three column format, comment out this entire section % Three-column format for landscape printing %-------- Papersize defs: \newdimen\totalwidth \newdimen\totalheight \newdimen\hmargin \newdimen\vmargin \newdimen\secskip \newdimen\lskip \newdimen\barwidth \newdimen\barheight \newdimen\intersecwidth %% %% START CONFIGURATION - PAPERSIZE DEFINITIONS %------- Papersize params: %% US letter paper (8.5x11in) %% \totalwidth=11in % total width of paper \totalheight=8.5in % total height of paper \hmargin=.25in % horizontal margin width \vmargin=.25in % vertical margin width \secskip=1pc % space between refcard secs \lskip=2pt % extra skip between \sec entries \ifx\pdfoutput\undefined\else % check if we are using pdfTeX \pdfpagewidth=\totalwidth % width of paper in pdf output \pdfpageheight=\totalheight % height of paper in pdf output \fi %------- end papersize params %% %% change according to personal taste, not papersize dependent %% \barwidth=.1pt % width of the cropmark bar \barheight=2pt % height of the cropmark bar \intersecwidth=0.5em % width between \itmwid and \dfnwid %% %% END CONFIGURATION - PAPERSIZE DEFINITIONS %% %% %% values to be computed - nothing to configure %% \newdimen\fullhsize % width of area without margins \newdimen\itmwid % width of item column \newdimen\dfnwid % width of definition column \newdimen\temp % only for temporary use %% %% adjust the offsets so the margins are measured *from paper edge* %% \hoffset=-1in \advance \hoffset by \hmargin \voffset=-1in \advance \voffset by \vmargin %% %% fullhsize = totalwidth - (2 * hmargin) %% \fullhsize=\totalwidth \temp=\hmargin \multiply \temp by 2 \advance \fullhsize by -\temp %% %% hsize = (fullhsize - (4 * hmargin) - (2 * barwidth)) / 3 %% \hsize=\fullhsize \temp=\hmargin \multiply \temp by 4 \advance \hsize by -\temp \temp=\barwidth \multiply \temp by 2 \advance \hsize by -\temp \divide \hsize by 3 %% %% vsize = totalheight - (2 * vmargin) %% \vsize=\totalheight \temp=\vmargin \multiply \temp by 2 \advance \vsize by -\temp %% %% itmwid = (hsize - intersecwidth) * 1/3 %% dfnwid = (hsize - intersecwidth) * 2/3 %% \temp=\hsize \advance \temp by -\intersecwidth \divide \temp by 3 \itmwid=\temp \dfnwid=\hsize \advance \dfnwid by -\itmwid %-------- end papersize defs \def\fulline{\hbox to \fullhsize} \let\lcr=L \newbox\leftcolumn\newbox\centercolumn \output={\if L\lcr \global\setbox\leftcolumn=\columnbox \global\let\lcr=C \else \if C\lcr \global\setbox\centercolumn=\columnbox \global\let\lcr=R \else \tripleformat \global\let\lcr=L \fi \fi % \ifnum\outputpenalty>-20000 \else\dosupereject\fi } %% %% START CONFIGURATION - ALTERNATIVE FOLDING GUIDES %% %% For NO printed folding guide, %% comment out other \def\vdecor's and uncomment: %\def\vdecor{\hskip\hmargin plus1fil\hskip\barwidth plus1fil\hskip\hmargin plus1fil} %% For SOLID LINE folding guide, %% comment out other \def\vdecor's and uncomment: %\def\vdecor{\hskip\hmargin plus1fil \vrule width \barwidth \hskip\hmargin plus1fil} %% For SMALL MARKS NEAR TOP AND BOTTOM as folding guide, %% comment out other \def\vdecor's and uncomment: \def\vdecor{\hskip\hmargin plus1fil \vbox to \vsize{\hbox to \barwidth{\vrule height\barheight width\barwidth}\vfill \hbox to \barwidth{\vrule height\barheight width\barwidth}}%THIS PERCENT SIGN IS ESSENTIAL \hskip\hmargin plus1fil} %% %% END CONFIGURATION - ALTERNATIVES FOR FOLDING GUIDES %% \def\tripleformat{\shipout\vbox{\fulline{\box\leftcolumn\vdecor \box\centercolumn\vdecor \columnbox} } \advancepageno} \def\columnbox{\leftline{\pagebody}} \def\bye{\par\vfill \supereject \if R\lcr \null\vfill\eject\fi \end} %-------------------- end three column format ----------------------- %-------------------- Computer Modern font defs: -------------------- \font\bbf=cmbx10 \font\vbbf=cmbx12 \font\smrm=cmr6 \font\brm=cmr10 \font\rm=cmr7 \font\it=cmti7 \font\tt=cmtt8 %-------------------- end font defs --------------------------------- % \hyphenpenalty=5000\tolerance=2000\raggedright\raggedbottom \normalbaselineskip=9pt\baselineskip=9pt % \parindent=0pt \parskip=0pt \footline={\vbox to0pt{\hss}} % \def\ctl#1{{\tt C-#1}} \def\opt#1{{\brm[{\rm #1}]}} \def\xtra#1{\noalign{\smallskip{\tt#1}}} % \long\def\sec#1;#2\endsec{\vskip \secskip \halign{% %COL 1 (of halign): \vtop{\hsize=\itmwid\tt ##\par\vskip \lskip }\hfil %COL 2 (of halign): &\vtop{\hsize=\dfnwid\hangafter=1\hangindent=\intersecwidth \rm ##\par\vskip \lskip}\cr %Tail of \long\def fills in halign body with \sec args: \noalign{{\bbf #1}\vskip \lskip} #2 } } {\vbbf GDB QUICK REFERENCE}\hfil{\smrm GDB Version 5}\qquad \sec Essential Commands; gdb {\it program} \opt{{\it core}}&debug {\it program} \opt{using coredump {\it core}}\cr b \opt{\it file\tt:}{\it function}&set breakpoint at {\it function} \opt{in \it file}\cr run \opt{{\it arglist}}&start your program \opt{with {\it arglist}}\cr bt& backtrace: display program stack\cr p {\it expr}&display the value of an expression\cr c &continue running your program\cr n &next line, stepping over function calls\cr s &next line, stepping into function calls\cr \endsec \sec Starting GDB; gdb&start GDB, with no debugging files\cr gdb {\it program}&begin debugging {\it program}\cr gdb {\it program core}&debug coredump {\it core} produced by {\it program}\cr gdb --help&describe command line options\cr \endsec \sec Stopping GDB; quit&exit GDB; also {\tt q} or {\tt EOF} (eg \ctl{d})\cr INTERRUPT&(eg \ctl{c}) terminate current command, or send to running process\cr \endsec \sec Getting Help; help&list classes of commands\cr help {\it class}&one-line descriptions for commands in {\it class}\cr help {\it command}&describe {\it command}\cr \endsec \sec Executing your Program; run {\it arglist}&start your program with {\it arglist}\cr run&start your program with current argument list\cr run $\ldots$ <{\it inf} >{\it outf}&start your program with input, output redirected\cr \cr kill&kill running program\cr \cr tty {\it dev}&use {\it dev} as stdin and stdout for next {\tt run}\cr set args {\it arglist}&specify {\it arglist} for next {\tt run}\cr set args&specify empty argument list\cr show args&display argument list\cr \cr show env&show all environment variables\cr show env {\it var}&show value of environment variable {\it var}\cr set env {\it var} {\it string}&set environment variable {\it var}\cr unset env {\it var}&remove {\it var} from environment\cr \endsec \sec Shell Commands; cd {\it dir}&change working directory to {\it dir}\cr pwd&Print working directory\cr make $\ldots$&call ``{\tt make}''\cr shell {\it cmd}&execute arbitrary shell command string\cr \endsec \vfill \line{\smrm \opt{ } surround optional arguments \hfill $\ldots$ show one or more arguments} \vskip\baselineskip \centerline{\smrm \copyright 1998, 2000, 2010 Free Software Foundation, Inc.\qquad Permissions on back} \eject \sec Breakpoints and Watchpoints; break \opt{\it file\tt:}{\it line}\par b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par eg:\quad{\tt break main.c:37}\quad\cr break \opt{\it file\tt:}{\it func}&set breakpoint at {\it func} \opt{in \it file}\cr break +{\it offset}\par break -{\it offset}&set break at {\it offset} lines from current stop\cr break *{\it addr}&set breakpoint at address {\it addr}\cr break&set breakpoint at next instruction\cr break $\ldots$ if {\it expr}&break conditionally on nonzero {\it expr}\cr cond {\it n} \opt{\it expr}&new conditional expression on breakpoint {\it n}; make unconditional if no {\it expr}\cr tbreak $\ldots$&temporary break; disable when reached\cr rbreak \opt{\it file\tt:}{\it regex}&break on all functions matching {\it regex} \opt{in \it file}\cr watch {\it expr}&set a watchpoint for expression {\it expr}\cr catch {\it event}&break at {\it event}, which may be {\tt catch}, {\tt throw}, {\tt exec}, {\tt fork}, {\tt vfork}, {\tt load}, or {\tt unload}.\cr \cr info break&show defined breakpoints\cr info watch&show defined watchpoints\cr \cr clear&delete breakpoints at next instruction\cr clear \opt{\it file\tt:}{\it fun}&delete breakpoints at entry to {\it fun}()\cr clear \opt{\it file\tt:}{\it line}&delete breakpoints on source line \cr delete \opt{{\it n}}&delete breakpoints \opt{or breakpoint {\it n}}\cr \cr disable \opt{{\it n}}&disable breakpoints \opt{or breakpoint {\it n}} \cr enable \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}} \cr enable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; disable again when reached \cr enable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; delete when reached \cr \cr ignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count} times\cr \cr commands {\it n}\par \qquad \opt{\tt silent}\par \qquad {\it command-list}&execute GDB {\it command-list} every time breakpoint {\it n} is reached. \opt{{\tt silent} suppresses default display}\cr end&end of {\it command-list}\cr \endsec \sec Program Stack; backtrace \opt{\it n}\par bt \opt{\it n}&print trace of all frames in stack; or of {\it n} frames---innermost if {\it n}{\tt >0}, outermost if {\it n}{\tt <0}\cr frame \opt{\it n}&select frame number {\it n} or frame at address {\it n}; if no {\it n}, display current frame\cr up {\it n}&select frame {\it n} frames up\cr down {\it n}&select frame {\it n} frames down\cr info frame \opt{\it addr}&describe selected frame, or frame at {\it addr}\cr info args&arguments of selected frame\cr info locals&local variables of selected frame\cr info reg \opt{\it rn}$\ldots$\par info all-reg \opt{\it rn}&register values \opt{for regs {\it rn\/}} in selected frame; {\tt all-reg} includes floating point\cr \endsec \vfill\eject \sec Execution Control; continue \opt{\it count}\par c \opt{\it count}&continue running; if {\it count} specified, ignore this breakpoint next {\it count} times\cr \cr step \opt{\it count}\par s \opt{\it count}&execute until another line reached; repeat {\it count} times if specified\cr stepi \opt{\it count}\par si \opt{\it count}&step by machine instructions rather than source lines\cr \cr next \opt{\it count}\par n \opt{\it count}&execute next line, including any function calls\cr nexti \opt{\it count}\par ni \opt{\it count}&next machine instruction rather than source line\cr \cr until \opt{\it location}&run until next instruction (or {\it location})\cr finish&run until selected stack frame returns\cr return \opt{\it expr}&pop selected stack frame without executing \opt{setting return value}\cr signal {\it num}&resume execution with signal {\it s} (none if {\tt 0})\cr jump {\it line}\par jump *{\it address}&resume execution at specified {\it line} number or {\it address}\cr set var={\it expr}&evaluate {\it expr} without displaying it; use for altering program variables\cr \endsec \sec Display; print \opt{\tt/{\it f}\/} \opt{\it expr}\par p \opt{\tt/{\it f}\/} \opt{\it expr}&show value of {\it expr} \opt{or last value \tt \$} according to format {\it f}:\cr \qquad x&hexadecimal\cr \qquad d&signed decimal\cr \qquad u&unsigned decimal\cr \qquad o&octal\cr \qquad t&binary\cr \qquad a&address, absolute and relative\cr \qquad c&character\cr \qquad f&floating point\cr call \opt{\tt /{\it f}\/} {\it expr}&like {\tt print} but does not display {\tt void}\cr x \opt{\tt/{\it Nuf}\/} {\it expr}&examine memory at address {\it expr}; optional format spec follows slash\cr \quad {\it N}&count of how many units to display\cr \quad {\it u}&unit size; one of\cr &{\tt\qquad b}\ individual bytes\cr &{\tt\qquad h}\ halfwords (two bytes)\cr &{\tt\qquad w}\ words (four bytes)\cr &{\tt\qquad g}\ giant words (eight bytes)\cr \quad {\it f}&printing format. Any {\tt print} format, or\cr &{\tt\qquad s}\ null-terminated string\cr &{\tt\qquad i}\ machine instructions\cr disassem \opt{\it addr}&display memory as machine instructions\cr \endsec \sec Automatic Display; display \opt{\tt/\it f\/} {\it expr}&show value of {\it expr} each time program stops \opt{according to format {\it f}\/}\cr display&display all enabled expressions on list\cr undisplay {\it n}&remove number(s) {\it n} from list of automatically displayed expressions\cr disable disp {\it n}&disable display for expression(s) number {\it n}\cr enable disp {\it n}&enable display for expression(s) number {\it n}\cr info display&numbered list of display expressions\cr \endsec \vfill\eject \sec Expressions; {\it expr}&an expression in C, C++, or Modula-2 (including function calls), or:\cr {\it addr\/}@{\it len}&an array of {\it len} elements beginning at {\it addr}\cr {\it file}::{\it nm}&a variable or function {\it nm} defined in {\it file}\cr $\tt\{${\it type}$\tt\}${\it addr}&read memory at {\it addr} as specified {\it type}\cr \$&most recent displayed value\cr \${\it n}&{\it n}th displayed value\cr \$\$&displayed value previous to \$\cr \$\${\it n}&{\it n}th displayed value back from \$\cr \$\_&last address examined with {\tt x}\cr \$\_\_&value at address \$\_\cr \${\it var}&convenience variable; assign any value\cr \cr show values \opt{{\it n}}&show last 10 values \opt{or surrounding \${\it n}}\cr show conv&display all convenience variables\cr \endsec \sec Symbol Table; info address {\it s}&show where symbol {\it s} is stored\cr info func \opt{\it regex}&show names, types of defined functions (all, or matching {\it regex})\cr info var \opt{\it regex}&show names, types of global variables (all, or matching {\it regex})\cr whatis \opt{\it expr}\par ptype \opt{\it expr}&show data type of {\it expr} \opt{or \tt \$} without evaluating; {\tt ptype} gives more detail\cr ptype {\it type}&describe type, struct, union, or enum\cr \endsec \sec GDB Scripts; source {\it script}&read, execute GDB commands from file {\it script}\cr \cr define {\it cmd}\par \qquad {\it command-list}&create new GDB command {\it cmd}; execute script defined by {\it command-list}\cr end&end of {\it command-list}\cr document {\it cmd}\par \qquad {\it help-text}&create online documentation for new GDB command {\it cmd}\cr end&end of {\it help-text}\cr \endsec \sec Signals; handle {\it signal} {\it act}&specify GDB actions for {\it signal}:\cr \quad print&announce signal\cr \quad noprint&be silent for signal\cr \quad stop&halt execution on signal\cr \quad nostop&do not halt execution\cr \quad pass&allow your program to handle signal\cr \quad nopass&do not allow your program to see signal\cr info signals&show table of signals, GDB action for each\cr \endsec \sec Debugging Targets; target {\it type} {\it param}&connect to target machine, process, or file\cr help target&display available targets\cr attach {\it param}&connect to another process\cr detach&release target from GDB control\cr \endsec \vfill\eject \sec Controlling GDB; set {\it param} {\it value}&set one of GDB's internal parameters\cr show {\it param}&display current setting of parameter\cr \xtra{\rm Parameters understood by {\tt set} and {\tt show}:} \quad complaint {\it limit}&number of messages on unusual symbols\cr \quad confirm {\it on/off}&enable or disable cautionary queries\cr \quad editing {\it on/off}&control {\tt readline} command-line editing\cr \quad height {\it lpp}&number of lines before pause in display\cr \quad language {\it lang}&Language for GDB expressions ({\tt auto}, {\tt c} or {\tt modula-2})\cr \quad listsize {\it n}&number of lines shown by {\tt list}\cr \quad prompt {\it str}&use {\it str} as GDB prompt\cr \quad radix {\it base}&octal, decimal, or hex number representation\cr \quad verbose {\it on/off}&control messages when loading symbols\cr \quad width {\it cpl}&number of characters before line folded\cr \quad write {\it on/off}&Allow or forbid patching binary, core files (when reopened with {\tt exec} or {\tt core}) \cr \quad history $\ldots$\par \quad h $\ldots$&groups with the following options:\cr \quad h exp {\it off/on}&disable/enable {\tt readline} history expansion\cr \quad h file {\it filename}&file for recording GDB command history\cr \quad h size {\it size}&number of commands kept in history list\cr \quad h save {\it off/on}&control use of external file for command history\cr \cr \quad print $\ldots$\par \quad p $\ldots$&groups with the following options:\cr \quad p address {\it on/off}&print memory addresses in stacks, values\cr \quad p array {\it off/on}&compact or attractive format for arrays\cr \quad p demangl {\it on/off}&source (demangled) or internal form for C++ symbols\cr \quad p asm-dem {\it on/off}&demangle C++ symbols in machine-instruction output\cr \quad p elements {\it limit}&number of array elements to display\cr \quad p object {\it on/off}&print C++ derived types for objects\cr \quad p pretty {\it off/on}&struct display: compact or indented\cr \quad p union {\it on/off}&display of union members\cr \quad p vtbl {\it off/on}&display of C++ virtual function tables\cr \cr show commands&show last 10 commands\cr show commands {\it n}&show 10 commands around number {\it n}\cr show commands +&show next 10 commands\cr \endsec \sec Working Files; file \opt{\it file}&use {\it file} for both symbols and executable; with no arg, discard both\cr core \opt{\it file}&read {\it file} as coredump; or discard\cr exec \opt{\it file}&use {\it file} as executable only; or discard\cr symbol \opt{\it file}&use symbol table from {\it file}; or discard\cr load {\it file}&dynamically link {\it file\/} and add its symbols\cr add-sym {\it file} {\it addr}&read additional symbols from {\it file}, dynamically loaded at {\it addr}\cr info files&display working files and targets in use\cr path {\it dirs}&add {\it dirs} to front of path searched for executable and symbol files\cr show path&display executable and symbol file path\cr info share&list names of shared libraries currently loaded\cr \endsec \vfill\eject \sec Source Files; dir {\it names}&add directory {\it names} to front of source path\cr dir&clear source path\cr show dir&show current source path\cr \cr list&show next ten lines of source\cr list -&show previous ten lines\cr list {\it lines}&display source surrounding {\it lines}, specified as:\cr \quad{\opt{\it file\tt:}\it num}&line number \opt{in named file}\cr \quad{\opt{\it file\tt:}\it function}&beginning of function \opt{in named file}\cr \quad{\tt +\it off}&{\it off} lines after last printed\cr \quad{\tt -\it off}&{\it off} lines previous to last printed\cr \quad{\tt*\it address}&line containing {\it address}\cr list {\it f},{\it l}&from line {\it f} to line {\it l}\cr info line {\it num}&show starting, ending addresses of compiled code for source line {\it num}\cr info source&show name of current source file\cr info sources&list all source files in use\cr forw {\it regex}&search following source lines for {\it regex}\cr rev {\it regex}&search preceding source lines for {\it regex}\cr \endsec \sec GDB under GNU Emacs; M-x gdb&run GDB under Emacs\cr \ctl{h} m&describe GDB mode\cr M-s&step one line ({\tt step})\cr M-n&next line ({\tt next})\cr M-i&step one instruction ({\tt stepi})\cr \ctl{c} \ctl{f}&finish current stack frame ({\tt finish})\cr M-c&continue ({\tt cont})\cr M-u&up {\it arg} frames ({\tt up})\cr M-d&down {\it arg} frames ({\tt down})\cr \ctl{x} \&&copy number from point, insert at end\cr \ctl{x} SPC&(in source file) set break at point\cr \endsec \sec GDB License; show copying&Display GNU General Public License\cr show warranty&There is NO WARRANTY for GDB. Display full no-warranty statement.\cr \endsec \vfill {\smrm\parskip=6pt Copyright \copyright 1991, 1992, 1993, 1998, 2000, 2010 Free Software Foundation, Inc. Author: Roland H. Pesch The author assumes no responsibility for any errors on this card. This card may be freely distributed under the terms of the GNU General Public License. Please contribute to development of this card by annotating it. Improvements can be sent to bug-gdb@gnu.org. GDB itself is free software; you are welcome to distribute copies of it under the terms of the GNU General Public License. There is absolutely no warranty for GDB. } \end
gpl-2.0
AdaDeb/septracks
facebook-android-sdk-3.5.2/docs/com/facebook/Request.GraphUserListCallback.html
8223
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_21) on Tue Oct 01 11:17:31 PDT 2013 --> <title>Request.GraphUserListCallback</title> <meta name="date" content="2013-10-01"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Request.GraphUserListCallback"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../com/facebook/Request.GraphUserCallback.html" title="interface in com.facebook"><span class="strong">Prev Class</span></a></li> <li><a href="../../com/facebook/RequestAsyncTask.html" title="class in com.facebook"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?com/facebook/Request.GraphUserListCallback.html" target="_top">Frames</a></li> <li><a href="Request.GraphUserListCallback.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.facebook</div> <h2 title="Interface Request.GraphUserListCallback" class="title">Interface Request.GraphUserListCallback</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Enclosing class:</dt> <dd><a href="../../com/facebook/Request.html" title="class in com.facebook">Request</a></dd> </dl> <hr> <br> <pre>public static interface <span class="strong">Request.GraphUserListCallback</span></pre> <div class="block">Specifies the interface that consumers of <a href="../../com/facebook/Request.html#executeMyFriendsRequestAsync(com.facebook.Session, com.facebook.Request.GraphUserListCallback)"><code>Request.executeMyFriendsRequestAsync(Session, com.facebook.Request.GraphUserListCallback)</code></a> can use to be notified when the request completes, either successfully or with an error.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../com/facebook/Request.GraphUserListCallback.html#onCompleted(java.util.List, com.facebook.Response)">onCompleted</a></strong>(<a href="http://d.android.com/reference/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../com/facebook/model/GraphUser.html" title="interface in com.facebook.model">GraphUser</a>&gt;&nbsp;users, <a href="../../com/facebook/Response.html" title="class in com.facebook">Response</a>&nbsp;response)</code> <div class="block">The method that will be called when the request completes.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="onCompleted(java.util.List, com.facebook.Response)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>onCompleted</h4> <pre>void&nbsp;onCompleted(<a href="http://d.android.com/reference/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../com/facebook/model/GraphUser.html" title="interface in com.facebook.model">GraphUser</a>&gt;&nbsp;users, <a href="../../com/facebook/Response.html" title="class in com.facebook">Response</a>&nbsp;response)</pre> <div class="block">The method that will be called when the request completes.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>users</code> - the list of GraphObjects representing the returned friends, or null</dd><dd><code>response</code> - the Response of this request, which may include error information if the request was unsuccessful</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../com/facebook/Request.GraphUserCallback.html" title="interface in com.facebook"><span class="strong">Prev Class</span></a></li> <li><a href="../../com/facebook/RequestAsyncTask.html" title="class in com.facebook"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../index.html?com/facebook/Request.GraphUserListCallback.html" target="_top">Frames</a></li> <li><a href="Request.GraphUserListCallback.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
gpl-2.0
xinchen384/p4est
src/p8est_lnodes.c
1067
/* This file is part of p4est. p4est is a C library to manage a collection (a forest) of multiple connected adaptive quadtrees or octrees in parallel. Copyright (C) 2010 The University of Texas System Additional copyright (C) 2011 individual authors Written by Carsten Burstedde, Lucas C. Wilcox, and Tobin Isaac p4est is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. p4est is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with p4est; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <p4est_to_p8est.h> #include "p4est_lnodes.c"
gpl-2.0
dusek/tbb
src/tbb/ia32-masm/lock_byte.asm
1725
; Copyright 2005-2010 Intel Corporation. All Rights Reserved. ; ; This file is part of Threading Building Blocks. ; ; Threading Building Blocks is free software; you can redistribute it ; and/or modify it under the terms of the GNU General Public License ; version 2 as published by the Free Software Foundation. ; ; Threading Building Blocks is distributed in the hope that it will be ; useful, but WITHOUT ANY WARRANTY; without even the implied warranty ; of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with Threading Building Blocks; if not, write to the Free Software ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ; ; As a special exception, you may use this file as part of a free software ; library without restriction. Specifically, if other files instantiate ; templates or use macros or inline functions from this file, or you compile ; this file and link it with other files to produce an executable, this ; file does not by itself cause the resulting executable to be covered by ; the GNU General Public License. This exception does not however ; invalidate any other reasons why the executable file might be covered by ; the GNU General Public License. ; DO NOT EDIT - AUTOMATICALLY GENERATED FROM .s FILE .686 .model flat,c .code ALIGN 4 PUBLIC c __TBB_machine_trylockbyte __TBB_machine_trylockbyte: mov edx,4[esp] mov al,[edx] mov cl,1 test al,1 jnz __TBB_machine_trylockbyte_contended lock cmpxchg [edx],cl jne __TBB_machine_trylockbyte_contended mov eax,1 ret __TBB_machine_trylockbyte_contended: xor eax,eax ret end
gpl-2.0
guillaumelecerf/ezpublish-legacy
kernel/classes/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput.php
27406
<?php /** * File containing the eZXHTMLXMLOutput class. * * @copyright Copyright (C) eZ Systems AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. * @version //autogentag// * @package kernel */ class eZXHTMLXMLOutput extends eZXMLOutputHandler { public $OutputTags = array( 'section' => array( 'quickRender' => true, 'initHandler' => 'initHandlerSection', 'renderHandler' => 'renderChildrenOnly' ), 'embed' => array( 'initHandler' => 'initHandlerEmbed', 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification', 'xhtml:id' => 'id', 'object_id' => false, 'node_id' => false, 'show_path' => false ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'embed-inline' => array( 'initHandler' => 'initHandlerEmbed', 'renderHandler' => 'renderInline', 'attrNamesTemplate' => array( 'class' => 'classification', 'xhtml:id' => 'id', 'object_id' => false, 'node_id' => false, 'show_path' => false ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'table' => array( 'initHandler' => 'initHandlerTable', 'leavingHandler' => 'leavingHandlerTable', 'renderHandler' => 'renderAll', 'contentVarName' => 'rows', 'attrNamesTemplate' => array( 'class' => 'classification', 'width' => 'width' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'tr' => array( //'quickRender' => array( 'tr', "\n" ), 'initHandler' => 'initHandlerTr', 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'td' => array( 'initHandler' => 'initHandlerTd', 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'xhtml:width' => 'width', 'xhtml:colspan' => 'colspan', 'xhtml:rowspan' => 'rowspan', 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'th' => array( 'initHandler' => 'initHandlerTd', 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'xhtml:width' => 'width', 'xhtml:colspan' => 'colspan', 'xhtml:rowspan' => 'rowspan', 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'ol' => array( 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'ul' => array( 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'li' => array( 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'header' => array( 'initHandler' => 'initHandlerHeader', 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'paragraph' => array( //'quickRender' => array( 'p', "\n" ), 'renderHandler' => 'renderParagraph', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'line' => array( //'quickRender' => array( '', "<br/>" ), 'renderHandler' => 'renderLine' ), 'literal' => array( 'renderHandler' => 'renderAll', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'strong' => array( 'renderHandler' => 'renderInline', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'emphasize' => array( 'renderHandler' => 'renderInline', 'attrNamesTemplate' => array( 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'link' => array( 'initHandler' => 'initHandlerLink', 'renderHandler' => 'renderInline', 'attrNamesTemplate' => array( 'xhtml:id' => 'id', 'xhtml:title' => 'title', 'url_id' => false, 'object_id' => false, 'node_id' => false, 'show_path' => false, 'ezurl_id' => false, 'anchor_name' => false, 'class' => 'classification' ), 'attrDesignKeys' => array( 'class' => 'classification' ) ), 'anchor' => array( 'renderHandler' => 'renderInline' ), 'custom' => array( 'initHandler' => 'initHandlerCustom', 'renderHandler' => 'renderCustom', 'attrNamesTemplate' => array( 'name' => false ) ), '#text' => array( 'quickRender' => true, 'renderHandler' => 'renderText' ) ); function eZXHTMLXMLOutput( &$xmlData, $aliasedType, $contentObjectAttribute = null ) { $this->eZXMLOutputHandler( $xmlData, $aliasedType, $contentObjectAttribute ); $ini = eZINI::instance('ezxml.ini'); if ( $ini->variable( 'ezxhtml', 'RenderParagraphInTableCells' ) == 'disabled' ) $this->RenderParagraphInTableCells = false; } function initHandlerSection( $element, &$attributes, &$siblingParams, &$parentParams ) { $ret = array(); if( !isset( $parentParams['section_level'] ) ) $parentParams['section_level'] = 0; else $parentParams['section_level']++; // init header counter for current level and for the next level if needed $level = $parentParams['section_level']; if ( $level != 0 ) { if ( !isset( $this->HeaderCount[$level] ) ) $this->HeaderCount[$level] = 0; if ( !isset( $this->HeaderCount[$level + 1] ) ) $this->HeaderCount[$level + 1] = 0; } return $ret; } function initHandlerHeader( $element, &$attributes, &$siblingParams, &$parentParams ) { $level = $parentParams['section_level']; $this->HeaderCount[$level]++; // headers auto-numbering $i = 1; $headerAutoName = ''; while ( $i <= $level ) { if ( $i > 1 ) $headerAutoName .= "_"; $headerAutoName .= $this->HeaderCount[$i]; $i++; } $levelNumber = str_replace( "_", ".", $headerAutoName ); if ( $this->ObjectAttributeID ) $headerAutoName = $this->ObjectAttributeID . '_' . $headerAutoName; $ret = array( 'tpl_vars' => array( 'level' => $level, 'header_number' => $levelNumber, 'toc_anchor_name' => $headerAutoName ) ); return $ret; } function initHandlerLink( $element, &$attributes, &$siblingParams, &$parentParams ) { $ret = array(); // Set link parameters for rendering children of link tag $href=''; if ( $element->getAttribute( 'url_id' ) != null ) { $linkID = $element->getAttribute( 'url_id' ); if ( isset( $this->LinkArray[$linkID] ) ) $href = $this->LinkArray[$linkID]; } elseif ( $element->getAttribute( 'node_id' ) != null ) { $nodeID = $element->getAttribute( 'node_id' ); $node = isset( $this->NodeArray[$nodeID] ) ? $this->NodeArray[$nodeID] : null; if ( $node != null ) { $view = $element->getAttribute( 'view' ); if ( $view ) $href = 'content/view/' . $view . '/' . $nodeID; else $href = $node->attribute( 'url_alias' ); } else { eZDebug::writeWarning( "Node #$nodeID doesn't exist", "XML output handler: link" ); } } elseif ( $element->getAttribute( 'object_id' ) != null ) { $objectID = $element->getAttribute( 'object_id' ); if ( isset( $this->ObjectArray["$objectID"] ) ) { $object = $this->ObjectArray["$objectID"]; $node = $object->attribute( 'main_node' ); if ( $node ) { $nodeID = $node->attribute( 'node_id' ); $view = $element->getAttribute( 'view' ); if ( $view ) $href = 'content/view/' . $view . '/' . $nodeID; else $href = $node->attribute( 'url_alias' ); } else { eZDebug::writeWarning( "Object #$objectID doesn't have assigned nodes", "XML output handler: link" ); } } else { eZDebug::writeWarning( "Object #$objectID doesn't exist", "XML output handler: link" ); } } elseif ( $element->getAttribute( 'href' ) != null ) { $href = $element->getAttribute( 'href' ); } if ( $element->getAttribute( 'anchor_name' ) != null ) { $href .= '#' . $element->getAttribute( 'anchor_name' ); } if ( $href !== false ) { $attributes['href'] = $href; $parentParams['link_parameters'] = $attributes; } return $ret; } function initHandlerEmbed( $element, &$attributes, &$siblingParams, &$parentParams ) { // default return value in case of errors $ret = array( 'no_render' => true ); $tplSuffix = ''; $objectID = $element->getAttribute( 'object_id' ); if ( $objectID && !empty( $this->ObjectArray["$objectID"] ) ) { $object = $this->ObjectArray["$objectID"]; } else { $nodeID = $element->getAttribute( 'node_id' ); if ( $nodeID ) { if ( isset( $this->NodeArray[$nodeID] ) ) { $node = $this->NodeArray[$nodeID]; $objectID = $node->attribute( 'contentobject_id' ); $object = $node->object(); $tplSuffix = '_node'; } else { eZDebug::writeWarning( "Node #$nodeID doesn't exist", "XML output handler: embed" ); return $ret; } } } if ( !isset( $object ) || !$object || !( $object instanceof eZContentObject ) ) { eZDebug::writeWarning( "Can't fetch object #$objectID", "XML output handler: embed" ); return $ret; } if ( $object->attribute( 'status' ) != eZContentObject::STATUS_PUBLISHED ) { eZDebug::writeWarning( "Object #$objectID is not published", "XML output handler: embed" ); return $ret; } if ( eZINI::instance()->variable( 'SiteAccessSettings', 'ShowHiddenNodes' ) !== 'true' ) { if ( isset( $node ) ) { // embed with a node ID if ( $node->attribute( 'is_invisible' ) ) { eZDebug::writeNotice( "Node #{$nodeID} is invisible", "XML output handler: embed" ); return $ret; } } else { // embed with an object id // checking if at least a location is visible $oneVisible = false; foreach( $object->attribute( 'assigned_nodes' ) as $assignedNode ) { if ( !$assignedNode->attribute( 'is_invisible' ) ) { $oneVisible = true; break; } } if ( !$oneVisible ) { eZDebug::writeNotice( "None of the object #{$objectID}'s location(s) is visible", "XML output handler: embed" ); return $ret; } } } if ( $object->attribute( 'can_read' ) || $object->attribute( 'can_view_embed' ) ) { $templateName = $element->nodeName . $tplSuffix; } else { $templateName = $element->nodeName . '_denied'; } $objectParameters = array(); $excludeAttrs = array( 'view', 'class', 'node_id', 'object_id' ); foreach ( $attributes as $attrName => $value ) { if ( !in_array( $attrName, $excludeAttrs ) ) { if ( strpos( $attrName, ':' ) !== false ) $attrName = substr( $attrName, strpos( $attrName, ':' ) + 1 ); $objectParameters[$attrName] = $value; unset( $attributes[$attrName] ); } } if ( isset( $parentParams['link_parameters'] ) ) $linkParameters = $parentParams['link_parameters']; else $linkParameters = array(); $ret = array( 'template_name' => $templateName, 'tpl_vars' => array( 'object' => $object, 'link_parameters' => $linkParameters, 'object_parameters' => $objectParameters ), 'design_keys' => array( 'class_identifier' => $object->attribute( 'class_identifier' ) ) ); if ( $tplSuffix == '_node') $ret['tpl_vars']['node'] = $node; return $ret; } function initHandlerTable( $element, &$attributes, &$siblingParams, &$parentParams ) { // Backing up the section_level, headings' level should be restarted inside tables. // @see http://issues.ez.no/11536 $this->SectionLevelStack[] = $parentParams['section_level']; $parentParams['section_level'] = 0; // Numbers of rows and cols are lower by 1 for back-compatibility. $rowCount = self::childTagCount( $element ) -1; $lastRow = $element->lastChild; while ( $lastRow && !( $lastRow instanceof DOMElement && $lastRow->nodeName == 'tr' ) ) { $lastRow = $lastRow->previousSibling; } $colCount = self::childTagCount( $lastRow ); if ( $colCount ) $colCount--; $ret = array( 'tpl_vars' => array( 'col_count' => $colCount, 'row_count' => $rowCount ) ); return $ret; } function leavingHandlerTable( $element, &$attributes, &$siblingParams, &$parentParams ) { // Restoring the section_level as it was before entering the table. // @see http://issues.ez.no/11536 $parentParams['section_level'] = array_pop($this->SectionLevelStack); } function initHandlerTr( $element, &$attributes, &$siblingParams, &$parentParams ) { $ret = array(); if( !isset( $siblingParams['table_row_count'] ) ) $siblingParams['table_row_count'] = 0; else $siblingParams['table_row_count']++; $parentParams['table_row_count'] = $siblingParams['table_row_count']; // Number of cols is lower by 1 for back-compatibility. $colCount = self::childTagCount( $element ); if ( $colCount ) $colCount--; $ret = array( 'tpl_vars' => array( 'row_count' => $parentParams['table_row_count'], 'col_count' => $colCount ) ); // Allow overrides based on table class $parent = $element->parentNode; if ( $parent instanceof DOMElement && $parent->hasAttribute('class') ) $ret['design_keys'] = array( 'table_classification' => $parent->getAttribute('class') ); return $ret; } function initHandlerTd( $element, &$attributes, &$siblingParams, &$parentParams ) { if( !isset( $siblingParams['table_col_count'] ) ) $siblingParams['table_col_count'] = 0; else $siblingParams['table_col_count']++; $ret = array( 'tpl_vars' => array( 'col_count' => &$siblingParams['table_col_count'], 'row_count' => &$parentParams['table_row_count'] ) ); // Allow overrides based on table class $parent = $element->parentNode->parentNode; if ( $parent instanceof DOMElement && $parent->hasAttribute('class') ) $ret['design_keys'] = array( 'table_classification' => $parent->getAttribute('class') ); if ( !$this->RenderParagraphInTableCells && self::childTagCount( $element ) == 1 ) { // paragraph will not be rendered so its align attribute needs to // be taken into account at the td/th level // Looking for the paragraph with align attribute foreach( $element->childNodes as $c ) { if ( $c instanceof DOMElement ) { if ( $c->hasAttribute( 'align' ) ) { $attributes['align'] = $c->getAttribute( 'align' ); } break ; } } } return $ret; } function initHandlerCustom( $element, &$attributes, &$siblingParams, &$parentParams ) { $ret = array( 'template_name' => $attributes['name'] ); return $ret; } // Render handlers function renderParagraph( $element, $childrenOutput, $vars ) { // don't render if inside 'li' or inside 'td'/'th' (by option) $parent = $element->parentNode; if ( ( $parent->nodeName == 'li' && self::childTagCount( $parent ) == 1 ) || ( in_array( $parent->nodeName, array( 'td', 'th' ) ) && !$this->RenderParagraphInTableCells && self::childTagCount( $parent ) == 1 ) ) { return $childrenOutput; } // Break paragraph by block tags (like table, ol, ul, header and paragraphs) $tagText = ''; $lastTagInline = null; $inlineContent = ''; foreach( $childrenOutput as $key => $childOutput ) { if ( $childOutput[0] === true )// is inline { if( $childOutput[1] === ' ' ) { if ( isset( $childrenOutput[$key+1] ) && $childrenOutput[$key+1][0] === false ) continue; else if ( isset( $childrenOutput[ $key - 1 ] ) && $childrenOutput[ $key - 1 ][0] === false ) continue; } $inlineContent .= $childOutput[1]; } // Only render paragraph if current tag is block and previous was an inline tag // OR if current one is inline and it's the last item in the child list if ( ( $childOutput[0] === false && $lastTagInline === true ) || ( $childOutput[0] === true && !isset( $childrenOutput[ $key + 1 ] ) ) ) { $tagText .= $this->renderTag( $element, $inlineContent, $vars ); $inlineContent = ''; } if ( $childOutput[0] === false )// is block $tagText .= $childOutput[1]; $lastTagInline = $childOutput[0]; } return array( false, $tagText ); } /* Count child elemnts, ignoring whitespace and text * * @param DOMElement $parent * @return int */ protected static function childTagCount( DOMElement $parent ) { $count = 0; foreach( $parent->childNodes as $child ) { if ( $child instanceof DOMElement ) $count++; } return $count; } function renderInline( $element, $childrenOutput, $vars ) { $renderedArray = array(); $lastTagInline = null; $inlineContent = ''; foreach( $childrenOutput as $key=>$childOutput ) { if ( $childOutput[0] === true )// is inline $inlineContent .= $childOutput[1]; // Only render tag if current tag is block and previous was an inline tag // OR if current one is inline and it's the last item in the child list if ( ( $childOutput[0] === false && $lastTagInline === true ) || ( $childOutput[0] === true && !isset( $childrenOutput[ $key + 1 ] ) ) ) { $tagText = $this->renderTag( $element, $inlineContent, $vars ); $renderedArray[] = array( true, $tagText ); $inlineContent = ''; } if ( $childOutput[0] === false )// is block $renderedArray[] = array( false, $childOutput[1] ); $lastTagInline = $childOutput[0]; } return $renderedArray; } function renderLine( $element, $childrenOutput, $vars ) { $renderedArray = array(); $lastTagInline = null; $inlineContent = ''; foreach( $childrenOutput as $key=>$childOutput ) { if ( $childOutput[0] === true )// is inline $inlineContent .= $childOutput[1]; // Render line tag only if the last part of childrenOutput is inline and the next tag // within the same paragraph is 'line' too. if ( $childOutput[0] === false && $lastTagInline === true ) { $renderedArray[] = array( true, $inlineContent ); $inlineContent = ''; } elseif ( $childOutput[0] === true && !isset( $childrenOutput[ $key + 1 ] ) ) { $next = $element->nextSibling; // Make sure we get next element that is an element (ignoring whitespace) while ( $next && !$next instanceof DOMElement ) { $next = $next->nextSibling; } if ( $next && $next->nodeName == 'line' ) { $tagText = $this->renderTag( $element, $inlineContent, $vars ); $renderedArray[] = array( true, $tagText ); } else $renderedArray[] = array( true, $inlineContent ); } if ( $childOutput[0] === false )// is block $renderedArray[] = array( false, $childOutput[1] ); $lastTagInline = $childOutput[0]; } return $renderedArray; } function renderCustom( $element, $childrenOutput, $vars ) { if ( $this->XMLSchema->isInline( $element ) ) { $ret = $this->renderInline( $element, $childrenOutput, $vars ); } else { $ret = $this->renderAll( $element, $childrenOutput, $vars ); } return $ret; } function renderChildrenOnly( $element, $childrenOutput, $vars ) { $tagText = ''; foreach( $childrenOutput as $childOutput ) { $tagText .= $childOutput[1]; } return array( false, $tagText ); } function renderText( $element, $childrenOutput, $vars ) { if ( $element->parentNode->nodeName != 'literal' ) { if ( trim( $element->textContent ) === '' && ( ( $element->previousSibling && $element->previousSibling->nodeName === 'line' ) || ( $element->nextSibling && $element->nextSibling->nodeName === 'line' ) ) ) { // spaces before or after a line element are irrelevant return array( true, '' ); } $text = htmlspecialchars( $element->textContent ); $text = str_replace( array( '&amp;nbsp;', "\xC2\xA0" ), '&nbsp;', $text); // Get rid of linebreak and spaces stored in xml file $text = str_replace( "\n", '', $text ); if ( $this->AllowMultipleSpaces ) $text = str_replace( ' ', ' &nbsp;', $text ); else $text = preg_replace( "# +#", " ", $text ); if ( $this->AllowNumericEntities ) $text = preg_replace( '/&amp;#([0-9]+);/', '&#\1;', $text ); } else { $text = $element->textContent; } return array( true, $text ); } /// Array of parameters for rendering tags that are children of 'link' tag public $LinkParameters = array(); public $HeaderCount = array(); /** * Stack of section levels saved when entering tables. * @var array */ protected $SectionLevelStack = array(); public $RenderParagraphInTableCells = true; } ?>
gpl-2.0
md-5/jdk10
test/jdk/sun/security/mscapi/ProviderClassOption.java
1509
/* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 8231598 * @requires os.family == "windows" * @library /test/lib * @summary keytool does not export sun.security.mscapi */ import jdk.test.lib.SecurityTools; public class ProviderClassOption { public static void main(String[] args) throws Throwable { SecurityTools.keytool("-v -storetype Windows-ROOT -list" + " -providerClass sun.security.mscapi.SunMSCAPI") .shouldHaveExitValue(0); } }
gpl-2.0
gnehzuil/GeoSVR
src/ns2/diffusion/routing_table.h
3999
/* * routing_table.h * Copyright (C) 2000 by the University of Southern California * $Id: routing_table.h,v 1.5 2005/08/25 18:58:04 johnh Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * * The copyright of this module includes the following * linking-with-specific-other-licenses addition: * * In addition, as a special exception, the copyright holders of * this module give you permission to combine (via static or * dynamic linking) this module with free software programs or * libraries that are released under the GNU LGPL and with code * included in the standard release of ns-2 under the Apache 2.0 * license or under otherwise-compatible licenses with advertising * requirements (or modified versions of such code, with unchanged * license). You may copy and distribute such a system following the * terms of the GNU GPL for this module and the licenses of the * other code concerned, provided that you include the source code of * that other code when and as the GNU GPL requires distribution of * source code. * * Note that people who make modified versions of this module * are not obligated to grant this special exception for their * modified versions; it is their choice whether to do so. The GNU * General Public License gives permission to release a modified * version without this exception; this exception also makes it * possible to release a modified version which carries forward this * exception. * */ /********************************************************************/ /* routing_table.h : Chalermek Intanagonwiwat (USC/ISI) 08/16/99 */ /********************************************************************/ // Important Note: Work still in progress ! #ifndef ns_routing_table_h #define ns_routing_table_h #include <assert.h> #include <math.h> #include <stdio.h> #include <signal.h> #include <float.h> #include <tcl.h> #include <stdlib.h> #include "diff_header.h" #include "agent.h" #include "tclcl.h" #include "ip.h" #include "config.h" #include "packet.h" #include "trace.h" #include "random.h" #include "classifier.h" #include "node.h" #include "iflist.h" #include "hash_table.h" #include "arp.h" #include "mac.h" #include "ll.h" #include "dsr/path.h" // Routing Entry class Diff_Routing_Entry { public: int counter; int num_active; int num_iif; Out_List *active; // active and up oif Out_List *inactive; // inactive and down oif In_List *iif; // active and up iif In_List *down_iif; // inactive and down iif Agent_List *source; Agent_List *sink; double last_fwd_time; // the last time forwarding interest // For Diffusion/RateGradient int new_org_counter; // Across all incoming gradients. Diff_Routing_Entry(); void reset(); void clear_outlist(Out_List *); void clear_inlist(In_List *); void clear_agentlist(Agent_List *); int MostRecvOrg(); bool ExistOriginalGradient(); void IncRecvCnt(ns_addr_t); void CntPosSend(ns_addr_t); void CntNeg(ns_addr_t); void CntNewSub(ns_addr_t); void ClrNewSub(ns_addr_t); void CntNewOrg(ns_addr_t); void CntOldOrg(ns_addr_t); void ClrAllNewOrg(); void ClrAllOldOrg(); In_List *MostRecentIn(); In_List *AddInList(ns_addr_t); }; #endif
gpl-2.0
johnbeard/kicad-git
bitmaps_png/cpp_26/axis3d_left.cpp
8521
/* Do not modify this file, it was automatically generated by the * PNG2cpp CMake script, using a *.png file as input. */ #include <bitmaps.h> static const unsigned char png[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, 0xce, 0x00, 0x00, 0x05, 0x16, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xa5, 0x96, 0x09, 0x4c, 0x93, 0x67, 0x18, 0xc7, 0x3f, 0x88, 0x82, 0x20, 0xa2, 0x5c, 0xa2, 0xd5, 0xb9, 0x69, 0x16, 0xc6, 0xa6, 0xd1, 0xc5, 0xb8, 0x2c, 0x33, 0x5e, 0x73, 0xcb, 0x9c, 0x91, 0xea, 0x50, 0x5a, 0xe8, 0x81, 0x42, 0x69, 0x6b, 0x5b, 0x58, 0x27, 0x1e, 0x5c, 0x82, 0x95, 0x43, 0x5b, 0xc1, 0x29, 0x5a, 0x39, 0x86, 0xdc, 0x0a, 0x82, 0xe7, 0x64, 0x31, 0x33, 0x11, 0x23, 0xc3, 0xe9, 0x24, 0x78, 0x11, 0x95, 0x38, 0xf1, 0x98, 0x8a, 0x84, 0xa9, 0xa5, 0x65, 0x28, 0x08, 0xf6, 0xfb, 0xfe, 0x7b, 0xbf, 0x26, 0x92, 0x95, 0x16, 0xa8, 0xf3, 0x49, 0x9e, 0x7c, 0x47, 0xbf, 0xb7, 0xbf, 0xf7, 0x39, 0xde, 0xe7, 0x79, 0x28, 0x00, 0x94, 0x23, 0x4a, 0x71, 0xc5, 0x52, 0xf7, 0x10, 0x49, 0x01, 0xb5, 0x4c, 0x28, 0x27, 0xfa, 0x25, 0xb5, 0x54, 0x34, 0x99, 0xa2, 0x28, 0x27, 0x87, 0xd7, 0x0f, 0xfb, 0x01, 0x8f, 0xe7, 0xe6, 0xb2, 0x4a, 0xd2, 0xe8, 0xb4, 0x3c, 0x1c, 0x8b, 0x92, 0xb5, 0xd8, 0x58, 0x54, 0xd1, 0xf3, 0xed, 0x96, 0x1d, 0x86, 0x69, 0xd2, 0xd8, 0x8e, 0x31, 0x3c, 0xc9, 0x0b, 0x6f, 0x81, 0xfc, 0xf1, 0x84, 0x70, 0x55, 0xdd, 0xb8, 0x50, 0xd9, 0x5e, 0x76, 0x33, 0x14, 0x57, 0xb0, 0x90, 0x5a, 0x1e, 0xc6, 0x79, 0x2b, 0x10, 0xc5, 0x15, 0x7d, 0x33, 0x62, 0x65, 0x64, 0xaf, 0x4f, 0x74, 0x0a, 0xfc, 0x93, 0xf7, 0x40, 0x91, 0x5f, 0x86, 0x81, 0xf2, 0xb7, 0xa9, 0x13, 0x17, 0x9a, 0xef, 0xa0, 0xec, 0xec, 0x79, 0x24, 0x96, 0x55, 0xf7, 0x04, 0xa5, 0xee, 0x34, 0x04, 0xc8, 0x37, 0x18, 0xc6, 0xf2, 0x65, 0x5d, 0xde, 0x61, 0x72, 0x13, 0xb5, 0x74, 0xa9, 0xeb, 0x90, 0xa0, 0x91, 0xdf, 0x45, 0x56, 0xbb, 0xac, 0x8a, 0x62, 0x66, 0x65, 0x57, 0x61, 0xf1, 0xb1, 0x06, 0x04, 0x66, 0x96, 0x41, 0x9a, 0x53, 0x02, 0x47, 0xc4, 0x4c, 0xd3, 0xf8, 0x3a, 0x59, 0x4b, 0x7b, 0xf0, 0xa2, 0xe8, 0x41, 0x41, 0x14, 0x37, 0x22, 0xd0, 0x35, 0x44, 0x6a, 0xe4, 0xa8, 0x52, 0x98, 0x90, 0x9a, 0xeb, 0x10, 0xd7, 0xb6, 0x40, 0x70, 0xe6, 0x4f, 0x7c, 0xae, 0x3f, 0x8a, 0xc8, 0x7d, 0xc5, 0x0e, 0x81, 0x84, 0x59, 0xfb, 0xe8, 0x05, 0x09, 0xe9, 0xb4, 0xaf, 0x50, 0x61, 0xb2, 0xeb, 0x3a, 0xe7, 0x20, 0xf1, 0x56, 0x57, 0x62, 0xc5, 0xa2, 0x9c, 0xe3, 0x88, 0xbd, 0xd4, 0x8e, 0xb8, 0xc6, 0xe7, 0xd8, 0xd8, 0xf0, 0x14, 0x31, 0x17, 0x9e, 0x60, 0x71, 0xc1, 0x2f, 0x58, 0xb3, 0xb7, 0x70, 0x58, 0xc8, 0xfa, 0xa2, 0x0a, 0xf3, 0x74, 0x55, 0x9c, 0x99, 0x66, 0x18, 0xb0, 0xae, 0xb3, 0x02, 0x51, 0xc1, 0xab, 0x7d, 0x46, 0xf1, 0xa4, 0x77, 0x7d, 0x24, 0x1b, 0x98, 0xd0, 0x9a, 0x6b, 0x58, 0xf7, 0x47, 0x3b, 0x92, 0xaf, 0x1a, 0x91, 0xd6, 0xd4, 0x85, 0xc4, 0xcb, 0x1d, 0x50, 0x5f, 0x6c, 0xc3, 0x57, 0xfb, 0x4f, 0x41, 0xb4, 0xbb, 0x60, 0x48, 0xc8, 0xce, 0xe3, 0xa7, 0xe8, 0xc9, 0x11, 0xdf, 0x9b, 0xbb, 0x7b, 0xfb, 0x2c, 0xcf, 0x24, 0x41, 0x8c, 0x56, 0xa0, 0x51, 0x21, 0x51, 0x1d, 0x6e, 0x02, 0x15, 0x3e, 0xd2, 0xe4, 0x60, 0x7e, 0xfe, 0x49, 0xf0, 0x4f, 0x5e, 0x81, 0xa2, 0xfe, 0x21, 0x14, 0xe7, 0x1f, 0x21, 0xaa, 0xee, 0x01, 0x71, 0xdf, 0x1d, 0xcc, 0xcd, 0xff, 0x19, 0xfc, 0xac, 0xbc, 0x41, 0x21, 0x07, 0xcf, 0xfd, 0xce, 0xf8, 0x89, 0x94, 0x74, 0xbb, 0xc9, 0xd4, 0xff, 0xce, 0x93, 0x2f, 0xeb, 0xb0, 0x02, 0xb9, 0xf3, 0xe5, 0x4f, 0xa7, 0xa5, 0xe6, 0x21, 0x50, 0x5b, 0x8c, 0xf7, 0x36, 0x65, 0x62, 0x9c, 0x64, 0x23, 0x5c, 0xf9, 0x72, 0xf8, 0xc8, 0x13, 0x30, 0x35, 0x71, 0x17, 0x66, 0x64, 0x95, 0xe3, 0xc3, 0x8c, 0x02, 0xac, 0xd0, 0xea, 0xed, 0x42, 0x4e, 0x5f, 0x69, 0x82, 0x57, 0xa8, 0x8c, 0xb9, 0xf5, 0xb0, 0xb5, 0xff, 0x5d, 0xdf, 0x6b, 0x33, 0xc6, 0x86, 0xca, 0x9e, 0x0d, 0x00, 0xc9, 0x1e, 0x72, 0xd2, 0xf3, 0x31, 0xb3, 0xbc, 0x16, 0xb3, 0x2b, 0xce, 0x61, 0x4e, 0x65, 0x1d, 0xe6, 0x90, 0xeb, 0xf4, 0xdc, 0xe3, 0x98, 0x42, 0x00, 0x3e, 0xb1, 0xdb, 0xe0, 0x2a, 0x8c, 0x06, 0x49, 0x75, 0x7c, 0xa2, 0x8a, 0xa7, 0xa5, 0xfa, 0x42, 0x73, 0x69, 0x6d, 0x3d, 0x6e, 0xfc, 0xf5, 0xd8, 0x92, 0xda, 0x5e, 0x61, 0x32, 0xa6, 0xf6, 0xfa, 0x4d, 0x2b, 0x78, 0xe7, 0xcb, 0x6e, 0x12, 0xa3, 0xb5, 0xad, 0x03, 0x5d, 0x77, 0xd3, 0x23, 0x3e, 0x0b, 0xfe, 0xb9, 0xc7, 0xc0, 0xc9, 0x3b, 0x81, 0x49, 0xc4, 0x4d, 0xac, 0x4e, 0x24, 0xf7, 0xec, 0x3b, 0x6f, 0xfd, 0x61, 0xb8, 0x6b, 0xf6, 0x61, 0x49, 0xda, 0x8f, 0xb8, 0x74, 0xbb, 0x05, 0x09, 0xa5, 0x55, 0x58, 0x98, 0x98, 0x41, 0x4f, 0x89, 0x54, 0x9b, 0x3d, 0x79, 0x52, 0x94, 0x9c, 0xa9, 0xb7, 0xb1, 0xb2, 0xdd, 0x68, 0x02, 0xc9, 0xba, 0x7b, 0xd6, 0xa0, 0xe0, 0xc8, 0x8b, 0x4e, 0xea, 0x54, 0x50, 0x3b, 0x8a, 0xe1, 0xc4, 0x6a, 0x66, 0x89, 0x45, 0xd9, 0xe7, 0x7e, 0x4d, 0xda, 0x85, 0xc5, 0x9a, 0x4c, 0x9b, 0x3f, 0xf4, 0x13, 0x29, 0x18, 0x7b, 0xee, 0xbc, 0xdf, 0xfe, 0x94, 0xfc, 0xa6, 0x6c, 0xb6, 0x02, 0xb9, 0x04, 0xaf, 0xf9, 0xd5, 0x25, 0x46, 0x83, 0x11, 0x5a, 0x02, 0xd0, 0x15, 0x5b, 0x03, 0xde, 0xe8, 0xe6, 0xdd, 0x58, 0x90, 0xa2, 0xb3, 0x05, 0x09, 0xed, 0x83, 0x6e, 0x3d, 0x6a, 0xc5, 0x78, 0xb1, 0xea, 0x8a, 0x15, 0xc8, 0x99, 0x2b, 0xae, 0xf4, 0x20, 0xa0, 0xd1, 0xda, 0x52, 0xb8, 0x12, 0x1d, 0xa1, 0x2b, 0xb1, 0x58, 0xd6, 0x0f, 0xd1, 0x16, 0x62, 0xb4, 0x3c, 0x1e, 0xb3, 0x63, 0x53, 0x30, 0x3f, 0x3e, 0x0d, 0x77, 0xdb, 0xda, 0x71, 0xaa, 0xf1, 0x9a, 0xe5, 0x3a, 0x98, 0x45, 0x97, 0x5b, 0xee, 0xc3, 0x5f, 0xac, 0xba, 0x60, 0x7d, 0x8e, 0xb8, 0xc2, 0x5c, 0xef, 0x68, 0x0d, 0x7c, 0x75, 0x07, 0x30, 0x4e, 0x5b, 0x4e, 0x80, 0x65, 0x18, 0x45, 0x80, 0x23, 0x89, 0x85, 0xce, 0xe9, 0x3f, 0x61, 0x4c, 0xc4, 0x0f, 0x50, 0x92, 0x3a, 0xc7, 0x96, 0x96, 0xdb, 0xad, 0x6d, 0xe8, 0xee, 0xed, 0xc5, 0xba, 0xfd, 0x07, 0x20, 0xd3, 0x17, 0x82, 0xd4, 0x34, 0x66, 0xc9, 0x96, 0x1d, 0x38, 0x73, 0xed, 0x06, 0x9a, 0x1f, 0x3d, 0x41, 0x9b, 0xc1, 0x68, 0x01, 0xd5, 0xdf, 0xbc, 0xcd, 0x82, 0x6a, 0xad, 0x41, 0x41, 0xa2, 0xed, 0x7e, 0xca, 0x14, 0xe6, 0xfd, 0xac, 0x43, 0xe0, 0x64, 0x56, 0xc0, 0x4f, 0x77, 0x10, 0x5e, 0xba, 0x72, 0xb8, 0x69, 0x72, 0xe1, 0x29, 0x8e, 0x46, 0xfe, 0xe9, 0xb3, 0x83, 0x9e, 0x1f, 0xd6, 0x75, 0x57, 0xef, 0x3d, 0xb0, 0xc4, 0x44, 0x77, 0xa4, 0x06, 0x9f, 0xaa, 0x93, 0xf0, 0xc4, 0xd0, 0x81, 0x79, 0x71, 0x69, 0x24, 0x19, 0x94, 0x27, 0x06, 0x80, 0xc4, 0x9b, 0x26, 0x28, 0x92, 0x99, 0x19, 0xd9, 0x47, 0x11, 0xb0, 0xab, 0x1a, 0x1f, 0xec, 0xac, 0x82, 0xd7, 0xe6, 0xbd, 0xf0, 0x26, 0x90, 0xba, 0x1b, 0xcd, 0x43, 0x56, 0x03, 0x5f, 0x3b, 0x31, 0xea, 0xea, 0x7e, 0x05, 0xce, 0xea, 0x98, 0x17, 0xa4, 0x65, 0xcc, 0xb3, 0x06, 0x2d, 0x13, 0x49, 0x38, 0x6b, 0x13, 0x99, 0x79, 0xb9, 0x27, 0xf1, 0x99, 0xfe, 0x04, 0x26, 0x27, 0x65, 0x63, 0x8a, 0x74, 0xbd, 0x25, 0x06, 0xc3, 0x89, 0xaf, 0x70, 0xad, 0x0d, 0x48, 0x95, 0x57, 0xf2, 0x92, 0xed, 0x4f, 0x36, 0xfd, 0x88, 0xc4, 0x68, 0xc5, 0x24, 0x79, 0x02, 0xc3, 0x2d, 0x3e, 0x8d, 0x00, 0x72, 0x9e, 0xbe, 0x88, 0x4f, 0x87, 0xe9, 0xc5, 0x4b, 0x87, 0x2a, 0xb5, 0xaf, 0xc0, 0x1a, 0x74, 0xb6, 0xe9, 0x16, 0x5b, 0xe3, 0xee, 0x93, 0x86, 0xe9, 0x62, 0x0b, 0x5a, 0x26, 0x9e, 0x3b, 0x3a, 0x54, 0xc1, 0x7c, 0xbc, 0x21, 0x03, 0x12, 0x7d, 0x91, 0x25, 0xe8, 0x8e, 0xca, 0x7f, 0x41, 0xec, 0xe6, 0x48, 0x02, 0x74, 0x52, 0xcb, 0x05, 0x33, 0xed, 0x76, 0x58, 0x8a, 0x1b, 0x3e, 0x95, 0xb4, 0x6a, 0x86, 0x9f, 0x95, 0xc3, 0x3c, 0x7e, 0x66, 0xc0, 0xdb, 0x08, 0x5b, 0x48, 0xdf, 0x6c, 0x2c, 0x64, 0xfb, 0x9e, 0x2e, 0x0f, 0xbe, 0x2c, 0x79, 0xc8, 0x99, 0x81, 0x0d, 0x1c, 0x31, 0x59, 0xef, 0x15, 0x26, 0x6f, 0x9d, 0x1a, 0xb5, 0xce, 0x18, 0x57, 0x52, 0xd9, 0xc3, 0xd6, 0x31, 0xb6, 0xaf, 0x0c, 0x25, 0xfe, 0xe1, 0x2a, 0xfa, 0x55, 0x5f, 0x1f, 0x0e, 0x9f, 0xbf, 0xc4, 0x90, 0xb5, 0x4d, 0xd4, 0xd6, 0xad, 0xce, 0x0e, 0x0f, 0x27, 0xac, 0x85, 0x23, 0x57, 0x84, 0xab, 0xfd, 0x45, 0xca, 0x06, 0x02, 0xff, 0x27, 0x78, 0x5b, 0xb6, 0xf1, 0xd0, 0x6f, 0x17, 0x61, 0xb4, 0x13, 0xb7, 0x89, 0xab, 0xa3, 0xe9, 0x16, 0x92, 0x34, 0xa4, 0xc9, 0x75, 0xb2, 0xeb, 0xfe, 0xff, 0x14, 0xc4, 0x95, 0xbb, 0x53, 0x41, 0x02, 0xae, 0x8f, 0x50, 0x51, 0xe1, 0xc9, 0x97, 0x3e, 0x9f, 0xa5, 0x4e, 0x32, 0x68, 0x8f, 0xd4, 0xbc, 0x66, 0x4b, 0x0c, 0x2b, 0x9c, 0x35, 0x31, 0xf4, 0x6c, 0xf5, 0xe6, 0x1e, 0xf7, 0xe0, 0x08, 0xc5, 0x3b, 0x8d, 0x5b, 0x36, 0x0b, 0x82, 0xc4, 0xb3, 0xc8, 0x7c, 0xa7, 0xf1, 0x25, 0x05, 0x73, 0xbc, 0x48, 0xd9, 0xc9, 0xa6, 0x37, 0x71, 0xd9, 0xf5, 0x77, 0x9e, 0xeb, 0x86, 0x5c, 0x4c, 0x46, 0x00, 0x97, 0x95, 0x11, 0x29, 0x54, 0x10, 0x6f, 0xd2, 0x70, 0xdf, 0xfe, 0x0b, 0xa8, 0xc5, 0x8c, 0x08, 0x4e, 0x1e, 0x6e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, }; const BITMAP_OPAQUE axis3d_left_xpm[1] = {{ png, sizeof( png ), "axis3d_left_xpm" }}; //EOF
gpl-2.0
CertifiedBlyndGuy/hadron-moto-apq8084
include/linux/pstore_ram.h
2936
/* * Copyright (C) 2010 Marco Stornelli <marco.stornelli@gmail.com> * Copyright (C) 2011 Kees Cook <keescook@chromium.org> * Copyright (C) 2011 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __LINUX_PSTORE_RAM_H__ #define __LINUX_PSTORE_RAM_H__ #include <linux/device.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/types.h> #include <linux/init.h> struct persistent_ram_buffer; struct rs_control; struct persistent_ram_ecc_info { int block_size; int ecc_size; int symsize; int poly; }; struct persistent_ram_zone { phys_addr_t paddr; size_t size; void *vaddr; struct persistent_ram_buffer *buffer; size_t buffer_size; /* ECC correction */ char *par_buffer; char *par_header; struct rs_control *rs_decoder; int corrected_bytes; int bad_blocks; struct persistent_ram_ecc_info ecc_info; char *old_log; size_t old_log_size; }; struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, u32 sig, struct persistent_ram_ecc_info *ecc_info); void persistent_ram_free(struct persistent_ram_zone *prz); void persistent_ram_zap(struct persistent_ram_zone *prz); int persistent_ram_write(struct persistent_ram_zone *prz, const void *s, unsigned int count); void persistent_ram_save_old(struct persistent_ram_zone *prz); size_t persistent_ram_old_size(struct persistent_ram_zone *prz); void *persistent_ram_old(struct persistent_ram_zone *prz); void persistent_ram_free_old(struct persistent_ram_zone *prz); ssize_t persistent_ram_ecc_string(struct persistent_ram_zone *prz, char *str, size_t len); #ifdef CONFIG_PSTORE_RAM_ANNOTATION_APPEND __printf(1, 2) int persistent_ram_annotation_append(const char *fmt, ...); void persistent_ram_annotation_merge(struct persistent_ram_zone *prz); #else static inline __printf(1, 2) void persistent_ram_annotation_append( const char *fmt, ...) { }; static inline void persistent_ram_annotation_merge( struct persistent_ram_zone *prz) { }; #endif void *persistent_ram_map(phys_addr_t start, phys_addr_t size); void persistent_ram_unmap(void *vaddr, phys_addr_t start, phys_addr_t size); /* * Ramoops platform data * @mem_size memory size for ramoops * @mem_address physical memory address to contain ramoops */ struct ramoops_platform_data { unsigned long mem_size; unsigned long mem_address; unsigned long record_size; unsigned long console_size; unsigned long ftrace_size; unsigned long annotate_size; int dump_oops; struct persistent_ram_ecc_info ecc_info; }; #endif
gpl-2.0
vishwaAbhinav/OpenNMS
opennms-webapp/src/main/java/org/opennms/web/alarm/filter/NegativeEventParmLikeFilter.java
2058
/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2011-2012 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. * * OpenNMS(R) is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * OpenNMS(R) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OpenNMS(R). If not, see: * http://www.gnu.org/licenses/ * * For more information contact: * OpenNMS(R) Licensing <license@opennms.org> * http://www.opennms.org/ * http://www.opennms.com/ *******************************************************************************/ package org.opennms.web.alarm.filter; import org.opennms.web.filter.NoSubstringFilter; public class NegativeEventParmLikeFilter extends NoSubstringFilter { public static final String TYPE = "noparmmatchany"; public NegativeEventParmLikeFilter(String value) { super(TYPE, "eventParms", "eventParms", value + "(string,text)"); } @Override public String getTextDescription() { String strippedType = getValue().replace("(string,text)", ""); String[] parms = strippedType.split("="); StringBuffer buffer = new StringBuffer(parms[0] + " is not \""); buffer.append(parms[parms.length - 1]); buffer.append("\""); return buffer.toString(); } @Override public String getDescription() { return TYPE + "=" + getValueString().replace("(string,text)", ""); } }
gpl-2.0
tejdeeps/tejcs.com
webtesting/angular/angularDownloaded/docs/examples/example-example38/index-production.html
631
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example - example-example38-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> <script src="script.js"></script> </head> <body ng-app="form-example-modify-validators"> <form name="form" class="css-form" novalidate> <div> Overwritten Email: <input type="email" ng-model="myEmail" overwrite-email name="overwrittenEmail" /> <span ng-show="form.overwrittenEmail.$error.email">This email format is invalid!</span><br> Model: {{myEmail}} </div> </form> </body> </html>
gpl-2.0
bensonhsu2013/diff_variant_i8160
arch/arm/mach-ux500/prcmu-regs-db8500.h
5197
/* * Copyright (c) 2009 ST-Ericsson SA * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. */ #ifndef __MACH_PRCMU_REGS_H #define __MACH_PRCMU_REGS_H #include <linux/bitops.h> #include <mach/hardware.h> #define BITS(_start, _end) ((BIT(_end) - BIT(_start)) + BIT(_end)) #define PRCM_ARM_PLLDIVPS 0x118 #define PRCM_ARM_PLLDIVPS_ARM_BRM_RATE BITS(0, 5) #define PRCM_ARM_PLLDIVPS_MAX_MASK 0xF #define PRCM_PLLARM_LOCKP 0x0A8 #define PRCM_PLLARM_LOCKP_PRCM_PLLARM_LOCKP3 BIT(1) #define PRCM_ARM_CHGCLKREQ 0x114 #define PRCM_ARM_CHGCLKREQ_PRCM_ARM_CHGCLKREQ BIT(0) #define PRCM_PLLARM_ENABLE 0x98 #define PRCM_PLLARM_ENABLE_PRCM_PLLARM_ENABLE BIT(0) #define PRCM_PLLARM_ENABLE_PRCM_PLLARM_COUNTON BIT(8) #define PRCM_ARMCLKFIX_MGT 0x0 #define PRCM_A9PL_FORCE_CLKEN 0x19C #define PRCM_A9_RESETN_CLR 0x1f4 #define PRCM_A9_RESETN_SET 0x1f0 #define PRCM_ARM_LS_CLAMP 0x30C #define PRCM_SRAM_A9 0x308 #define PRCM_A9PL_FORCE_CLKEN_PRCM_A9PL_FORCE_CLKEN BIT(0) #define PRCM_A9PL_FORCE_CLKEN_PRCM_A9AXI_FORCE_CLKEN BIT(1) /* ARM WFI Standby signal register */ #define PRCM_ARM_WFI_STANDBY 0x130 #define PRCM_IOCR 0x310 #define PRCM_IOCR_IOFORCE BIT(0) /* CPU mailbox registers */ #define PRCM_MBOX_CPU_VAL 0x0FC #define PRCM_MBOX_CPU_SET 0x100 /* Dual A9 core interrupt management unit registers */ #define PRCM_A9_MASK_REQ 0x328 #define PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ BIT(0) #define PRCM_A9_MASK_ACK 0x32C #define PRCM_ARMITMSK31TO0 0x11C #define PRCM_ARMITMSK63TO32 0x120 #define PRCM_ARMITMSK95TO64 0x124 #define PRCM_ARMITMSK127TO96 0x128 #define PRCM_POWER_STATE_VAL 0x25C #define PRCM_ARMITVAL31TO0 0x260 #define PRCM_ARMITVAL63TO32 0x264 #define PRCM_ARMITVAL95TO64 0x268 #define PRCM_ARMITVAL127TO96 0x26C #define PRCM_HOSTACCESS_REQ 0x334 #define PRCM_HOSTACCESS_REQ_HOSTACCESS_REQ BIT(0) #define PRCM_HOSTACCESS_REQ_WAKE_REQ BIT(16) #define PRCM_ARM_IT1_CLR 0x48C #define PRCM_ARM_IT1_VAL 0x494 #define PRCM_MOD_AWAKE_STATUS 0x4A0 #define PRCM_MOD_AWAKE_STATUS_PRCM_MOD_COREPD_AWAKE BIT(0) #define PRCM_MOD_AWAKE_STATUS_PRCM_MOD_AAPD_AWAKE BIT(1) #define PRCM_MOD_AWAKE_STATUS_PRCM_MOD_VMODEM_OFF_ISO BIT(2) #define PRCM_ITSTATUS0 0x148 #define PRCM_ITSTATUS1 0x150 #define PRCM_ITSTATUS2 0x158 #define PRCM_ITSTATUS3 0x160 #define PRCM_ITSTATUS4 0x168 #define PRCM_ITSTATUS5 0x484 #define PRCM_ITCLEAR5 0x488 #define PRCM_ARMIT_MASKXP70_IT 0x1018 /* System reset register */ #define PRCM_APE_SOFTRST 0x228 /* Level shifter and clamp control registers */ #define PRCM_MMIP_LS_CLAMP_SET 0x420 #define PRCM_MMIP_LS_CLAMP_CLR 0x424 /* PRCMU HW semaphore */ #define PRCM_SEM 0x400 #define PRCM_SEM_PRCM_SEM BIT(0) /* PRCMU clock/PLL/reset registers */ #define PRCM_PLLDSI_FREQ 0x500 #define PRCM_PLLDSI_ENABLE 0x504 #define PRCM_PLLDSI_LOCKP 0x508 #define PRCM_DSI_PLLOUT_SEL 0x530 #define PRCM_DSITVCLK_DIV 0x52C #define PRCM_APE_RESETN_SET 0x1E4 #define PRCM_APE_RESETN_CLR 0x1E8 #define PRCM_TCR 0x1C8 #define PRCM_TCR_TENSEL_MASK BITS(0, 7) #define PRCM_TCR_STOP_TIMERS BIT(16) #define PRCM_TCR_DOZE_MODE BIT(17) #define PRCM_CLKOCR 0x1CC #define PRCM_CLKOCR_CLKODIV0_SHIFT 0 #define PRCM_CLKOCR_CLKODIV0_MASK BITS(0, 5) #define PRCM_CLKOCR_CLKOSEL0_SHIFT 6 #define PRCM_CLKOCR_CLKOSEL0_MASK BITS(6, 8) #define PRCM_CLKOCR_CLKODIV1_SHIFT 16 #define PRCM_CLKOCR_CLKODIV1_MASK BITS(16, 21) #define PRCM_CLKOCR_CLKOSEL1_SHIFT 22 #define PRCM_CLKOCR_CLKOSEL1_MASK BITS(22, 24) #define PRCM_CLKOCR_CLK1TYPE BIT(28) #define PRCM_ACLK_MGT 0x004 #define PRCM_SGACLK_MGT 0x014 #define PRCM_UARTCLK_MGT 0x018 #define PRCM_MSP02CLK_MGT 0x01C #define PRCM_MSP1CLK_MGT 0x288 #define PRCM_I2CCLK_MGT 0x020 #define PRCM_SDMMCCLK_MGT 0x024 #define PRCM_SLIMCLK_MGT 0x028 #define PRCM_PER1CLK_MGT 0x02C #define PRCM_PER2CLK_MGT 0x030 #define PRCM_PER3CLK_MGT 0x034 #define PRCM_PER5CLK_MGT 0x038 #define PRCM_PER6CLK_MGT 0x03C #define PRCM_PER7CLK_MGT 0x040 #define PRCM_LCDCLK_MGT 0x044 #define PRCM_BMLCLK_MGT 0x04C #define PRCM_HSITXCLK_MGT 0x050 #define PRCM_HSIRXCLK_MGT 0x054 #define PRCM_HDMICLK_MGT 0x058 #define PRCM_APEATCLK_MGT 0x05C #define PRCM_APETRACECLK_MGT 0x060 #define PRCM_MCDECLK_MGT 0x064 #define PRCM_IPI2CCLK_MGT 0x068 #define PRCM_DSIALTCLK_MGT 0x06C #define PRCM_DMACLK_MGT 0x074 #define PRCM_B2R2CLK_MGT 0x078 #define PRCM_TVCLK_MGT 0x07C #define PRCM_UNIPROCLK_MGT 0x278 #define PRCM_SSPCLK_MGT 0x280 #define PRCM_RNGCLK_MGT 0x284 #define PRCM_UICCCLK_MGT 0x27C #define PRCM_CLK_MGT_CLKPLLDIV_MASK BITS(0, 4) #define PRCM_CLK_MGT_CLKPLLSW_MASK BITS(5, 7) #define PRCM_CLK_MGT_CLKEN BIT(8) /* ePOD and memory power signal control registers */ #define PRCM_EPOD_C_SET 0x410 #define PRCM_SRAM_LS_SLEEP 0x304 /* Debug power control unit registers */ #define PRCM_POWER_STATE_SET 0x254 /* Miscellaneous unit registers */ #define PRCM_DSI_SW_RESET 0x324 #define PRCM_GPIOCR 0x138 /* GPIOCR register */ #define PRCM_GPIOCR_SPI2_SELECT BIT(23) #define PRCM_DDR_SUBSYS_APE_MINBW 0x438 #define PRCM_CGATING_BYPASS 0x134 #define PRCM_CGATING_BYPASS_ICN2 BIT(6) #endif /* __MACH_PRCMU__REGS_H */
gpl-2.0
SiniTurk/android_kernel_samsung_kylevexx
arch/arm/mach-hawaii/dev-sensor_gp2ap002.c
1650
#include <linux/version.h> #include <linux/init.h> #include <linux/device.h> #include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/mfd/bcm590xx/pmic.h> #include <linux/of_platform.h> #include <linux/of.h> #include <linux/of_fdt.h> #include <mach/pinmux.h> #ifdef CONFIG_IOMMU_API #include <plat/bcm_iommu.h> #endif #ifdef CONFIG_ANDROID_PMEM #include <linux/android_pmem.h> #endif #ifdef CONFIG_ION_BCM_NO_DT #include <linux/ion.h> #include <linux/broadcom/bcm_ion.h> #endif #include <linux/serial_8250.h> #include <linux/i2c.h> #include <linux/i2c-kona.h> #include <linux/spi/spi.h> #include <linux/clk.h> #include <linux/bootmem.h> #include <linux/input.h> #include <linux/mfd/bcm590xx/core.h> #include <linux/gpio.h> #include <linux/gpio_keys.h> #include <linux/i2c-kona.h> #include <linux/i2c.h> #include <linux/i2c/tango_ts.h> #include <linux/i2c/melfas_ts.h> #include <asm/mach/arch.h> #include <asm/mach-types.h> #include <asm/mach/map.h> #include <asm/hardware/gic.h> #include <mach/hardware.h> #include <mach/hardware.h> #include <mach/kona_headset_pd.h> #include <mach/kona.h> #include <mach/sdio_platform.h> #include <mach/hawaii.h> #include <mach/io_map.h> #include <mach/irqs.h> #include <mach/rdb/brcm_rdb_uartb.h> #include <mach/clock.h> #include <plat/spi_kona.h> #include <plat/chal/chal_trace.h> #include <plat/pi_mgr.h> #include <plat/spi_kona.h> #include <trace/stm.h> #ifdef CONFIG_HAS_WAKELOCK #include <linux/wakelock.h> #endif #include <mach/pinmux.h> #if defined(CONFIG_SENSORS_GP2AP002) #include <linux/gp2ap002_dev.h> #endif #if defined(CONFIG_SENSORS_GP2AP002) #endif
gpl-2.0
gruberasheridc/snort-2.9.8.0
src/dynamic-examples/dynamic-rule/sid637.c
3897
/**************************************************************************** * * Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved. * Copyright (C) 2005-2013 Sourcefire, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. You may not use, modify or * distribute this program under any other version of the GNU General * Public License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ****************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "sf_snort_plugin_api.h" #include "sf_snort_packet.h" #include "detection_lib_meta.h" /* * C-language example for SID 637 * * alert udp $EXTERNAL_NET any -> $HOME_NET any \ * (msg:"SCAN Webtrends Scanner UDP Probe"; \ * content:"|0A|help|0A|quite|0A|"; \ * reference:arachnids,308; classtype:attempted-recon; \ * sid:637; rev:3;) * */ /* content:"|0A|help|0A|quite|0A|"; */ static ContentInfo sid637content = { (u_int8_t *)"|0A|help|0A|quite|0A|",/* pattern to search for */ 0, /* depth */ 0, /* offset */ CONTENT_BUF_NORMALIZED, /* flags */ NULL, /* holder for boyer/moore info */ NULL, /* holder for byte representation of "\nhelp\nquite\n" */ 0, /* holder for length of byte representation */ 0, /* holder of increment length */ 0, /* holder for fp offset */ 0, /* holder for fp length */ 0, /* holder for fp only */ NULL, // offset_refId NULL, // depth_refId NULL, // offset_location NULL // depth_location }; static RuleOption sid637option1 = { OPTION_TYPE_CONTENT, { &sid637content } }; /* references for sid 637 */ static RuleReference sid637ref_arachnids = { "arachnids", /* Type */ "308" /* value */ }; static RuleReference *sid637refs[] = { &sid637ref_arachnids, NULL }; RuleOption *sid637options[] = { &sid637option1, NULL }; Rule sid637 = { /* protocol header, akin to => tcp any any -> any any */ { IPPROTO_UDP, /* proto */ EXTERNAL_NET, /* source IP */ ANY_PORT, /* source port(s) */ 1, /* direction, bi-directional */ HOME_NET, /* destination IP */ ANY_PORT /* destination port(s) */ }, /* metadata */ { 3, /* genid -- use 3 to distinguish a C rule */ 637, /* sigid */ 3, /* revision */ "attempted-recon", /* classification */ 0, /* priority */ "SCAN Webtrends Scanner UDP Probe", /* message */ sid637refs, /* ptr to references */ NULL /* Meta data */ }, sid637options, /* ptr to rule options */ NULL, /* Use internal eval func */ 0, /* Holder, not yet initialized, used internally */ 0, /* Holder, option count, used internally */ 0, /* Holder, no alert used internally for flowbits */ NULL /* Holder, rule data, used internally */ };
gpl-2.0
parheliamm/T440p-kernel
ubuntu/vbox/vboxvideo/vbox_fb.c
13382
/* $Id: vbox_fb.c $ */ /** @file * VirtualBox Additions Linux kernel video driver */ /* * Copyright (C) 2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. * -------------------------------------------------------------------- * * This code is based on * ast_fb.c * with the following copyright and permission notice: * * Copyright 2012 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * */ /* * Authors: Dave Airlie <airlied@redhat.com> */ /* Include from most specific to most general to be able to override things. */ #include "vbox_drv.h" #include <VBox/VBoxVideo.h> #include <VBox/VMMDev.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/mm.h> #include <linux/tty.h> #include <linux/sysrq.h> #include <linux/delay.h> #include <linux/fb.h> #include <linux/init.h> #include <drm/drmP.h> #include <drm/drm_crtc.h> #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> #include "vbox_drv.h" /** * Tell the host about dirty rectangles to update. */ static void vbox_dirty_update(struct vbox_fbdev *fbdev, int x, int y, int width, int height) { struct drm_device *dev = fbdev->helper.dev; int i; struct drm_gem_object *obj; struct vbox_bo *bo; int src_offset, dst_offset; int bpp = (fbdev->afb.base.bits_per_pixel + 7)/8; int ret = -EBUSY; bool unmap = false; bool store_for_later = false; int x2, y2; unsigned long flags; struct drm_clip_rect rect; LogFunc(("vboxvideo: %d\n", __LINE__)); obj = fbdev->afb.obj; bo = gem_to_vbox_bo(obj); /* * try and reserve the BO, if we fail with busy * then the BO is being moved and we should * store up the damage until later. */ if (drm_can_sleep()) ret = vbox_bo_reserve(bo, true); if (ret) { if (ret != -EBUSY) return; store_for_later = true; } x2 = x + width - 1; y2 = y + height - 1; spin_lock_irqsave(&fbdev->dirty_lock, flags); if (fbdev->y1 < y) y = fbdev->y1; if (fbdev->y2 > y2) y2 = fbdev->y2; if (fbdev->x1 < x) x = fbdev->x1; if (fbdev->x2 > x2) x2 = fbdev->x2; if (store_for_later) { fbdev->x1 = x; fbdev->x2 = x2; fbdev->y1 = y; fbdev->y2 = y2; spin_unlock_irqrestore(&fbdev->dirty_lock, flags); LogFunc(("vboxvideo: %d\n", __LINE__)); return; } fbdev->x1 = fbdev->y1 = INT_MAX; fbdev->x2 = fbdev->y2 = 0; spin_unlock_irqrestore(&fbdev->dirty_lock, flags); if (!bo->kmap.virtual) { ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap); if (ret) { DRM_ERROR("failed to kmap fb updates\n"); vbox_bo_unreserve(bo); return; } unmap = true; } for (i = y; i <= y2; i++) { /* assume equal stride for now */ src_offset = dst_offset = i * fbdev->afb.base.pitches[0] + (x * bpp); memcpy_toio(bo->kmap.virtual + src_offset, (char *)fbdev->sysram + src_offset, (x2 - x + 1) * bpp); } /* Not sure why the original code subtracted 1 here, but I will keep it that * way to avoid unnecessary differences. */ rect.x1 = x; rect.x2 = x2 + 1; rect.y1 = y; rect.y2 = y2 + 1; vbox_framebuffer_dirty_rectangles(&fbdev->afb.base, &rect, 1); LogFunc(("vboxvideo: %d, bo->kmap.virtual=%p, fbdev->sysram=%p, x=%d, y=%d, x2=%d, y2=%d, unmap=%RTbool\n", __LINE__, bo->kmap.virtual, fbdev->sysram, (int)x, (int)y, (int)x2, (int)y2, unmap)); if (unmap) ttm_bo_kunmap(&bo->kmap); vbox_bo_unreserve(bo); } static void vbox_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct vbox_fbdev *fbdev = info->par; LogFunc(("vboxvideo: %d\n", __LINE__)); sys_fillrect(info, rect); vbox_dirty_update(fbdev, rect->dx, rect->dy, rect->width, rect->height); } static void vbox_copyarea(struct fb_info *info, const struct fb_copyarea *area) { struct vbox_fbdev *fbdev = info->par; LogFunc(("vboxvideo: %d\n", __LINE__)); sys_copyarea(info, area); vbox_dirty_update(fbdev, area->dx, area->dy, area->width, area->height); } static void vbox_imageblit(struct fb_info *info, const struct fb_image *image) { struct vbox_fbdev *fbdev = info->par; LogFunc(("vboxvideo: %d\n", __LINE__)); sys_imageblit(info, image); vbox_dirty_update(fbdev, image->dx, image->dy, image->width, image->height); } static struct fb_ops vboxfb_ops = { .owner = THIS_MODULE, .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, .fb_fillrect = vbox_fillrect, .fb_copyarea = vbox_copyarea, .fb_imageblit = vbox_imageblit, .fb_pan_display = drm_fb_helper_pan_display, .fb_blank = drm_fb_helper_blank, .fb_setcmap = drm_fb_helper_setcmap, .fb_debug_enter = drm_fb_helper_debug_enter, .fb_debug_leave = drm_fb_helper_debug_leave, }; static int vboxfb_create_object(struct vbox_fbdev *fbdev, struct DRM_MODE_FB_CMD *mode_cmd, struct drm_gem_object **gobj_p) { struct drm_device *dev = fbdev->helper.dev; u32 bpp, depth; u32 size; struct drm_gem_object *gobj; #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) __u32 pitch = mode_cmd->pitch; #else __u32 pitch = mode_cmd->pitches[0]; #endif int ret = 0; LogFunc(("vboxvideo: %d\n", __LINE__)); drm_fb_get_bpp_depth(mode_cmd->pixel_format, &depth, &bpp); size = pitch * mode_cmd->height; ret = vbox_gem_create(dev, size, true, &gobj); if (ret) return ret; *gobj_p = gobj; LogFunc(("vboxvideo: %d\n", __LINE__)); return ret; } static int vboxfb_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { struct vbox_fbdev *fbdev = container_of(helper, struct vbox_fbdev, helper); struct drm_device *dev = fbdev->helper.dev; struct DRM_MODE_FB_CMD mode_cmd; struct drm_framebuffer *fb; struct fb_info *info; __u32 pitch; int size, ret; struct device *device = &dev->pdev->dev; void *sysram; struct drm_gem_object *gobj = NULL; struct vbox_bo *bo = NULL; LogFunc(("vboxvideo: %d\n", __LINE__)); mode_cmd.width = sizes->surface_width; mode_cmd.height = sizes->surface_height; pitch = mode_cmd.width * ((sizes->surface_bpp + 7) / 8); #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) mode_cmd.bpp = sizes->surface_bpp; mode_cmd.depth = sizes->surface_depth; mode_cmd.pitch = pitch; #else mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, sizes->surface_depth); mode_cmd.pitches[0] = pitch; #endif size = pitch * mode_cmd.height; ret = vboxfb_create_object(fbdev, &mode_cmd, &gobj); if (ret) { DRM_ERROR("failed to create fbcon backing object %d\n", ret); return ret; } bo = gem_to_vbox_bo(gobj); sysram = vmalloc(size); if (!sysram) return -ENOMEM; info = framebuffer_alloc(0, device); if (!info) { ret = -ENOMEM; goto out; } info->par = fbdev; ret = vbox_framebuffer_init(dev, &fbdev->afb, &mode_cmd, gobj); if (ret) goto out; fbdev->sysram = sysram; fbdev->size = size; fb = &fbdev->afb.base; fbdev->helper.fb = fb; fbdev->helper.fbdev = info; strcpy(info->fix.id, "vboxdrmfb"); /* The last flag forces a mode set on VT switches even if the kernel does * not think it is needed. */ info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT | FBINFO_MISC_ALWAYS_SETPAR; info->fbops = &vboxfb_ops; ret = fb_alloc_cmap(&info->cmap, 256, 0); if (ret) { ret = -ENOMEM; goto out; } /* This seems to be done for safety checking that the framebuffer is not * registered twice by different drivers. */ info->apertures = alloc_apertures(1); if (!info->apertures) { ret = -ENOMEM; goto out; } info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0); info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0); drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth); drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width, sizes->fb_height); info->screen_base = sysram; info->screen_size = size; info->pixmap.flags = FB_PIXMAP_SYSTEM; DRM_DEBUG_KMS("allocated %dx%d\n", fb->width, fb->height); LogFunc(("vboxvideo: %d\n", __LINE__)); return 0; out: LogFunc(("vboxvideo: %d\n", __LINE__)); return ret; } static void vbox_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno) { } static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, int regno) { *red = regno; *green = regno; *blue = regno; } static struct drm_fb_helper_funcs vbox_fb_helper_funcs = { .gamma_set = vbox_fb_gamma_set, .gamma_get = vbox_fb_gamma_get, .fb_probe = vboxfb_create, }; static void vbox_fbdev_destroy(struct drm_device *dev, struct vbox_fbdev *fbdev) { struct fb_info *info; struct vbox_framebuffer *afb = &fbdev->afb; LogFunc(("vboxvideo: %d\n", __LINE__)); if (fbdev->helper.fbdev) { info = fbdev->helper.fbdev; unregister_framebuffer(info); if (info->cmap.len) fb_dealloc_cmap(&info->cmap); framebuffer_release(info); } if (afb->obj) { drm_gem_object_unreference_unlocked(afb->obj); afb->obj = NULL; } drm_fb_helper_fini(&fbdev->helper); vfree(fbdev->sysram); #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) drm_framebuffer_unregister_private(&afb->base); #endif drm_framebuffer_cleanup(&afb->base); LogFunc(("vboxvideo: %d\n", __LINE__)); } int vbox_fbdev_init(struct drm_device *dev) { struct vbox_private *vbox = dev->dev_private; struct vbox_fbdev *fbdev; int ret; LogFunc(("vboxvideo: %d\n", __LINE__)); fbdev = kzalloc(sizeof(struct vbox_fbdev), GFP_KERNEL); if (!fbdev) return -ENOMEM; vbox->fbdev = fbdev; spin_lock_init(&fbdev->dirty_lock); #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) fbdev->helper.funcs = &vbox_fb_helper_funcs; #else drm_fb_helper_prepare(dev, &fbdev->helper, &vbox_fb_helper_funcs); #endif ret = drm_fb_helper_init(dev, &fbdev->helper, vbox->num_crtcs, vbox->num_crtcs); if (ret) goto free; ret = drm_fb_helper_single_add_all_connectors(&fbdev->helper); if (ret) goto fini; /* disable all the possible outputs/crtcs before entering KMS mode */ drm_helper_disable_unused_functions(dev); ret = drm_fb_helper_initial_config(&fbdev->helper, 32); if (ret) goto fini; LogFunc(("vboxvideo: %d\n", __LINE__)); return 0; fini: drm_fb_helper_fini(&fbdev->helper); free: kfree(fbdev); vbox->fbdev = NULL; LogFunc(("vboxvideo: %d, ret=%d\n", __LINE__, ret)); return ret; } void vbox_fbdev_fini(struct drm_device *dev) { struct vbox_private *vbox = dev->dev_private; if (!vbox->fbdev) return; LogFunc(("vboxvideo: %d\n", __LINE__)); vbox_fbdev_destroy(dev, vbox->fbdev); kfree(vbox->fbdev); vbox->fbdev = NULL; } void vbox_fbdev_set_suspend(struct drm_device *dev, int state) { struct vbox_private *vbox = dev->dev_private; LogFunc(("vboxvideo: %d\n", __LINE__)); if (!vbox->fbdev) return; fb_set_suspend(vbox->fbdev->helper.fbdev, state); }
gpl-2.0
tomlagier/NoblePower
wp-content/plugins/civicrm/civicrm/CRM/Core/I18n/SchemaStructure_3_4_0.php
7148
<?php /* +--------------------------------------------------------------------+ | CiviCRM version 4.3 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2013 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | | CiviCRM is free software; you can copy, modify, and distribute it | | under the terms of the GNU Affero General Public License | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | | | CiviCRM is distributed in the hope that it will be useful, but | | WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | See the GNU Affero General Public License for more details. | | | | You should have received a copy of the GNU Affero General Public | | License and the CiviCRM Licensing Exception along | | with this program; if not, contact CiviCRM LLC | | at info[AT]civicrm[DOT]org. If you have questions about the | | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ */ /** * * @package CRM * @copyright CiviCRM LLC (c) 2004-2013 * $Id$ * */ class CRM_Core_I18n_SchemaStructure_3_4_0 { static function &columns() { static $result = NULL; if (!$result) { $result = array( 'civicrm_option_group' => array( 'label' => "varchar(255)", 'description' => "varchar(255)", ), 'civicrm_contact_type' => array( 'label' => "varchar(64)", 'description' => "text", ), 'civicrm_premiums' => array( 'premiums_intro_title' => "varchar(255)", 'premiums_intro_text' => "text", ), 'civicrm_product' => array( 'name' => "varchar(255)", 'description' => "text", 'options' => "text", ), 'civicrm_membership_type' => array( 'name' => "varchar(128)", 'description' => "varchar(255)", ), 'civicrm_membership_status' => array( 'label' => "varchar(128)", ), 'civicrm_participant_status_type' => array( 'label' => "varchar(255)", ), 'civicrm_tell_friend' => array( 'title' => "varchar(255)", 'intro' => "text", 'suggested_message' => "text", 'thankyou_title' => "varchar(255)", 'thankyou_text' => "text", ), 'civicrm_price_set' => array( 'title' => "varchar(255)", 'help_pre' => "text", 'help_post' => "text", ), 'civicrm_batch' => array( 'label' => "varchar(64)", 'description' => "text", ), 'civicrm_custom_group' => array( 'title' => "varchar(64)", 'help_pre' => "text", 'help_post' => "text", ), 'civicrm_custom_field' => array( 'label' => "varchar(255)", 'help_pre' => "text", 'help_post' => "text", ), 'civicrm_dashboard' => array( 'label' => "varchar(255)", ), 'civicrm_option_value' => array( 'label' => "varchar(255)", 'description' => "text", ), 'civicrm_contribution_page' => array( 'title' => "varchar(255)", 'intro_text' => "text", 'pay_later_text' => "text", 'pay_later_receipt' => "text", 'thankyou_title' => "varchar(255)", 'thankyou_text' => "text", 'thankyou_footer' => "text", 'for_organization' => "text", 'receipt_from_name' => "varchar(255)", 'receipt_text' => "text", 'footer_text' => "text", 'honor_block_title' => "varchar(255)", 'honor_block_text' => "text", ), 'civicrm_membership_block' => array( 'new_title' => "varchar(255)", 'new_text' => "text", 'renewal_title' => "varchar(255)", 'renewal_text' => "text", ), 'civicrm_price_field' => array( 'label' => "varchar(255)", 'help_pre' => "text", 'help_post' => "text", ), 'civicrm_price_field_value' => array( 'label' => "varchar(255)", 'description' => "text", ), 'civicrm_uf_group' => array( 'title' => "varchar(64)", 'help_pre' => "text", 'help_post' => "text", ), 'civicrm_uf_field' => array( 'help_post' => "text", 'help_pre' => "text", 'label' => "varchar(255)", ), 'civicrm_event' => array( 'title' => "varchar(255)", 'summary' => "text", 'description' => "text", 'registration_link_text' => "varchar(255)", 'event_full_text' => "text", 'fee_label' => "varchar(255)", 'intro_text' => "text", 'footer_text' => "text", 'confirm_title' => "varchar(255)", 'confirm_text' => "text", 'confirm_footer_text' => "text", 'confirm_email_text' => "text", 'confirm_from_name' => "varchar(255)", 'thankyou_title' => "varchar(255)", 'thankyou_text' => "text", 'thankyou_footer_text' => "text", 'pay_later_text' => "text", 'pay_later_receipt' => "text", 'waitlist_text' => "text", 'approval_req_text' => "text", 'template_title' => "varchar(255)", ), ); } return $result; } static function &indices() { static $result = NULL; if (!$result) { $result = array( 'civicrm_price_set' => array( 'UI_title' => array( 'name' => 'UI_title', 'field' => array( 'title', ), 'unique' => 1, ), ), 'civicrm_custom_group' => array( 'UI_title_extends' => array( 'name' => 'UI_title_extends', 'field' => array( 'title', 'extends', ), 'unique' => 1, ), ), 'civicrm_custom_field' => array( 'UI_label_custom_group_id' => array( 'name' => 'UI_label_custom_group_id', 'field' => array( 'label', 'custom_group_id', ), 'unique' => 1, ), ), ); } return $result; } static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); } return $result; } }
gpl-2.0
tstephen/srp-digital
wp-content/plugins/wordfence/crypto/vendor/paragonie/sodium_compat/src/Core32/ChaCha20/IetfCtx.php
1562
<?php // phpcs:ignoreFile -- compatibility library for PHP 5-7.1 if (class_exists('ParagonIE_Sodium_Core_ChaCha20_IetfCtx', false)) { return; } /** * Class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx */ class ParagonIE_Sodium_Core32_ChaCha20_IetfCtx extends ParagonIE_Sodium_Core32_ChaCha20_Ctx { /** * ParagonIE_Sodium_Core_ChaCha20_IetfCtx constructor. * * @internal You should not use this directly from another application * * @param string $key ChaCha20 key. * @param string $iv Initialization Vector (a.k.a. nonce). * @param string $counter The initial counter value. * Defaults to 4 0x00 bytes. * @throws InvalidArgumentException * @throws SodiumException * @throws TypeError */ public function __construct($key = '', $iv = '', $counter = '') { if (self::strlen($iv) !== 12) { throw new InvalidArgumentException('ChaCha20 expects a 96-bit nonce in IETF mode.'); } parent::__construct($key, self::substr($iv, 0, 8), $counter); if (!empty($counter)) { $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); } $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 8, 4)); } }
gpl-2.0
navoj/ecell4
ecell4/egfrd/legacy/NetworkRules.hpp
821
#ifndef NETWORK_RULES_HPP #define NETWORK_RULES_HPP #include <map> #include "ReactionRule.hpp" #include "generator.hpp" class NetworkRules { public: typedef ReactionRule reaction_rule_type; typedef SpeciesTypeID species_id_type; typedef abstract_limited_generator<reaction_rule_type> reaction_rule_generator; typedef reaction_rule_type::identifier_type identifier_type; public: virtual identifier_type add_reaction_rule(ReactionRule const&) = 0; virtual void remove_reaction_rule(ReactionRule const&) = 0; virtual reaction_rule_generator* query_reaction_rule(species_id_type const& r1) const = 0; virtual reaction_rule_generator* query_reaction_rule(species_id_type const& r1, species_id_type const& r2) const = 0; virtual ~NetworkRules() = 0; }; #endif /* NETWORK_RULES_HPP */
gpl-2.0
pexip/os-module-init-tools
tests/test-depmod/12compressed.sh
7085
#! /bin/sh # Check that compressed modules work correctly; based on 02simple.sh [ -n "$CONFIG_HAVE_ZLIB" ] || exit 0 for ENDIAN in $TEST_ENDIAN; do for BITNESS in $TEST_BITS; do rm -rf tests/tmp/* # Copy modules instead of linking, so we can compress them MODULE_DIR=tests/tmp/lib/modules/$MODTEST_UNAME mkdir -p $MODULE_DIR cp tests/data/$BITNESS$ENDIAN/normal/export_dep-$BITNESS.ko \ tests/data/$BITNESS$ENDIAN/normal/noexport_dep-$BITNESS.ko \ tests/data/$BITNESS$ENDIAN/normal/export_nodep-$BITNESS.ko \ tests/data/$BITNESS$ENDIAN/normal/noexport_nodep-$BITNESS.ko \ tests/data/$BITNESS$ENDIAN/normal/noexport_doubledep-$BITNESS.ko \ $MODULE_DIR gzip `find $MODULE_DIR -name '*.ko'` touch tests/tmp/empty # First time, there is no modules.dep, so it will be generated. # Expect no output. [ "`depmod -A 2>&1`" = "" ] # Check modules.dep results: expect 5 lines [ `grep -vc '^#' < $MODULE_DIR/modules.dep` = 5 ] [ "`grep -w export_dep-$BITNESS.ko.gz: $MODULE_DIR/modules.dep`" = "export_dep-$BITNESS.ko.gz: export_nodep-$BITNESS.ko.gz" ] [ "`grep -w noexport_dep-$BITNESS.ko.gz: $MODULE_DIR/modules.dep`" = "noexport_dep-$BITNESS.ko.gz: export_nodep-$BITNESS.ko.gz" ] [ "`grep -w export_nodep-$BITNESS.ko.gz: $MODULE_DIR/modules.dep`" = "export_nodep-$BITNESS.ko.gz:" ] [ "`grep -w noexport_nodep-$BITNESS.ko.gz: $MODULE_DIR/modules.dep`" = "noexport_nodep-$BITNESS.ko.gz:" ] [ "`grep -w noexport_doubledep-$BITNESS.ko.gz: $MODULE_DIR/modules.dep`" = "noexport_doubledep-$BITNESS.ko.gz: export_dep-$BITNESS.ko.gz export_nodep-$BITNESS.ko.gz" ] # Check modules.symbols results: expect 3 lines [ `grep -vc '^#' < $MODULE_DIR/modules.symbols` = 3 ] [ "`grep -w symbol:exported1 $MODULE_DIR/modules.symbols`" = "alias symbol:exported1 export_nodep_$BITNESS" ] [ "`grep -w symbol:exported2 $MODULE_DIR/modules.symbols`" = "alias symbol:exported2 export_nodep_$BITNESS" ] [ "`grep -w symbol:exported3 $MODULE_DIR/modules.symbols`" = "alias symbol:exported3 export_dep_$BITNESS" ] mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old # Synonyms [ "`depmod $MODTEST_UNAME`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -a`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -a $MODTEST_UNAME`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -A`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -A $MODTEST_UNAME`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -e -F /empty -A`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -e -F /empty -A $MODTEST_VERSION`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod --all`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod --quick`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -e -F /empty --quick`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod -e -F /empty --quick $MODTEST_VERSION`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod --errsyms -F /empty --quick`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old [ "`depmod --errsyms -F /empty --quick $MODTEST_VERSION`" = "" ] diff -u $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.dep >/dev/null mv $MODULE_DIR/modules.dep $MODULE_DIR/modules.dep.old diff -u $MODULE_DIR/modules.symbols.old $MODULE_DIR/modules.symbols >/dev/null mv $MODULE_DIR/modules.symbols $MODULE_DIR/modules.symbols.old # Combined should form stdout versions. grep -vh '^#' $MODULE_DIR/modules.dep.old $MODULE_DIR/modules.symbols.old > $MODULE_DIR/modules.all.old # Stdout versions. depmod -n | grep -v '^#' > $MODULE_DIR/modules.all diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all >/dev/null mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old depmod -a -n | grep -v '^#' > $MODULE_DIR/modules.all diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all >/dev/null mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old depmod -n -a $MODTEST_VERSION | grep -v '^#' > $MODULE_DIR/modules.all diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all >/dev/null mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old depmod -e -F /empty -n -A $MODTEST_VERSION | grep -v '^#' > $MODULE_DIR/modules.all diff -u $MODULE_DIR/modules.all.old $MODULE_DIR/modules.all >/dev/null mv $MODULE_DIR/modules.all $MODULE_DIR/modules.all.old done done
gpl-2.0
marcelosousa/poet
tools/cil-1.7.3/test/small1/enum3g.c
339
/* test support for large constants in enums (gcc-specific) if you ask me, gcc's behaviour is a bit weird, but... */ enum fun { SMALL = 33, STRANGE = 44LL, LARGE = 22LL << 34 }; long long magic1 = 22LL << 34; enum fun magic2 = LARGE; int main() { int ok = 1; ok = ok && (magic2 + 1 == magic1 + 1); return ok ? 0 : 2; }
gpl-2.0
kidmaple/CoolWall
user/lilo/dos/Makefile
1351
# Makefile for BCC compilation of 'lilo.com' # # Known to work with BCC version 0.16.15 # Known not to work with BCC version 0.16.10 # MODEL=d CC = bcc -M$(MODEL) CPP = gcc -E CINCL = /usr/lib/bcc/include AS = as86 LINK = $(CC) -v COPT = -ansi -I.. -I$(CINCL) -c -O $(CFLAGS) LOPT = -m >$*.map -M -d AOPT = -0 -a -w CFLAGS = -DLCF_IGNORECASE -DLCF_DSECS=3 -DLCF_PASS160 .SUFFIXES: .com .S HFILES = ../lilo.h ../bitmap.h ../cfg.h ../config.h ../common.h ../map.h ../temp.h ../version.h .c.o: $(CC) $(COPT) -o $@ ../$*.c .o.com: $(LINK) $(LOPT) -o $@ $^ .s.o: $(AS) $(AOPT) -l $*.lis -o $@ $< all: check lilo.com alles: all cp -ufv lilo.com lilo.map /dosC/boot check: @echo $(CFLAGS) @if [ -x /usr/bin/bcc -o -x /usr/local/bin/bcc ]; then echo Okay; \ else echo; echo "You don't seem to have the 'bcc' compiler from the 'dev86' package."; \ echo; exit 1; fi lilo.com: lilo.o common.o cfg.o map.o # cprintf.o lilo.o: ../lilo.c $(HFILES) $(CC) $(COPT) -o $@ ../$*.c cfg.o: ../cfg.c $(HFILES) $(CC) $(COPT) -o $@ ../$*.c common.o: ../common.c $(HFILES) $(CC) $(COPT) -o $@ ../$*.c cprintf.o: ../cprintf.c $(HFILES) $(CC) $(COPT) -o $@ ../$*.c map.o: ../map.c $(HFILES) $(CC) $(COPT) -o $@ ../$*.c tidy: rm -f *.map *.lis core clean: tidy rm -f *.o *.s *.img *.b *.com *.gz spotless: clean rm -f *~ *.c *.h
gpl-2.0
rneugeba/linux-stable
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
131021
/****************************************************************************** * * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH * Copyright(c) 2018 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * The full GNU General Public License is included in this distribution * in the file called COPYING. * * Contact Information: * Intel Linux Wireless <linuxwifi@intel.com> * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * * BSD LICENSE * * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH * Copyright(c) 2018 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *****************************************************************************/ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/skbuff.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ip.h> #include <linux/if_arp.h> #include <linux/time.h> #include <net/mac80211.h> #include <net/ieee80211_radiotap.h> #include <net/tcp.h> #include "iwl-op-mode.h" #include "iwl-io.h" #include "mvm.h" #include "sta.h" #include "time-event.h" #include "iwl-eeprom-parse.h" #include "iwl-phy-db.h" #include "testmode.h" #include "fw/error-dump.h" #include "iwl-prph.h" #include "iwl-nvm-parse.h" static const struct ieee80211_iface_limit iwl_mvm_limits[] = { { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), }, { .max = 1, .types = BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO), }, { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE), }, }; static const struct ieee80211_iface_combination iwl_mvm_iface_combinations[] = { { .num_different_channels = 2, .max_interfaces = 3, .limits = iwl_mvm_limits, .n_limits = ARRAY_SIZE(iwl_mvm_limits), }, }; #ifdef CONFIG_IWLWIFI_BCAST_FILTERING /* * Use the reserved field to indicate magic values. * these values will only be used internally by the driver, * and won't make it to the fw (reserved will be 0). * BC_FILTER_MAGIC_IP - configure the val of this attribute to * be the vif's ip address. in case there is not a single * ip address (0, or more than 1), this attribute will * be skipped. * BC_FILTER_MAGIC_MAC - set the val of this attribute to * the LSB bytes of the vif's mac address */ enum { BC_FILTER_MAGIC_NONE = 0, BC_FILTER_MAGIC_IP, BC_FILTER_MAGIC_MAC, }; static const struct iwl_fw_bcast_filter iwl_mvm_default_bcast_filters[] = { { /* arp */ .discard = 0, .frame_type = BCAST_FILTER_FRAME_TYPE_ALL, .attrs = { { /* frame type - arp, hw type - ethernet */ .offset_type = BCAST_FILTER_OFFSET_PAYLOAD_START, .offset = sizeof(rfc1042_header), .val = cpu_to_be32(0x08060001), .mask = cpu_to_be32(0xffffffff), }, { /* arp dest ip */ .offset_type = BCAST_FILTER_OFFSET_PAYLOAD_START, .offset = sizeof(rfc1042_header) + 2 + sizeof(struct arphdr) + ETH_ALEN + sizeof(__be32) + ETH_ALEN, .mask = cpu_to_be32(0xffffffff), /* mark it as special field */ .reserved1 = cpu_to_le16(BC_FILTER_MAGIC_IP), }, }, }, { /* dhcp offer bcast */ .discard = 0, .frame_type = BCAST_FILTER_FRAME_TYPE_IPV4, .attrs = { { /* udp dest port - 68 (bootp client)*/ .offset_type = BCAST_FILTER_OFFSET_IP_END, .offset = offsetof(struct udphdr, dest), .val = cpu_to_be32(0x00440000), .mask = cpu_to_be32(0xffff0000), }, { /* dhcp - lsb bytes of client hw address */ .offset_type = BCAST_FILTER_OFFSET_IP_END, .offset = 38, .mask = cpu_to_be32(0xffffffff), /* mark it as special field */ .reserved1 = cpu_to_le16(BC_FILTER_MAGIC_MAC), }, }, }, /* last filter must be empty */ {}, }; #endif void iwl_mvm_ref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) { if (!iwl_mvm_is_d0i3_supported(mvm)) return; IWL_DEBUG_RPM(mvm, "Take mvm reference - type %d\n", ref_type); spin_lock_bh(&mvm->refs_lock); mvm->refs[ref_type]++; spin_unlock_bh(&mvm->refs_lock); iwl_trans_ref(mvm->trans); } void iwl_mvm_unref(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) { if (!iwl_mvm_is_d0i3_supported(mvm)) return; IWL_DEBUG_RPM(mvm, "Leave mvm reference - type %d\n", ref_type); spin_lock_bh(&mvm->refs_lock); if (WARN_ON(!mvm->refs[ref_type])) { spin_unlock_bh(&mvm->refs_lock); return; } mvm->refs[ref_type]--; spin_unlock_bh(&mvm->refs_lock); iwl_trans_unref(mvm->trans); } static void iwl_mvm_unref_all_except(struct iwl_mvm *mvm, enum iwl_mvm_ref_type except_ref) { int i, j; if (!iwl_mvm_is_d0i3_supported(mvm)) return; spin_lock_bh(&mvm->refs_lock); for (i = 0; i < IWL_MVM_REF_COUNT; i++) { if (except_ref == i || !mvm->refs[i]) continue; IWL_DEBUG_RPM(mvm, "Cleanup: remove mvm ref type %d (%d)\n", i, mvm->refs[i]); for (j = 0; j < mvm->refs[i]; j++) iwl_trans_unref(mvm->trans); mvm->refs[i] = 0; } spin_unlock_bh(&mvm->refs_lock); } bool iwl_mvm_ref_taken(struct iwl_mvm *mvm) { int i; bool taken = false; if (!iwl_mvm_is_d0i3_supported(mvm)) return true; spin_lock_bh(&mvm->refs_lock); for (i = 0; i < IWL_MVM_REF_COUNT; i++) { if (mvm->refs[i]) { taken = true; break; } } spin_unlock_bh(&mvm->refs_lock); return taken; } int iwl_mvm_ref_sync(struct iwl_mvm *mvm, enum iwl_mvm_ref_type ref_type) { iwl_mvm_ref(mvm, ref_type); if (!wait_event_timeout(mvm->d0i3_exit_waitq, !test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status), HZ)) { WARN_ON_ONCE(1); iwl_mvm_unref(mvm, ref_type); return -EIO; } return 0; } static void iwl_mvm_reset_phy_ctxts(struct iwl_mvm *mvm) { int i; memset(mvm->phy_ctxts, 0, sizeof(mvm->phy_ctxts)); for (i = 0; i < NUM_PHY_CTX; i++) { mvm->phy_ctxts[i].id = i; mvm->phy_ctxts[i].ref = 0; } } struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy, const char *alpha2, enum iwl_mcc_source src_id, bool *changed) { struct ieee80211_regdomain *regd = NULL; struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mcc_update_resp *resp; IWL_DEBUG_LAR(mvm, "Getting regdomain data for %s from FW\n", alpha2); lockdep_assert_held(&mvm->mutex); resp = iwl_mvm_update_mcc(mvm, alpha2, src_id); if (IS_ERR_OR_NULL(resp)) { IWL_DEBUG_LAR(mvm, "Could not get update from FW %d\n", PTR_ERR_OR_ZERO(resp)); goto out; } if (changed) *changed = (resp->status == MCC_RESP_NEW_CHAN_PROFILE); regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, __le32_to_cpu(resp->n_channels), resp->channels, __le16_to_cpu(resp->mcc), __le16_to_cpu(resp->geo_info)); /* Store the return source id */ src_id = resp->source_id; kfree(resp); if (IS_ERR_OR_NULL(regd)) { IWL_DEBUG_LAR(mvm, "Could not get parse update from FW %d\n", PTR_ERR_OR_ZERO(regd)); goto out; } IWL_DEBUG_LAR(mvm, "setting alpha2 from FW to %s (0x%x, 0x%x) src=%d\n", regd->alpha2, regd->alpha2[0], regd->alpha2[1], src_id); mvm->lar_regdom_set = true; mvm->mcc_src = src_id; out: return regd; } void iwl_mvm_update_changed_regdom(struct iwl_mvm *mvm) { bool changed; struct ieee80211_regdomain *regd; if (!iwl_mvm_is_lar_supported(mvm)) return; regd = iwl_mvm_get_current_regdomain(mvm, &changed); if (!IS_ERR_OR_NULL(regd)) { /* only update the regulatory core if changed */ if (changed) regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); kfree(regd); } } struct ieee80211_regdomain *iwl_mvm_get_current_regdomain(struct iwl_mvm *mvm, bool *changed) { return iwl_mvm_get_regdomain(mvm->hw->wiphy, "ZZ", iwl_mvm_is_wifi_mcc_supported(mvm) ? MCC_SOURCE_GET_CURRENT : MCC_SOURCE_OLD_FW, changed); } int iwl_mvm_init_fw_regd(struct iwl_mvm *mvm) { enum iwl_mcc_source used_src; struct ieee80211_regdomain *regd; int ret; bool changed; const struct ieee80211_regdomain *r = rtnl_dereference(mvm->hw->wiphy->regd); if (!r) return -ENOENT; /* save the last source in case we overwrite it below */ used_src = mvm->mcc_src; if (iwl_mvm_is_wifi_mcc_supported(mvm)) { /* Notify the firmware we support wifi location updates */ regd = iwl_mvm_get_current_regdomain(mvm, NULL); if (!IS_ERR_OR_NULL(regd)) kfree(regd); } /* Now set our last stored MCC and source */ regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, r->alpha2, used_src, &changed); if (IS_ERR_OR_NULL(regd)) return -EIO; /* update cfg80211 if the regdomain was changed */ if (changed) ret = regulatory_set_wiphy_regd_sync_rtnl(mvm->hw->wiphy, regd); else ret = 0; kfree(regd); return ret; } int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) { struct ieee80211_hw *hw = mvm->hw; int num_mac, ret, i; static const u32 mvm_ciphers[] = { WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, WLAN_CIPHER_SUITE_TKIP, WLAN_CIPHER_SUITE_CCMP, }; /* Tell mac80211 our characteristics */ ieee80211_hw_set(hw, SIGNAL_DBM); ieee80211_hw_set(hw, SPECTRUM_MGMT); ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); ieee80211_hw_set(hw, QUEUE_CONTROL); ieee80211_hw_set(hw, WANT_MONITOR_VIF); ieee80211_hw_set(hw, SUPPORTS_PS); ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); ieee80211_hw_set(hw, AMPDU_AGGREGATION); ieee80211_hw_set(hw, TIMING_BEACON_ONLY); ieee80211_hw_set(hw, CONNECTION_MONITOR); ieee80211_hw_set(hw, CHANCTX_STA_CSA); ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); ieee80211_hw_set(hw, SUPPORTS_CLONED_SKBS); ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU); ieee80211_hw_set(hw, NEEDS_UNIQUE_STA_ADDR); ieee80211_hw_set(hw, DEAUTH_NEED_MGD_TX_PREP); if (iwl_mvm_has_tlc_offload(mvm)) { ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); ieee80211_hw_set(hw, HAS_RATE_CONTROL); } if (iwl_mvm_has_new_rx_api(mvm)) ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER); if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_STA_PM_NOTIF)) { ieee80211_hw_set(hw, AP_LINK_PS); } else if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) { /* * we absolutely need this for the new TX API since that comes * with many more queues than the current code can deal with * for station powersave */ return -EINVAL; } if (mvm->trans->num_rx_queues > 1) ieee80211_hw_set(hw, USES_RSS); if (mvm->trans->max_skb_frags) hw->netdev_features = NETIF_F_HIGHDMA | NETIF_F_SG; hw->queues = IEEE80211_MAX_QUEUES; hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE; hw->radiotap_mcs_details |= IEEE80211_RADIOTAP_MCS_HAVE_FEC | IEEE80211_RADIOTAP_MCS_HAVE_STBC; hw->radiotap_vht_details |= IEEE80211_RADIOTAP_VHT_KNOWN_STBC | IEEE80211_RADIOTAP_VHT_KNOWN_BEAMFORMED; hw->radiotap_timestamp.units_pos = IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US | IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ; /* this is the case for CCK frames, it's better (only 8) for OFDM */ hw->radiotap_timestamp.accuracy = 22; if (!iwl_mvm_has_tlc_offload(mvm)) hw->rate_control_algorithm = RS_NAME; hw->uapsd_queues = IWL_MVM_UAPSD_QUEUES; hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP; BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 6); memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers)); hw->wiphy->n_cipher_suites = ARRAY_SIZE(mvm_ciphers); hw->wiphy->cipher_suites = mvm->ciphers; if (iwl_mvm_has_new_rx_api(mvm)) { mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_GCMP; hw->wiphy->n_cipher_suites++; mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_GCMP_256; hw->wiphy->n_cipher_suites++; } /* Enable 11w if software crypto is not enabled (as the * firmware will interpret some mgmt packets, so enabling it * with software crypto isn't safe). */ if (!iwlwifi_mod_params.swcrypto) { ieee80211_hw_set(hw, MFP_CAPABLE); mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_AES_CMAC; hw->wiphy->n_cipher_suites++; if (iwl_mvm_has_new_rx_api(mvm)) { mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_BIP_GMAC_128; hw->wiphy->n_cipher_suites++; mvm->ciphers[hw->wiphy->n_cipher_suites] = WLAN_CIPHER_SUITE_BIP_GMAC_256; hw->wiphy->n_cipher_suites++; } } /* currently FW API supports only one optional cipher scheme */ if (mvm->fw->cs[0].cipher) { const struct iwl_fw_cipher_scheme *fwcs = &mvm->fw->cs[0]; struct ieee80211_cipher_scheme *cs = &mvm->cs[0]; mvm->hw->n_cipher_schemes = 1; cs->cipher = le32_to_cpu(fwcs->cipher); cs->iftype = BIT(NL80211_IFTYPE_STATION); cs->hdr_len = fwcs->hdr_len; cs->pn_len = fwcs->pn_len; cs->pn_off = fwcs->pn_off; cs->key_idx_off = fwcs->key_idx_off; cs->key_idx_mask = fwcs->key_idx_mask; cs->key_idx_shift = fwcs->key_idx_shift; cs->mic_len = fwcs->mic_len; mvm->hw->cipher_schemes = mvm->cs; mvm->ciphers[hw->wiphy->n_cipher_suites] = cs->cipher; hw->wiphy->n_cipher_suites++; } ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS); hw->wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR | NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR | NL80211_FEATURE_ND_RANDOM_MAC_ADDR; hw->sta_data_size = sizeof(struct iwl_mvm_sta); hw->vif_data_size = sizeof(struct iwl_mvm_vif); hw->chanctx_data_size = sizeof(u16); hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_P2P_GO) | BIT(NL80211_IFTYPE_P2P_DEVICE) | BIT(NL80211_IFTYPE_ADHOC); hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; hw->wiphy->regulatory_flags |= REGULATORY_ENABLE_RELAX_NO_IR; if (iwl_mvm_is_lar_supported(mvm)) hw->wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; else hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | REGULATORY_DISABLE_BEACON_HINTS; hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; hw->wiphy->iface_combinations = iwl_mvm_iface_combinations; hw->wiphy->n_iface_combinations = ARRAY_SIZE(iwl_mvm_iface_combinations); hw->wiphy->max_remain_on_channel_duration = 10000; hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; /* Extract MAC address */ memcpy(mvm->addresses[0].addr, mvm->nvm_data->hw_addr, ETH_ALEN); hw->wiphy->addresses = mvm->addresses; hw->wiphy->n_addresses = 1; /* Extract additional MAC addresses if available */ num_mac = (mvm->nvm_data->n_hw_addrs > 1) ? min(IWL_MVM_MAX_ADDRESSES, mvm->nvm_data->n_hw_addrs) : 1; for (i = 1; i < num_mac; i++) { memcpy(mvm->addresses[i].addr, mvm->addresses[i-1].addr, ETH_ALEN); mvm->addresses[i].addr[5]++; hw->wiphy->n_addresses++; } iwl_mvm_reset_phy_ctxts(mvm); hw->wiphy->max_scan_ie_len = iwl_mvm_max_scan_ie_len(mvm); hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; BUILD_BUG_ON(IWL_MVM_SCAN_STOPPING_MASK & IWL_MVM_SCAN_MASK); BUILD_BUG_ON(IWL_MVM_MAX_UMAC_SCANS > HWEIGHT32(IWL_MVM_SCAN_MASK) || IWL_MVM_MAX_LMAC_SCANS > HWEIGHT32(IWL_MVM_SCAN_MASK)); if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) mvm->max_scans = IWL_MVM_MAX_UMAC_SCANS; else mvm->max_scans = IWL_MVM_MAX_LMAC_SCANS; if (mvm->nvm_data->bands[NL80211_BAND_2GHZ].n_channels) hw->wiphy->bands[NL80211_BAND_2GHZ] = &mvm->nvm_data->bands[NL80211_BAND_2GHZ]; if (mvm->nvm_data->bands[NL80211_BAND_5GHZ].n_channels) { hw->wiphy->bands[NL80211_BAND_5GHZ] = &mvm->nvm_data->bands[NL80211_BAND_5GHZ]; if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_BEAMFORMER) && fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_LQ_SS_PARAMS)) hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.cap |= IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE; } hw->wiphy->hw_version = mvm->trans->hw_id; if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM) hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT; else hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; hw->wiphy->max_sched_scan_reqs = 1; hw->wiphy->max_sched_scan_ssids = PROBE_OPTION_MAX; hw->wiphy->max_match_sets = IWL_SCAN_MAX_PROFILES; /* we create the 802.11 header and zero length SSID IE. */ hw->wiphy->max_sched_scan_ie_len = SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; hw->wiphy->max_sched_scan_plans = IWL_MAX_SCHED_SCAN_PLANS; hw->wiphy->max_sched_scan_plan_interval = U16_MAX; /* * the firmware uses u8 for num of iterations, but 0xff is saved for * infinite loop, so the maximum number of iterations is actually 254. */ hw->wiphy->max_sched_scan_plan_iterations = 254; hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | NL80211_FEATURE_LOW_PRIORITY_SCAN | NL80211_FEATURE_P2P_GO_OPPPS | NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE | NL80211_FEATURE_DYNAMIC_SMPS | NL80211_FEATURE_STATIC_SMPS | NL80211_FEATURE_SUPPORTS_WMM_ADMISSION; if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT)) hw->wiphy->features |= NL80211_FEATURE_TX_POWER_INSERTION; if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_QUIET_PERIOD_SUPPORT)) hw->wiphy->features |= NL80211_FEATURE_QUIET; if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) hw->wiphy->features |= NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES; if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT)) hw->wiphy->features |= NL80211_FEATURE_WFA_TPC_IE_IN_PROBES; if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_SCAN_TSF_REPORT)) { wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SCAN_START_TIME); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_BSS_PARENT_TSF); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SET_SCAN_DWELL); } if (iwl_mvm_is_oce_supported(mvm)) { wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE); } mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; #ifdef CONFIG_PM_SLEEP if (iwl_mvm_is_d0i3_supported(mvm) && device_can_wakeup(mvm->trans->dev)) { mvm->wowlan.flags = WIPHY_WOWLAN_ANY; hw->wiphy->wowlan = &mvm->wowlan; } if (mvm->fw->img[IWL_UCODE_WOWLAN].num_sec && mvm->trans->ops->d3_suspend && mvm->trans->ops->d3_resume && device_can_wakeup(mvm->trans->dev)) { mvm->wowlan.flags |= WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT | WIPHY_WOWLAN_EAP_IDENTITY_REQ | WIPHY_WOWLAN_RFKILL_RELEASE | WIPHY_WOWLAN_NET_DETECT; if (!iwlwifi_mod_params.swcrypto) mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY | WIPHY_WOWLAN_GTK_REKEY_FAILURE | WIPHY_WOWLAN_4WAY_HANDSHAKE; mvm->wowlan.n_patterns = IWL_WOWLAN_MAX_PATTERNS; mvm->wowlan.pattern_min_len = IWL_WOWLAN_MIN_PATTERN_LEN; mvm->wowlan.pattern_max_len = IWL_WOWLAN_MAX_PATTERN_LEN; mvm->wowlan.max_nd_match_sets = IWL_SCAN_MAX_PROFILES; hw->wiphy->wowlan = &mvm->wowlan; } #endif #ifdef CONFIG_IWLWIFI_BCAST_FILTERING /* assign default bcast filtering configuration */ mvm->bcast_filters = iwl_mvm_default_bcast_filters; #endif ret = iwl_mvm_leds_init(mvm); if (ret) return ret; if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TDLS_SUPPORT)) { IWL_DEBUG_TDLS(mvm, "TDLS supported\n"); hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; ieee80211_hw_set(hw, TDLS_WIDER_BW); } if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH)) { IWL_DEBUG_TDLS(mvm, "TDLS channel switch supported\n"); hw->wiphy->features |= NL80211_FEATURE_TDLS_CHANNEL_SWITCH; } hw->netdev_features |= mvm->cfg->features; if (!iwl_mvm_is_csum_supported(mvm)) { hw->netdev_features &= ~(IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM); /* We may support SW TX CSUM */ if (IWL_MVM_SW_TX_CSUM_OFFLOAD) hw->netdev_features |= IWL_TX_CSUM_NETIF_FLAGS; } ret = ieee80211_register_hw(mvm->hw); if (ret) iwl_mvm_leds_exit(mvm); mvm->init_status |= IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE; if (mvm->cfg->vht_mu_mimo_supported) wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER); return ret; } static bool iwl_mvm_defer_tx(struct iwl_mvm *mvm, struct ieee80211_sta *sta, struct sk_buff *skb) { struct iwl_mvm_sta *mvmsta; bool defer = false; /* * double check the IN_D0I3 flag both before and after * taking the spinlock, in order to prevent taking * the spinlock when not needed. */ if (likely(!test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status))) return false; spin_lock(&mvm->d0i3_tx_lock); /* * testing the flag again ensures the skb dequeue * loop (on d0i3 exit) hasn't run yet. */ if (!test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status)) goto out; mvmsta = iwl_mvm_sta_from_mac80211(sta); if (mvmsta->sta_id == IWL_MVM_INVALID_STA || mvmsta->sta_id != mvm->d0i3_ap_sta_id) goto out; __skb_queue_tail(&mvm->d0i3_tx, skb); ieee80211_stop_queues(mvm->hw); /* trigger wakeup */ iwl_mvm_ref(mvm, IWL_MVM_REF_TX); iwl_mvm_unref(mvm, IWL_MVM_REF_TX); defer = true; out: spin_unlock(&mvm->d0i3_tx_lock); return defer; } static void iwl_mvm_mac_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct ieee80211_sta *sta = control->sta; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_hdr *hdr = (void *)skb->data; if (iwl_mvm_is_radio_killed(mvm)) { IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); goto drop; } if (info->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE && !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) goto drop; /* treat non-bufferable MMPDUs on AP interfaces as broadcast */ if ((info->control.vif->type == NL80211_IFTYPE_AP || info->control.vif->type == NL80211_IFTYPE_ADHOC) && ieee80211_is_mgmt(hdr->frame_control) && !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) sta = NULL; if (sta) { if (iwl_mvm_defer_tx(mvm, sta, skb)) return; if (iwl_mvm_tx_skb(mvm, skb, sta)) goto drop; return; } if (iwl_mvm_tx_skb_non_sta(mvm, skb)) goto drop; return; drop: ieee80211_free_txskb(hw, skb); } static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg) { if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) return false; return true; } static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg) { if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) return false; if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG) return true; /* enabled by default */ return true; } #define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \ do { \ if (!(le16_to_cpu(_tid_bm) & BIT(_tid))) \ break; \ iwl_fw_dbg_collect_trig(&(_mvm)->fwrt, _trig, _fmt); \ } while (0) static void iwl_mvm_ampdu_check_trigger(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta, u16 tid, u16 rx_ba_ssn, enum ieee80211_ampdu_mlme_action action) { struct iwl_fw_dbg_trigger_tlv *trig; struct iwl_fw_dbg_trigger_ba *ba_trig; trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), FW_DBG_TRIGGER_BA); if (!trig) return; ba_trig = (void *)trig->data; switch (action) { case IEEE80211_AMPDU_TX_OPERATIONAL: { struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_start, tid, "TX AGG START: MAC %pM tid %d ssn %d\n", sta->addr, tid, tid_data->ssn); break; } case IEEE80211_AMPDU_TX_STOP_CONT: CHECK_BA_TRIGGER(mvm, trig, ba_trig->tx_ba_stop, tid, "TX AGG STOP: MAC %pM tid %d\n", sta->addr, tid); break; case IEEE80211_AMPDU_RX_START: CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_start, tid, "RX AGG START: MAC %pM tid %d ssn %d\n", sta->addr, tid, rx_ba_ssn); break; case IEEE80211_AMPDU_RX_STOP: CHECK_BA_TRIGGER(mvm, trig, ba_trig->rx_ba_stop, tid, "RX AGG STOP: MAC %pM tid %d\n", sta->addr, tid); break; default: break; } } static int iwl_mvm_mac_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_ampdu_params *params) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; bool tx_agg_ref = false; struct ieee80211_sta *sta = params->sta; enum ieee80211_ampdu_mlme_action action = params->action; u16 tid = params->tid; u16 *ssn = &params->ssn; u16 buf_size = params->buf_size; bool amsdu = params->amsdu; u16 timeout = params->timeout; IWL_DEBUG_HT(mvm, "A-MPDU action on addr %pM tid %d: action %d\n", sta->addr, tid, action); if (!(mvm->nvm_data->sku_cap_11n_enable)) return -EACCES; /* return from D0i3 before starting a new Tx aggregation */ switch (action) { case IEEE80211_AMPDU_TX_START: case IEEE80211_AMPDU_TX_STOP_CONT: case IEEE80211_AMPDU_TX_STOP_FLUSH: case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: case IEEE80211_AMPDU_TX_OPERATIONAL: /* * for tx start, wait synchronously until D0i3 exit to * get the correct sequence number for the tid. * additionally, some other ampdu actions use direct * target access, which is not handled automatically * by the trans layer (unlike commands), so wait for * d0i3 exit in these cases as well. */ ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_TX_AGG); if (ret) return ret; tx_agg_ref = true; break; default: break; } mutex_lock(&mvm->mutex); switch (action) { case IEEE80211_AMPDU_RX_START: if (iwl_mvm_vif_from_mac80211(vif)->ap_sta_id == iwl_mvm_sta_from_mac80211(sta)->sta_id) { struct iwl_mvm_vif *mvmvif; u16 macid = iwl_mvm_vif_from_mac80211(vif)->id; struct iwl_mvm_tcm_mac *mdata = &mvm->tcm.data[macid]; mdata->opened_rx_ba_sessions = true; mvmvif = iwl_mvm_vif_from_mac80211(vif); cancel_delayed_work(&mvmvif->uapsd_nonagg_detected_wk); } if (!iwl_enable_rx_ampdu(mvm->cfg)) { ret = -EINVAL; break; } ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, *ssn, true, buf_size, timeout); break; case IEEE80211_AMPDU_RX_STOP: ret = iwl_mvm_sta_rx_agg(mvm, sta, tid, 0, false, buf_size, timeout); break; case IEEE80211_AMPDU_TX_START: if (!iwl_enable_tx_ampdu(mvm->cfg)) { ret = -EINVAL; break; } ret = iwl_mvm_sta_tx_agg_start(mvm, vif, sta, tid, ssn); break; case IEEE80211_AMPDU_TX_STOP_CONT: ret = iwl_mvm_sta_tx_agg_stop(mvm, vif, sta, tid); break; case IEEE80211_AMPDU_TX_STOP_FLUSH: case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT: ret = iwl_mvm_sta_tx_agg_flush(mvm, vif, sta, tid); break; case IEEE80211_AMPDU_TX_OPERATIONAL: ret = iwl_mvm_sta_tx_agg_oper(mvm, vif, sta, tid, buf_size, amsdu); break; default: WARN_ON_ONCE(1); ret = -EINVAL; break; } if (!ret) { u16 rx_ba_ssn = 0; if (action == IEEE80211_AMPDU_RX_START) rx_ba_ssn = *ssn; iwl_mvm_ampdu_check_trigger(mvm, vif, sta, tid, rx_ba_ssn, action); } mutex_unlock(&mvm->mutex); /* * If the tid is marked as started, we won't use it for offloaded * traffic on the next D0i3 entry. It's safe to unref. */ if (tx_agg_ref) iwl_mvm_unref(mvm, IWL_MVM_REF_TX_AGG); return ret; } static void iwl_mvm_cleanup_iterator(void *data, u8 *mac, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = data; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); mvmvif->uploaded = false; mvmvif->ap_sta_id = IWL_MVM_INVALID_STA; spin_lock_bh(&mvm->time_event_lock); iwl_mvm_te_clear_data(mvm, &mvmvif->time_event_data); spin_unlock_bh(&mvm->time_event_lock); mvmvif->phy_ctxt = NULL; memset(&mvmvif->bf_data, 0, sizeof(mvmvif->bf_data)); memset(&mvmvif->probe_resp_data, 0, sizeof(mvmvif->probe_resp_data)); } static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) { /* clear the D3 reconfig, we only need it to avoid dumping a * firmware coredump on reconfiguration, we shouldn't do that * on D3->D0 transition */ if (!test_and_clear_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status)) { mvm->fwrt.dump.desc = &iwl_dump_desc_assert; iwl_fw_error_dump(&mvm->fwrt); } /* cleanup all stale references (scan, roc), but keep the * ucode_down ref until reconfig is complete */ iwl_mvm_unref_all_except(mvm, IWL_MVM_REF_UCODE_DOWN); iwl_mvm_stop_device(mvm); mvm->scan_status = 0; mvm->ps_disabled = false; mvm->calibrating = false; /* just in case one was running */ iwl_mvm_cleanup_roc_te(mvm); ieee80211_remain_on_channel_expired(mvm->hw); /* * cleanup all interfaces, even inactive ones, as some might have * gone down during the HW restart */ ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm); mvm->p2p_device_vif = NULL; mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA; iwl_mvm_reset_phy_ctxts(mvm); memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); memset(mvm->sta_deferred_frames, 0, sizeof(mvm->sta_deferred_frames)); memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); ieee80211_wake_queues(mvm->hw); /* clear any stale d0i3 state */ clear_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status); mvm->vif_count = 0; mvm->rx_ba_sessions = 0; mvm->fwrt.dump.conf = FW_DBG_INVALID; mvm->monitor_on = false; /* keep statistics ticking */ iwl_mvm_accu_radio_stats(mvm); } int __iwl_mvm_mac_start(struct iwl_mvm *mvm) { int ret; lockdep_assert_held(&mvm->mutex); if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) { /* * Now convert the HW_RESTART_REQUESTED flag to IN_HW_RESTART * so later code will - from now on - see that we're doing it. */ set_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); /* Clean up some internal and mac80211 state on restart */ iwl_mvm_restart_cleanup(mvm); } else { /* Hold the reference to prevent runtime suspend while * the start procedure runs. It's a bit confusing * that the UCODE_DOWN reference is taken, but it just * means "UCODE is not UP yet". ( TODO: rename this * reference). */ iwl_mvm_ref(mvm, IWL_MVM_REF_UCODE_DOWN); } ret = iwl_mvm_up(mvm); if (ret && test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { /* Something went wrong - we need to finish some cleanup * that normally iwl_mvm_mac_restart_complete() below * would do. */ clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); #ifdef CONFIG_PM iwl_mvm_d0i3_enable_tx(mvm, NULL); #endif } return ret; } static int iwl_mvm_mac_start(struct ieee80211_hw *hw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; /* Some hw restart cleanups must not hold the mutex */ if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { /* * Make sure we are out of d0i3. This is needed * to make sure the reference accounting is correct * (and there is no stale d0i3_exit_work). */ wait_event_timeout(mvm->d0i3_exit_waitq, !test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status), HZ); } mutex_lock(&mvm->mutex); ret = __iwl_mvm_mac_start(mvm); mutex_unlock(&mvm->mutex); return ret; } static void iwl_mvm_restart_complete(struct iwl_mvm *mvm) { int ret; mutex_lock(&mvm->mutex); clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status); #ifdef CONFIG_PM iwl_mvm_d0i3_enable_tx(mvm, NULL); #endif ret = iwl_mvm_update_quotas(mvm, true, NULL); if (ret) IWL_ERR(mvm, "Failed to update quotas after restart (%d)\n", ret); /* allow transport/FW low power modes */ iwl_mvm_unref(mvm, IWL_MVM_REF_UCODE_DOWN); /* * If we have TDLS peers, remove them. We don't know the last seqno/PN * of packets the FW sent out, so we must reconnect. */ iwl_mvm_teardown_tdls_peers(mvm); mutex_unlock(&mvm->mutex); } static void iwl_mvm_resume_complete(struct iwl_mvm *mvm) { if (iwl_mvm_is_d0i3_supported(mvm) && iwl_mvm_enter_d0i3_on_suspend(mvm)) WARN_ONCE(!wait_event_timeout(mvm->d0i3_exit_waitq, !test_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status), HZ), "D0i3 exit on resume timed out\n"); } static void iwl_mvm_mac_reconfig_complete(struct ieee80211_hw *hw, enum ieee80211_reconfig_type reconfig_type) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); switch (reconfig_type) { case IEEE80211_RECONFIG_TYPE_RESTART: iwl_mvm_restart_complete(mvm); break; case IEEE80211_RECONFIG_TYPE_SUSPEND: iwl_mvm_resume_complete(mvm); break; } } void __iwl_mvm_mac_stop(struct iwl_mvm *mvm) { lockdep_assert_held(&mvm->mutex); /* firmware counters are obviously reset now, but we shouldn't * partially track so also clear the fw_reset_accu counters. */ memset(&mvm->accu_radio_stats, 0, sizeof(mvm->accu_radio_stats)); /* async_handlers_wk is now blocked */ /* * The work item could be running or queued if the * ROC time event stops just as we get here. */ flush_work(&mvm->roc_done_wk); iwl_mvm_stop_device(mvm); iwl_mvm_async_handlers_purge(mvm); /* async_handlers_list is empty and will stay empty: HW is stopped */ /* the fw is stopped, the aux sta is dead: clean up driver state */ iwl_mvm_del_aux_sta(mvm); /* * Clear IN_HW_RESTART and HW_RESTART_REQUESTED flag when stopping the * hw (as restart_complete() won't be called in this case) and mac80211 * won't execute the restart. * But make sure to cleanup interfaces that have gone down before/during * HW restart was requested. */ if (test_and_clear_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) || test_and_clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status)) ieee80211_iterate_interfaces(mvm->hw, 0, iwl_mvm_cleanup_iterator, mvm); /* We shouldn't have any UIDs still set. Loop over all the UIDs to * make sure there's nothing left there and warn if any is found. */ if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) { int i; for (i = 0; i < mvm->max_scans; i++) { if (WARN_ONCE(mvm->scan_uid_status[i], "UMAC scan UID %d status was not cleaned\n", i)) mvm->scan_uid_status[i] = 0; } } } static void iwl_mvm_mac_stop(struct ieee80211_hw *hw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); flush_work(&mvm->d0i3_exit_work); flush_work(&mvm->async_handlers_wk); flush_work(&mvm->add_stream_wk); /* * Lock and clear the firmware running bit here already, so that * new commands coming in elsewhere, e.g. from debugfs, will not * be able to proceed. This is important here because one of those * debugfs files causes the firmware dump to be triggered, and if we * don't stop debugfs accesses before canceling that it could be * retriggered after we flush it but before we've cleared the bit. */ clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); iwl_fw_cancel_dump(&mvm->fwrt); cancel_delayed_work_sync(&mvm->cs_tx_unblock_dwork); cancel_delayed_work_sync(&mvm->scan_timeout_dwork); iwl_fw_free_dump_desc(&mvm->fwrt); mutex_lock(&mvm->mutex); __iwl_mvm_mac_stop(mvm); mutex_unlock(&mvm->mutex); /* * The worker might have been waiting for the mutex, let it run and * discover that its list is now empty. */ cancel_work_sync(&mvm->async_handlers_wk); } static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm) { u16 i; lockdep_assert_held(&mvm->mutex); for (i = 0; i < NUM_PHY_CTX; i++) if (!mvm->phy_ctxts[i].ref) return &mvm->phy_ctxts[i]; IWL_ERR(mvm, "No available PHY context\n"); return NULL; } static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, s16 tx_power) { int len; union { struct iwl_dev_tx_power_cmd v5; struct iwl_dev_tx_power_cmd_v4 v4; } cmd = { .v5.v3.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_MAC), .v5.v3.mac_context_id = cpu_to_le32(iwl_mvm_vif_from_mac80211(vif)->id), .v5.v3.pwr_restriction = cpu_to_le16(8 * tx_power), }; if (tx_power == IWL_DEFAULT_MAX_TX_POWER) cmd.v5.v3.pwr_restriction = cpu_to_le16(IWL_DEV_MAX_TX_POWER); if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_REDUCE_TX_POWER)) len = sizeof(cmd.v5); else if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TX_POWER_ACK)) len = sizeof(cmd.v4); else len = sizeof(cmd.v4.v3); return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); } static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); int ret; mvmvif->mvm = mvm; RCU_INIT_POINTER(mvmvif->probe_resp_data, NULL); /* * make sure D0i3 exit is completed, otherwise a target access * during tx queue configuration could be done when still in * D0i3 state. */ ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_ADD_IF); if (ret) return ret; /* * Not much to do here. The stack will not allow interface * types or combinations that we didn't advertise, so we * don't really have to check the types. */ mutex_lock(&mvm->mutex); /* make sure that beacon statistics don't go backwards with FW reset */ if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) mvmvif->beacon_stats.accu_num_beacons += mvmvif->beacon_stats.num_beacons; /* Allocate resources for the MAC context, and add it to the fw */ ret = iwl_mvm_mac_ctxt_init(mvm, vif); if (ret) goto out_unlock; /* Counting number of interfaces is needed for legacy PM */ if (vif->type != NL80211_IFTYPE_P2P_DEVICE) mvm->vif_count++; /* * The AP binding flow can be done only after the beacon * template is configured (which happens only in the mac80211 * start_ap() flow), and adding the broadcast station can happen * only after the binding. * In addition, since modifying the MAC before adding a bcast * station is not allowed by the FW, delay the adding of MAC context to * the point where we can also add the bcast station. * In short: there's not much we can do at this point, other than * allocating resources :) */ if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC) { ret = iwl_mvm_alloc_bcast_sta(mvm, vif); if (ret) { IWL_ERR(mvm, "Failed to allocate bcast sta\n"); goto out_release; } /* * Only queue for this station is the mcast queue, * which shouldn't be in TFD mask anyway */ ret = iwl_mvm_allocate_int_sta(mvm, &mvmvif->mcast_sta, 0, vif->type, IWL_STA_MULTICAST); if (ret) goto out_release; iwl_mvm_vif_dbgfs_register(mvm, vif); goto out_unlock; } mvmvif->features |= hw->netdev_features; ret = iwl_mvm_mac_ctxt_add(mvm, vif); if (ret) goto out_release; ret = iwl_mvm_power_update_mac(mvm); if (ret) goto out_remove_mac; /* beacon filtering */ ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); if (ret) goto out_remove_mac; if (!mvm->bf_allowed_vif && vif->type == NL80211_IFTYPE_STATION && !vif->p2p) { mvm->bf_allowed_vif = mvmvif; vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | IEEE80211_VIF_SUPPORTS_CQM_RSSI; } /* * P2P_DEVICE interface does not have a channel context assigned to it, * so a dedicated PHY context is allocated to it and the corresponding * MAC context is bound to it at this stage. */ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { mvmvif->phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); if (!mvmvif->phy_ctxt) { ret = -ENOSPC; goto out_free_bf; } iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); ret = iwl_mvm_binding_add_vif(mvm, vif); if (ret) goto out_unref_phy; ret = iwl_mvm_add_p2p_bcast_sta(mvm, vif); if (ret) goto out_unbind; /* Save a pointer to p2p device vif, so it can later be used to * update the p2p device MAC when a GO is started/stopped */ mvm->p2p_device_vif = vif; } iwl_mvm_tcm_add_vif(mvm, vif); if (vif->type == NL80211_IFTYPE_MONITOR) mvm->monitor_on = true; iwl_mvm_vif_dbgfs_register(mvm, vif); goto out_unlock; out_unbind: iwl_mvm_binding_remove_vif(mvm, vif); out_unref_phy: iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); out_free_bf: if (mvm->bf_allowed_vif == mvmvif) { mvm->bf_allowed_vif = NULL; vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER | IEEE80211_VIF_SUPPORTS_CQM_RSSI); } out_remove_mac: mvmvif->phy_ctxt = NULL; iwl_mvm_mac_ctxt_remove(mvm, vif); out_release: if (vif->type != NL80211_IFTYPE_P2P_DEVICE) mvm->vif_count--; out_unlock: mutex_unlock(&mvm->mutex); iwl_mvm_unref(mvm, IWL_MVM_REF_ADD_IF); return ret; } static void iwl_mvm_prepare_mac_removal(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { /* * Flush the ROC worker which will flush the OFFCHANNEL queue. * We assume here that all the packets sent to the OFFCHANNEL * queue are sent in ROC session. */ flush_work(&mvm->roc_done_wk); } } static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_probe_resp_data *probe_data; iwl_mvm_prepare_mac_removal(mvm, vif); if (!(vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC)) iwl_mvm_tcm_rm_vif(mvm, vif); mutex_lock(&mvm->mutex); probe_data = rcu_dereference_protected(mvmvif->probe_resp_data, lockdep_is_held(&mvm->mutex)); RCU_INIT_POINTER(mvmvif->probe_resp_data, NULL); if (probe_data) kfree_rcu(probe_data, rcu_head); if (mvm->bf_allowed_vif == mvmvif) { mvm->bf_allowed_vif = NULL; vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER | IEEE80211_VIF_SUPPORTS_CQM_RSSI); } iwl_mvm_vif_dbgfs_clean(mvm, vif); /* * For AP/GO interface, the tear down of the resources allocated to the * interface is be handled as part of the stop_ap flow. */ if (vif->type == NL80211_IFTYPE_AP || vif->type == NL80211_IFTYPE_ADHOC) { #ifdef CONFIG_NL80211_TESTMODE if (vif == mvm->noa_vif) { mvm->noa_vif = NULL; mvm->noa_duration = 0; } #endif iwl_mvm_dealloc_int_sta(mvm, &mvmvif->mcast_sta); iwl_mvm_dealloc_bcast_sta(mvm, vif); goto out_release; } if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { mvm->p2p_device_vif = NULL; iwl_mvm_rm_p2p_bcast_sta(mvm, vif); iwl_mvm_binding_remove_vif(mvm, vif); iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); mvmvif->phy_ctxt = NULL; } if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE) mvm->vif_count--; iwl_mvm_power_update_mac(mvm); iwl_mvm_mac_ctxt_remove(mvm, vif); if (vif->type == NL80211_IFTYPE_MONITOR) mvm->monitor_on = false; out_release: mutex_unlock(&mvm->mutex); } static int iwl_mvm_mac_config(struct ieee80211_hw *hw, u32 changed) { return 0; } struct iwl_mvm_mc_iter_data { struct iwl_mvm *mvm; int port_id; }; static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac, struct ieee80211_vif *vif) { struct iwl_mvm_mc_iter_data *data = _data; struct iwl_mvm *mvm = data->mvm; struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd; struct iwl_host_cmd hcmd = { .id = MCAST_FILTER_CMD, .flags = CMD_ASYNC, .dataflags[0] = IWL_HCMD_DFL_NOCOPY, }; int ret, len; /* if we don't have free ports, mcast frames will be dropped */ if (WARN_ON_ONCE(data->port_id >= MAX_PORT_ID_NUM)) return; if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc) return; cmd->port_id = data->port_id++; memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN); len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4); hcmd.len[0] = len; hcmd.data[0] = cmd; ret = iwl_mvm_send_cmd(mvm, &hcmd); if (ret) IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret); } static void iwl_mvm_recalc_multicast(struct iwl_mvm *mvm) { struct iwl_mvm_mc_iter_data iter_data = { .mvm = mvm, }; lockdep_assert_held(&mvm->mutex); if (WARN_ON_ONCE(!mvm->mcast_filter_cmd)) return; ieee80211_iterate_active_interfaces_atomic( mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_mc_iface_iterator, &iter_data); } static u64 iwl_mvm_prepare_multicast(struct ieee80211_hw *hw, struct netdev_hw_addr_list *mc_list) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mcast_filter_cmd *cmd; struct netdev_hw_addr *addr; int addr_count; bool pass_all; int len; addr_count = netdev_hw_addr_list_count(mc_list); pass_all = addr_count > MAX_MCAST_FILTERING_ADDRESSES || IWL_MVM_FW_MCAST_FILTER_PASS_ALL; if (pass_all) addr_count = 0; len = roundup(sizeof(*cmd) + addr_count * ETH_ALEN, 4); cmd = kzalloc(len, GFP_ATOMIC); if (!cmd) return 0; if (pass_all) { cmd->pass_all = 1; return (u64)(unsigned long)cmd; } netdev_hw_addr_list_for_each(addr, mc_list) { IWL_DEBUG_MAC80211(mvm, "mcast addr (%d): %pM\n", cmd->count, addr->addr); memcpy(&cmd->addr_list[cmd->count * ETH_ALEN], addr->addr, ETH_ALEN); cmd->count++; } return (u64)(unsigned long)cmd; } static void iwl_mvm_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, unsigned int *total_flags, u64 multicast) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mcast_filter_cmd *cmd = (void *)(unsigned long)multicast; mutex_lock(&mvm->mutex); /* replace previous configuration */ kfree(mvm->mcast_filter_cmd); mvm->mcast_filter_cmd = cmd; if (!cmd) goto out; if (changed_flags & FIF_ALLMULTI) cmd->pass_all = !!(*total_flags & FIF_ALLMULTI); if (cmd->pass_all) cmd->count = 0; iwl_mvm_recalc_multicast(mvm); out: mutex_unlock(&mvm->mutex); *total_flags = 0; } static void iwl_mvm_config_iface_filter(struct ieee80211_hw *hw, struct ieee80211_vif *vif, unsigned int filter_flags, unsigned int changed_flags) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); /* We support only filter for probe requests */ if (!(changed_flags & FIF_PROBE_REQ)) return; /* Supported only for p2p client interfaces */ if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc || !vif->p2p) return; mutex_lock(&mvm->mutex); iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); mutex_unlock(&mvm->mutex); } #ifdef CONFIG_IWLWIFI_BCAST_FILTERING struct iwl_bcast_iter_data { struct iwl_mvm *mvm; struct iwl_bcast_filter_cmd *cmd; u8 current_filter; }; static void iwl_mvm_set_bcast_filter(struct ieee80211_vif *vif, const struct iwl_fw_bcast_filter *in_filter, struct iwl_fw_bcast_filter *out_filter) { struct iwl_fw_bcast_filter_attr *attr; int i; memcpy(out_filter, in_filter, sizeof(*out_filter)); for (i = 0; i < ARRAY_SIZE(out_filter->attrs); i++) { attr = &out_filter->attrs[i]; if (!attr->mask) break; switch (attr->reserved1) { case cpu_to_le16(BC_FILTER_MAGIC_IP): if (vif->bss_conf.arp_addr_cnt != 1) { attr->mask = 0; continue; } attr->val = vif->bss_conf.arp_addr_list[0]; break; case cpu_to_le16(BC_FILTER_MAGIC_MAC): attr->val = *(__be32 *)&vif->addr[2]; break; default: break; } attr->reserved1 = 0; out_filter->num_attrs++; } } static void iwl_mvm_bcast_filter_iterator(void *_data, u8 *mac, struct ieee80211_vif *vif) { struct iwl_bcast_iter_data *data = _data; struct iwl_mvm *mvm = data->mvm; struct iwl_bcast_filter_cmd *cmd = data->cmd; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_fw_bcast_mac *bcast_mac; int i; if (WARN_ON(mvmvif->id >= ARRAY_SIZE(cmd->macs))) return; bcast_mac = &cmd->macs[mvmvif->id]; /* * enable filtering only for associated stations, but not for P2P * Clients */ if (vif->type != NL80211_IFTYPE_STATION || vif->p2p || !vif->bss_conf.assoc) return; bcast_mac->default_discard = 1; /* copy all configured filters */ for (i = 0; mvm->bcast_filters[i].attrs[0].mask; i++) { /* * Make sure we don't exceed our filters limit. * if there is still a valid filter to be configured, * be on the safe side and just allow bcast for this mac. */ if (WARN_ON_ONCE(data->current_filter >= ARRAY_SIZE(cmd->filters))) { bcast_mac->default_discard = 0; bcast_mac->attached_filters = 0; break; } iwl_mvm_set_bcast_filter(vif, &mvm->bcast_filters[i], &cmd->filters[data->current_filter]); /* skip current filter if it contains no attributes */ if (!cmd->filters[data->current_filter].num_attrs) continue; /* attach the filter to current mac */ bcast_mac->attached_filters |= cpu_to_le16(BIT(data->current_filter)); data->current_filter++; } } bool iwl_mvm_bcast_filter_build_cmd(struct iwl_mvm *mvm, struct iwl_bcast_filter_cmd *cmd) { struct iwl_bcast_iter_data iter_data = { .mvm = mvm, .cmd = cmd, }; if (IWL_MVM_FW_BCAST_FILTER_PASS_ALL) return false; memset(cmd, 0, sizeof(*cmd)); cmd->max_bcast_filters = ARRAY_SIZE(cmd->filters); cmd->max_macs = ARRAY_SIZE(cmd->macs); #ifdef CONFIG_IWLWIFI_DEBUGFS /* use debugfs filters/macs if override is configured */ if (mvm->dbgfs_bcast_filtering.override) { memcpy(cmd->filters, &mvm->dbgfs_bcast_filtering.cmd.filters, sizeof(cmd->filters)); memcpy(cmd->macs, &mvm->dbgfs_bcast_filtering.cmd.macs, sizeof(cmd->macs)); return true; } #endif /* if no filters are configured, do nothing */ if (!mvm->bcast_filters) return false; /* configure and attach these filters for each associated sta vif */ ieee80211_iterate_active_interfaces( mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_bcast_filter_iterator, &iter_data); return true; } static int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm) { struct iwl_bcast_filter_cmd cmd; if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING)) return 0; if (!iwl_mvm_bcast_filter_build_cmd(mvm, &cmd)) return 0; return iwl_mvm_send_cmd_pdu(mvm, BCAST_FILTER_CMD, 0, sizeof(cmd), &cmd); } #else static inline int iwl_mvm_configure_bcast_filter(struct iwl_mvm *mvm) { return 0; } #endif static int iwl_mvm_update_mu_groups(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { struct iwl_mu_group_mgmt_cmd cmd = {}; memcpy(cmd.membership_status, vif->bss_conf.mu_group.membership, WLAN_MEMBERSHIP_LEN); memcpy(cmd.user_position, vif->bss_conf.mu_group.position, WLAN_USER_POSITION_LEN); return iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(DATA_PATH_GROUP, UPDATE_MU_GROUPS_CMD), 0, sizeof(cmd), &cmd); } static void iwl_mvm_mu_mimo_iface_iterator(void *_data, u8 *mac, struct ieee80211_vif *vif) { if (vif->mu_mimo_owner) { struct iwl_mu_group_mgmt_notif *notif = _data; /* * MU-MIMO Group Id action frame is little endian. We treat * the data received from firmware as if it came from the * action frame, so no conversion is needed. */ ieee80211_update_mu_groups(vif, (u8 *)&notif->membership_status, (u8 *)&notif->user_position); } } void iwl_mvm_mu_mimo_grp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_mu_group_mgmt_notif *notif = (void *)pkt->data; ieee80211_iterate_active_interfaces_atomic( mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_mu_mimo_iface_iterator, notif); } static u8 iwl_mvm_he_get_ppe_val(u8 *ppe, u8 ppe_pos_bit) { u8 byte_num = ppe_pos_bit / 8; u8 bit_num = ppe_pos_bit % 8; u8 residue_bits; u8 res; if (bit_num <= 5) return (ppe[byte_num] >> bit_num) & (BIT(IEEE80211_PPE_THRES_INFO_PPET_SIZE) - 1); /* * If bit_num > 5, we have to combine bits with next byte. * Calculate how many bits we need to take from current byte (called * here "residue_bits"), and add them to bits from next byte. */ residue_bits = 8 - bit_num; res = (ppe[byte_num + 1] & (BIT(IEEE80211_PPE_THRES_INFO_PPET_SIZE - residue_bits) - 1)) << residue_bits; res += (ppe[byte_num] >> bit_num) & (BIT(residue_bits) - 1); return res; } static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, u8 sta_id) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_he_sta_context_cmd sta_ctxt_cmd = { .sta_id = sta_id, .tid_limit = IWL_MAX_TID_COUNT, .bss_color = vif->bss_conf.bss_color, .htc_trig_based_pkt_ext = vif->bss_conf.htc_trig_based_pkt_ext, .frame_time_rts_th = cpu_to_le16(vif->bss_conf.frame_time_rts_th), }; struct ieee80211_sta *sta; u32 flags; int i; rcu_read_lock(); sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_ctxt_cmd.sta_id]); if (IS_ERR(sta)) { rcu_read_unlock(); WARN(1, "Can't find STA to configure HE\n"); return; } if (!sta->he_cap.has_he) { rcu_read_unlock(); return; } flags = 0; /* HTC flags */ if (sta->he_cap.he_cap_elem.mac_cap_info[0] & IEEE80211_HE_MAC_CAP0_HTC_HE) sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_SUPPORT); if ((sta->he_cap.he_cap_elem.mac_cap_info[1] & IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION) || (sta->he_cap.he_cap_elem.mac_cap_info[2] & IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION)) { u8 link_adap = ((sta->he_cap.he_cap_elem.mac_cap_info[2] & IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION) << 1) + (sta->he_cap.he_cap_elem.mac_cap_info[1] & IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION); if (link_adap == 2) sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_LINK_ADAP_UNSOLICITED); else if (link_adap == 3) sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_LINK_ADAP_BOTH); } if (sta->he_cap.he_cap_elem.mac_cap_info[2] & IEEE80211_HE_MAC_CAP2_BSR) sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_BSR_SUPP); if (sta->he_cap.he_cap_elem.mac_cap_info[3] & IEEE80211_HE_MAC_CAP3_OMI_CONTROL) sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_OMI_SUPP); if (sta->he_cap.he_cap_elem.mac_cap_info[4] & IEEE80211_HE_MAC_CAP4_BQR) sta_ctxt_cmd.htc_flags |= cpu_to_le32(IWL_HE_HTC_BQR_SUPP); /* If PPE Thresholds exist, parse them into a FW-familiar format */ if (sta->he_cap.he_cap_elem.phy_cap_info[6] & IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT) { u8 nss = (sta->he_cap.ppe_thres[0] & IEEE80211_PPE_THRES_NSS_MASK) + 1; u8 ru_index_bitmap = (sta->he_cap.ppe_thres[0] & IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK) >> IEEE80211_PPE_THRES_RU_INDEX_BITMASK_POS; u8 *ppe = &sta->he_cap.ppe_thres[0]; u8 ppe_pos_bit = 7; /* Starting after PPE header */ /* * FW currently supports only nss == MAX_HE_SUPP_NSS * * If nss > MAX: we can ignore values we don't support * If nss < MAX: we can set zeros in other streams */ if (nss > MAX_HE_SUPP_NSS) { IWL_INFO(mvm, "Got NSS = %d - trimming to %d\n", nss, MAX_HE_SUPP_NSS); nss = MAX_HE_SUPP_NSS; } for (i = 0; i < nss; i++) { u8 ru_index_tmp = ru_index_bitmap << 1; u8 bw; for (bw = 0; bw < MAX_HE_CHANNEL_BW_INDX; bw++) { ru_index_tmp >>= 1; if (!(ru_index_tmp & 1)) continue; sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th[i][bw][1] = iwl_mvm_he_get_ppe_val(ppe, ppe_pos_bit); ppe_pos_bit += IEEE80211_PPE_THRES_INFO_PPET_SIZE; sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th[i][bw][0] = iwl_mvm_he_get_ppe_val(ppe, ppe_pos_bit); ppe_pos_bit += IEEE80211_PPE_THRES_INFO_PPET_SIZE; } } flags |= STA_CTXT_HE_PACKET_EXT; } rcu_read_unlock(); /* Mark MU EDCA as enabled, unless none detected on some AC */ flags |= STA_CTXT_HE_MU_EDCA_CW; for (i = 0; i < AC_NUM; i++) { struct ieee80211_he_mu_edca_param_ac_rec *mu_edca = &mvmvif->queue_params[i].mu_edca_param_rec; if (!mvmvif->queue_params[i].mu_edca) { flags &= ~STA_CTXT_HE_MU_EDCA_CW; break; } sta_ctxt_cmd.trig_based_txf[i].cwmin = cpu_to_le16(mu_edca->ecw_min_max & 0xf); sta_ctxt_cmd.trig_based_txf[i].cwmax = cpu_to_le16((mu_edca->ecw_min_max & 0xf0) >> 4); sta_ctxt_cmd.trig_based_txf[i].aifsn = cpu_to_le16(mu_edca->aifsn); sta_ctxt_cmd.trig_based_txf[i].mu_time = cpu_to_le16(mu_edca->mu_edca_timer); } if (vif->bss_conf.multi_sta_back_32bit) flags |= STA_CTXT_HE_32BIT_BA_BITMAP; if (vif->bss_conf.ack_enabled) flags |= STA_CTXT_HE_ACK_ENABLED; if (vif->bss_conf.uora_exists) { flags |= STA_CTXT_HE_TRIG_RND_ALLOC; sta_ctxt_cmd.rand_alloc_ecwmin = vif->bss_conf.uora_ocw_range & 0x7; sta_ctxt_cmd.rand_alloc_ecwmax = (vif->bss_conf.uora_ocw_range >> 3) & 0x7; } /* TODO: support Multi BSSID IE */ sta_ctxt_cmd.flags = cpu_to_le32(flags); if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(STA_HE_CTXT_CMD, DATA_PATH_GROUP, 0), 0, sizeof(sta_ctxt_cmd), &sta_ctxt_cmd)) IWL_ERR(mvm, "Failed to config FW to work HE!\n"); } static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u32 changes) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); int ret; /* * Re-calculate the tsf id, as the master-slave relations depend on the * beacon interval, which was not known when the station interface was * added. */ if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) { if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax) iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); } /* * If we're not associated yet, take the (new) BSSID before associating * so the firmware knows. If we're already associated, then use the old * BSSID here, and we'll send a cleared one later in the CHANGED_ASSOC * branch for disassociation below. */ if (changes & BSS_CHANGED_BSSID && !mvmvif->associated) memcpy(mvmvif->bssid, bss_conf->bssid, ETH_ALEN); ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, mvmvif->bssid); if (ret) IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); /* after sending it once, adopt mac80211 data */ memcpy(mvmvif->bssid, bss_conf->bssid, ETH_ALEN); mvmvif->associated = bss_conf->assoc; if (changes & BSS_CHANGED_ASSOC) { if (bss_conf->assoc) { /* clear statistics to get clean beacon counter */ iwl_mvm_request_statistics(mvm, true); memset(&mvmvif->beacon_stats, 0, sizeof(mvmvif->beacon_stats)); /* add quota for this interface */ ret = iwl_mvm_update_quotas(mvm, true, NULL); if (ret) { IWL_ERR(mvm, "failed to update quotas\n"); return; } if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { /* * If we're restarting then the firmware will * obviously have lost synchronisation with * the AP. It will attempt to synchronise by * itself, but we can make it more reliable by * scheduling a session protection time event. * * The firmware needs to receive a beacon to * catch up with synchronisation, use 110% of * the beacon interval. * * Set a large maximum delay to allow for more * than a single interface. */ u32 dur = (11 * vif->bss_conf.beacon_int) / 10; iwl_mvm_protect_session(mvm, vif, dur, dur, 5 * dur, false); } iwl_mvm_sf_update(mvm, vif, false); iwl_mvm_power_vif_assoc(mvm, vif); if (vif->p2p) { iwl_mvm_ref(mvm, IWL_MVM_REF_P2P_CLIENT); iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_PROT, IEEE80211_SMPS_DYNAMIC); } } else if (mvmvif->ap_sta_id != IWL_MVM_INVALID_STA) { /* * If update fails - SF might be running in associated * mode while disassociated - which is forbidden. */ WARN_ONCE(iwl_mvm_sf_update(mvm, vif, false), "Failed to update SF upon disassociation\n"); /* * If we get an assert during the connection (after the * station has been added, but before the vif is set * to associated), mac80211 will re-add the station and * then configure the vif. Since the vif is not * associated, we would remove the station here and * this would fail the recovery. */ if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { /* * Remove AP station now that * the MAC is unassoc */ ret = iwl_mvm_rm_sta_id(mvm, vif, mvmvif->ap_sta_id); if (ret) IWL_ERR(mvm, "failed to remove AP station\n"); if (mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id) mvm->d0i3_ap_sta_id = IWL_MVM_INVALID_STA; mvmvif->ap_sta_id = IWL_MVM_INVALID_STA; } /* remove quota for this interface */ ret = iwl_mvm_update_quotas(mvm, false, NULL); if (ret) IWL_ERR(mvm, "failed to update quotas\n"); if (vif->p2p) iwl_mvm_unref(mvm, IWL_MVM_REF_P2P_CLIENT); /* this will take the cleared BSSID from bss_conf */ ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); if (ret) IWL_ERR(mvm, "failed to update MAC %pM (clear after unassoc)\n", vif->addr); } /* * The firmware tracks the MU-MIMO group on its own. * However, on HW restart we should restore this data. */ if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && (changes & BSS_CHANGED_MU_GROUPS) && vif->mu_mimo_owner) { ret = iwl_mvm_update_mu_groups(mvm, vif); if (ret) IWL_ERR(mvm, "failed to update VHT MU_MIMO groups\n"); } iwl_mvm_recalc_multicast(mvm); iwl_mvm_configure_bcast_filter(mvm); /* reset rssi values */ mvmvif->bf_data.ave_beacon_signal = 0; iwl_mvm_bt_coex_vif_change(mvm); iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_TT, IEEE80211_SMPS_AUTOMATIC); if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_UMAC_SCAN)) iwl_mvm_config_scan(mvm); } if (changes & BSS_CHANGED_BEACON_INFO) { /* * We received a beacon from the associated AP so * remove the session protection. */ iwl_mvm_stop_session_protection(mvm, vif); iwl_mvm_sf_update(mvm, vif, false); WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); } if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS | BSS_CHANGED_QOS | /* * Send power command on every beacon change, * because we may have not enabled beacon abort yet. */ BSS_CHANGED_BEACON_INFO)) { ret = iwl_mvm_power_update_mac(mvm); if (ret) IWL_ERR(mvm, "failed to update power mode\n"); } if (changes & BSS_CHANGED_TXPOWER) { IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", bss_conf->txpower); iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); } if (changes & BSS_CHANGED_CQM) { IWL_DEBUG_MAC80211(mvm, "cqm info_changed\n"); /* reset cqm events tracking */ mvmvif->bf_data.last_cqm_event = 0; if (mvmvif->bf_data.bf_enabled) { ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); if (ret) IWL_ERR(mvm, "failed to update CQM thresholds\n"); } } if (changes & BSS_CHANGED_ARP_FILTER) { IWL_DEBUG_MAC80211(mvm, "arp filter changed\n"); iwl_mvm_configure_bcast_filter(mvm); } } static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); int ret; /* * iwl_mvm_mac_ctxt_add() might read directly from the device * (the system time), so make sure it is available. */ ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_START_AP); if (ret) return ret; mutex_lock(&mvm->mutex); /* Send the beacon template */ ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif); if (ret) goto out_unlock; /* * Re-calculate the tsf id, as the master-slave relations depend on the * beacon interval, which was not known when the AP interface was added. */ if (vif->type == NL80211_IFTYPE_AP) iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); mvmvif->ap_assoc_sta_count = 0; /* Add the mac context */ ret = iwl_mvm_mac_ctxt_add(mvm, vif); if (ret) goto out_unlock; /* Perform the binding */ ret = iwl_mvm_binding_add_vif(mvm, vif); if (ret) goto out_remove; /* * This is not very nice, but the simplest: * For older FWs adding the mcast sta before the bcast station may * cause assert 0x2b00. * This is fixed in later FW so make the order of removal depend on * the TLV */ if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) { ret = iwl_mvm_add_mcast_sta(mvm, vif); if (ret) goto out_unbind; /* * Send the bcast station. At this stage the TBTT and DTIM time * events are added and applied to the scheduler */ ret = iwl_mvm_send_add_bcast_sta(mvm, vif); if (ret) { iwl_mvm_rm_mcast_sta(mvm, vif); goto out_unbind; } } else { /* * Send the bcast station. At this stage the TBTT and DTIM time * events are added and applied to the scheduler */ ret = iwl_mvm_send_add_bcast_sta(mvm, vif); if (ret) goto out_unbind; ret = iwl_mvm_add_mcast_sta(mvm, vif); if (ret) { iwl_mvm_send_rm_bcast_sta(mvm, vif); goto out_unbind; } } /* must be set before quota calculations */ mvmvif->ap_ibss_active = true; /* power updated needs to be done before quotas */ iwl_mvm_power_update_mac(mvm); ret = iwl_mvm_update_quotas(mvm, false, NULL); if (ret) goto out_quota_failed; /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */ if (vif->p2p && mvm->p2p_device_vif) iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); iwl_mvm_ref(mvm, IWL_MVM_REF_AP_IBSS); iwl_mvm_bt_coex_vif_change(mvm); /* we don't support TDLS during DCM */ if (iwl_mvm_phy_ctx_count(mvm) > 1) iwl_mvm_teardown_tdls_peers(mvm); goto out_unlock; out_quota_failed: iwl_mvm_power_update_mac(mvm); mvmvif->ap_ibss_active = false; iwl_mvm_send_rm_bcast_sta(mvm, vif); iwl_mvm_rm_mcast_sta(mvm, vif); out_unbind: iwl_mvm_binding_remove_vif(mvm, vif); out_remove: iwl_mvm_mac_ctxt_remove(mvm, vif); out_unlock: mutex_unlock(&mvm->mutex); iwl_mvm_unref(mvm, IWL_MVM_REF_START_AP); return ret; } static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); iwl_mvm_prepare_mac_removal(mvm, vif); mutex_lock(&mvm->mutex); /* Handle AP stop while in CSA */ if (rcu_access_pointer(mvm->csa_vif) == vif) { iwl_mvm_remove_time_event(mvm, mvmvif, &mvmvif->time_event_data); RCU_INIT_POINTER(mvm->csa_vif, NULL); mvmvif->csa_countdown = false; } if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) { RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); mvm->csa_tx_block_bcn_timeout = 0; } mvmvif->ap_ibss_active = false; mvm->ap_last_beacon_gp2 = 0; iwl_mvm_bt_coex_vif_change(mvm); iwl_mvm_unref(mvm, IWL_MVM_REF_AP_IBSS); /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */ if (vif->p2p && mvm->p2p_device_vif) iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false, NULL); iwl_mvm_update_quotas(mvm, false, NULL); /* * This is not very nice, but the simplest: * For older FWs removing the mcast sta before the bcast station may * cause assert 0x2b00. * This is fixed in later FW (which will stop beaconing when removing * bcast station). * So make the order of removal depend on the TLV */ if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) iwl_mvm_rm_mcast_sta(mvm, vif); iwl_mvm_send_rm_bcast_sta(mvm, vif); if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) iwl_mvm_rm_mcast_sta(mvm, vif); iwl_mvm_binding_remove_vif(mvm, vif); iwl_mvm_power_update_mac(mvm); iwl_mvm_mac_ctxt_remove(mvm, vif); kfree(mvmvif->ap_wep_key); mvmvif->ap_wep_key = NULL; mutex_unlock(&mvm->mutex); } static void iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u32 changes) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); /* Changes will be applied when the AP/IBSS is started */ if (!mvmvif->ap_ibss_active) return; if (changes & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_HT | BSS_CHANGED_BANDWIDTH | BSS_CHANGED_QOS) && iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL)) IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); /* Need to send a new beacon template to the FW */ if (changes & BSS_CHANGED_BEACON && iwl_mvm_mac_ctxt_beacon_changed(mvm, vif)) IWL_WARN(mvm, "Failed updating beacon data\n"); if (changes & BSS_CHANGED_TXPOWER) { IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", bss_conf->txpower); iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); } } static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u32 changes) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); /* * iwl_mvm_bss_info_changed_station() might call * iwl_mvm_protect_session(), which reads directly from * the device (the system time), so make sure it is available. */ if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_BSS_CHANGED)) return; mutex_lock(&mvm->mutex); if (changes & BSS_CHANGED_IDLE && !bss_conf->idle) iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, true); switch (vif->type) { case NL80211_IFTYPE_STATION: iwl_mvm_bss_info_changed_station(mvm, vif, bss_conf, changes); break; case NL80211_IFTYPE_AP: case NL80211_IFTYPE_ADHOC: iwl_mvm_bss_info_changed_ap_ibss(mvm, vif, bss_conf, changes); break; case NL80211_IFTYPE_MONITOR: if (changes & BSS_CHANGED_MU_GROUPS) iwl_mvm_update_mu_groups(mvm, vif); break; default: /* shouldn't happen */ WARN_ON_ONCE(1); } mutex_unlock(&mvm->mutex); iwl_mvm_unref(mvm, IWL_MVM_REF_BSS_CHANGED); } static int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *hw_req) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; if (hw_req->req.n_channels == 0 || hw_req->req.n_channels > mvm->fw->ucode_capa.n_scan_channels) return -EINVAL; mutex_lock(&mvm->mutex); ret = iwl_mvm_reg_scan_start(mvm, vif, &hw_req->req, &hw_req->ies); mutex_unlock(&mvm->mutex); return ret; } static void iwl_mvm_mac_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); mutex_lock(&mvm->mutex); /* Due to a race condition, it's possible that mac80211 asks * us to stop a hw_scan when it's already stopped. This can * happen, for instance, if we stopped the scan ourselves, * called ieee80211_scan_completed() and the userspace called * cancel scan scan before ieee80211_scan_work() could run. * To handle that, simply return if the scan is not running. */ if (mvm->scan_status & IWL_MVM_SCAN_REGULAR) iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_REGULAR, true); mutex_unlock(&mvm->mutex); } static void iwl_mvm_mac_allow_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u16 tids, int num_frames, enum ieee80211_frame_release_type reason, bool more_data) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); /* Called when we need to transmit (a) frame(s) from mac80211 */ iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, tids, more_data, false); } static void iwl_mvm_mac_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u16 tids, int num_frames, enum ieee80211_frame_release_type reason, bool more_data) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); /* Called when we need to transmit (a) frame(s) from agg or dqa queue */ iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames, tids, more_data, true); } static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, enum sta_notify_cmd cmd, struct ieee80211_sta *sta) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); unsigned long txqs = 0, tids = 0; int tid; /* * If we have TVQM then we get too high queue numbers - luckily * we really shouldn't get here with that because such hardware * should have firmware supporting buffer station offload. */ if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) return; spin_lock_bh(&mvmsta->lock); for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++) { struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE) continue; __set_bit(tid_data->txq_id, &txqs); if (iwl_mvm_tid_queued(mvm, tid_data) == 0) continue; __set_bit(tid, &tids); } switch (cmd) { case STA_NOTIFY_SLEEP: for_each_set_bit(tid, &tids, IWL_MAX_TID_COUNT) ieee80211_sta_set_buffered(sta, tid, true); if (txqs) iwl_trans_freeze_txq_timer(mvm->trans, txqs, true); /* * The fw updates the STA to be asleep. Tx packets on the Tx * queues to this station will not be transmitted. The fw will * send a Tx response with TX_STATUS_FAIL_DEST_PS. */ break; case STA_NOTIFY_AWAKE: if (WARN_ON(mvmsta->sta_id == IWL_MVM_INVALID_STA)) break; if (txqs) iwl_trans_freeze_txq_timer(mvm->trans, txqs, false); iwl_mvm_sta_modify_ps_wake(mvm, sta); break; default: break; } spin_unlock_bh(&mvmsta->lock); } static void iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, enum sta_notify_cmd cmd, struct ieee80211_sta *sta) { __iwl_mvm_mac_sta_notify(hw, cmd, sta); } void iwl_mvm_sta_pm_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_mvm_pm_state_notification *notif = (void *)pkt->data; struct ieee80211_sta *sta; struct iwl_mvm_sta *mvmsta; bool sleeping = (notif->type != IWL_MVM_PM_EVENT_AWAKE); if (WARN_ON(notif->sta_id >= ARRAY_SIZE(mvm->fw_id_to_mac_id))) return; rcu_read_lock(); sta = rcu_dereference(mvm->fw_id_to_mac_id[notif->sta_id]); if (WARN_ON(IS_ERR_OR_NULL(sta))) { rcu_read_unlock(); return; } mvmsta = iwl_mvm_sta_from_mac80211(sta); if (!mvmsta->vif || mvmsta->vif->type != NL80211_IFTYPE_AP) { rcu_read_unlock(); return; } if (mvmsta->sleeping != sleeping) { mvmsta->sleeping = sleeping; __iwl_mvm_mac_sta_notify(mvm->hw, sleeping ? STA_NOTIFY_SLEEP : STA_NOTIFY_AWAKE, sta); ieee80211_sta_ps_transition(sta, sleeping); } if (sleeping) { switch (notif->type) { case IWL_MVM_PM_EVENT_AWAKE: case IWL_MVM_PM_EVENT_ASLEEP: break; case IWL_MVM_PM_EVENT_UAPSD: ieee80211_sta_uapsd_trigger(sta, IEEE80211_NUM_TIDS); break; case IWL_MVM_PM_EVENT_PS_POLL: ieee80211_sta_pspoll(sta); break; default: break; } } rcu_read_unlock(); } static void iwl_mvm_sta_pre_rcu_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); /* * This is called before mac80211 does RCU synchronisation, * so here we already invalidate our internal RCU-protected * station pointer. The rest of the code will thus no longer * be able to find the station this way, and we don't rely * on further RCU synchronisation after the sta_state() * callback deleted the station. */ mutex_lock(&mvm->mutex); if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id])) rcu_assign_pointer(mvm->fw_id_to_mac_id[mvm_sta->sta_id], ERR_PTR(-ENOENT)); mutex_unlock(&mvm->mutex); } static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, const u8 *bssid) { int i; if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { struct iwl_mvm_tcm_mac *mdata; mdata = &mvm->tcm.data[iwl_mvm_vif_from_mac80211(vif)->id]; ewma_rate_init(&mdata->uapsd_nonagg_detect.rate); mdata->opened_rx_ba_sessions = false; } if (!(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_UAPSD_SUPPORT)) return; if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm)) { vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD; return; } if (!vif->p2p && (iwlwifi_mod_params.uapsd_disable & IWL_DISABLE_UAPSD_BSS)) { vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD; return; } for (i = 0; i < IWL_MVM_UAPSD_NOAGG_LIST_LEN; i++) { if (ether_addr_equal(mvm->uapsd_noagg_bssids[i].addr, bssid)) { vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD; return; } } vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD; } static void iwl_mvm_tdls_check_trigger(struct iwl_mvm *mvm, struct ieee80211_vif *vif, u8 *peer_addr, enum nl80211_tdls_operation action) { struct iwl_fw_dbg_trigger_tlv *trig; struct iwl_fw_dbg_trigger_tdls *tdls_trig; trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), FW_DBG_TRIGGER_TDLS); if (!trig) return; tdls_trig = (void *)trig->data; if (!(tdls_trig->action_bitmap & BIT(action))) return; if (tdls_trig->peer_mode && memcmp(tdls_trig->peer, peer_addr, ETH_ALEN) != 0) return; iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, "TDLS event occurred, peer %pM, action %d", peer_addr, action); } static void iwl_mvm_purge_deferred_tx_frames(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvm_sta) { struct iwl_mvm_tid_data *tid_data; struct sk_buff *skb; int i; spin_lock_bh(&mvm_sta->lock); for (i = 0; i <= IWL_MAX_TID_COUNT; i++) { tid_data = &mvm_sta->tid_data[i]; while ((skb = __skb_dequeue(&tid_data->deferred_tx_frames))) { struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); /* * The first deferred frame should've stopped the MAC * queues, so we should never get a second deferred * frame for the RA/TID. */ iwl_mvm_start_mac_queues(mvm, BIT(info->hw_queue)); ieee80211_free_txskb(mvm->hw, skb); } } spin_unlock_bh(&mvm_sta->lock); } static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, enum ieee80211_sta_state old_state, enum ieee80211_sta_state new_state) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); int ret; IWL_DEBUG_MAC80211(mvm, "station %pM state change %d->%d\n", sta->addr, old_state, new_state); /* this would be a mac80211 bug ... but don't crash */ if (WARN_ON_ONCE(!mvmvif->phy_ctxt)) return -EINVAL; /* * If we are in a STA removal flow and in DQA mode: * * This is after the sync_rcu part, so the queues have already been * flushed. No more TXs on their way in mac80211's path, and no more in * the queues. * Also, we won't be getting any new TX frames for this station. * What we might have are deferred TX frames that need to be taken care * of. * * Drop any still-queued deferred-frame before removing the STA, and * make sure the worker is no longer handling frames for this STA. */ if (old_state == IEEE80211_STA_NONE && new_state == IEEE80211_STA_NOTEXIST) { iwl_mvm_purge_deferred_tx_frames(mvm, mvm_sta); flush_work(&mvm->add_stream_wk); /* * No need to make sure deferred TX indication is off since the * worker will already remove it if it was on */ } mutex_lock(&mvm->mutex); /* track whether or not the station is associated */ mvm_sta->sta_state = new_state; if (old_state == IEEE80211_STA_NOTEXIST && new_state == IEEE80211_STA_NONE) { /* * Firmware bug - it'll crash if the beacon interval is less * than 16. We can't avoid connecting at all, so refuse the * station state change, this will cause mac80211 to abandon * attempts to connect to this AP, and eventually wpa_s will * blacklist the AP... */ if (vif->type == NL80211_IFTYPE_STATION && vif->bss_conf.beacon_int < 16) { IWL_ERR(mvm, "AP %pM beacon interval is %d, refusing due to firmware bug!\n", sta->addr, vif->bss_conf.beacon_int); ret = -EINVAL; goto out_unlock; } if (sta->tdls && (vif->p2p || iwl_mvm_tdls_sta_count(mvm, NULL) == IWL_MVM_TDLS_STA_COUNT || iwl_mvm_phy_ctx_count(mvm) > 1)) { IWL_DEBUG_MAC80211(mvm, "refusing TDLS sta\n"); ret = -EBUSY; goto out_unlock; } ret = iwl_mvm_add_sta(mvm, vif, sta); if (sta->tdls && ret == 0) { iwl_mvm_recalc_tdls_state(mvm, vif, true); iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, NL80211_TDLS_SETUP); } } else if (old_state == IEEE80211_STA_NONE && new_state == IEEE80211_STA_AUTH) { /* * EBS may be disabled due to previous failures reported by FW. * Reset EBS status here assuming environment has been changed. */ mvm->last_ebs_successful = true; iwl_mvm_check_uapsd(mvm, vif, sta->addr); ret = 0; } else if (old_state == IEEE80211_STA_AUTH && new_state == IEEE80211_STA_ASSOC) { if (vif->type == NL80211_IFTYPE_AP) { mvmvif->ap_assoc_sta_count++; iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); } iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, false); ret = iwl_mvm_update_sta(mvm, vif, sta); } else if (old_state == IEEE80211_STA_ASSOC && new_state == IEEE80211_STA_AUTHORIZED) { /* we don't support TDLS during DCM */ if (iwl_mvm_phy_ctx_count(mvm) > 1) iwl_mvm_teardown_tdls_peers(mvm); if (sta->tdls) iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, NL80211_TDLS_ENABLE_LINK); /* enable beacon filtering */ WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); iwl_mvm_rs_rate_init(mvm, sta, mvmvif->phy_ctxt->channel->band, true); /* if wep is used, need to set the key for the station now */ if (vif->type == NL80211_IFTYPE_AP && mvmvif->ap_wep_key) ret = iwl_mvm_set_sta_key(mvm, vif, sta, mvmvif->ap_wep_key, STA_KEY_IDX_INVALID); else ret = 0; } else if (old_state == IEEE80211_STA_AUTHORIZED && new_state == IEEE80211_STA_ASSOC) { /* disable beacon filtering */ WARN_ON(iwl_mvm_disable_beacon_filter(mvm, vif, 0)); ret = 0; } else if (old_state == IEEE80211_STA_ASSOC && new_state == IEEE80211_STA_AUTH) { if (vif->type == NL80211_IFTYPE_AP) { mvmvif->ap_assoc_sta_count--; iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); } ret = 0; } else if (old_state == IEEE80211_STA_AUTH && new_state == IEEE80211_STA_NONE) { ret = 0; } else if (old_state == IEEE80211_STA_NONE && new_state == IEEE80211_STA_NOTEXIST) { ret = iwl_mvm_rm_sta(mvm, vif, sta); if (sta->tdls) { iwl_mvm_recalc_tdls_state(mvm, vif, false); iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, NL80211_TDLS_DISABLE_LINK); } } else { ret = -EIO; } out_unlock: mutex_unlock(&mvm->mutex); if (sta->tdls && ret == 0) { if (old_state == IEEE80211_STA_NOTEXIST && new_state == IEEE80211_STA_NONE) ieee80211_reserve_tid(sta, IWL_MVM_TDLS_FW_TID); else if (old_state == IEEE80211_STA_NONE && new_state == IEEE80211_STA_NOTEXIST) ieee80211_unreserve_tid(sta, IWL_MVM_TDLS_FW_TID); } return ret; } static int iwl_mvm_mac_set_rts_threshold(struct ieee80211_hw *hw, u32 value) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); mvm->rts_threshold = value; return 0; } static void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, u32 changed) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); if (vif->type == NL80211_IFTYPE_STATION && changed & IEEE80211_RC_NSS_CHANGED) iwl_mvm_sf_update(mvm, vif, false); } static int iwl_mvm_mac_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 ac, const struct ieee80211_tx_queue_params *params) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); mvmvif->queue_params[ac] = *params; /* * No need to update right away, we'll get BSS_CHANGED_QOS * The exception is P2P_DEVICE interface which needs immediate update. */ if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { int ret; mutex_lock(&mvm->mutex); ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); mutex_unlock(&mvm->mutex); return ret; } return 0; } static void iwl_mvm_mac_mgd_prepare_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 req_duration) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); u32 duration = IWL_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; u32 min_duration = IWL_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS; /* * iwl_mvm_protect_session() reads directly from the device * (the system time), so make sure it is available. */ if (iwl_mvm_ref_sync(mvm, IWL_MVM_REF_PREPARE_TX)) return; if (req_duration > duration) duration = req_duration; mutex_lock(&mvm->mutex); /* Try really hard to protect the session and hear a beacon */ iwl_mvm_protect_session(mvm, vif, duration, min_duration, 500, false); mutex_unlock(&mvm->mutex); iwl_mvm_unref(mvm, IWL_MVM_REF_PREPARE_TX); } static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_sched_scan_request *req, struct ieee80211_scan_ies *ies) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; mutex_lock(&mvm->mutex); if (!vif->bss_conf.idle) { ret = -EBUSY; goto out; } ret = iwl_mvm_sched_scan_start(mvm, vif, req, ies, IWL_MVM_SCAN_SCHED); out: mutex_unlock(&mvm->mutex); return ret; } static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; mutex_lock(&mvm->mutex); /* Due to a race condition, it's possible that mac80211 asks * us to stop a sched_scan when it's already stopped. This * can happen, for instance, if we stopped the scan ourselves, * called ieee80211_sched_scan_stopped() and the userspace called * stop sched scan scan before ieee80211_sched_scan_stopped_work() * could run. To handle this, simply return if the scan is * not running. */ if (!(mvm->scan_status & IWL_MVM_SCAN_SCHED)) { mutex_unlock(&mvm->mutex); return 0; } ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_SCHED, false); mutex_unlock(&mvm->mutex); iwl_mvm_wait_for_async_handlers(mvm); return ret; } static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct ieee80211_key_conf *key) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_sta *mvmsta; struct iwl_mvm_key_pn *ptk_pn; int keyidx = key->keyidx; int ret; u8 key_offset; if (iwlwifi_mod_params.swcrypto) { IWL_DEBUG_MAC80211(mvm, "leave - hwcrypto disabled\n"); return -EOPNOTSUPP; } switch (key->cipher) { case WLAN_CIPHER_SUITE_TKIP: if (!mvm->trans->cfg->gen2) { key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE; } else if (vif->type == NL80211_IFTYPE_STATION) { key->flags |= IEEE80211_KEY_FLAG_PUT_MIC_SPACE; } else { IWL_DEBUG_MAC80211(mvm, "Use SW encryption for TKIP\n"); return -EOPNOTSUPP; } break; case WLAN_CIPHER_SUITE_CCMP: case WLAN_CIPHER_SUITE_GCMP: case WLAN_CIPHER_SUITE_GCMP_256: if (!iwl_mvm_has_new_tx_api(mvm)) key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE; break; case WLAN_CIPHER_SUITE_AES_CMAC: case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: WARN_ON_ONCE(!ieee80211_hw_check(hw, MFP_CAPABLE)); break; case WLAN_CIPHER_SUITE_WEP40: case WLAN_CIPHER_SUITE_WEP104: if (vif->type == NL80211_IFTYPE_AP) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); mvmvif->ap_wep_key = kmemdup(key, sizeof(*key) + key->keylen, GFP_KERNEL); if (!mvmvif->ap_wep_key) return -ENOMEM; } if (vif->type != NL80211_IFTYPE_STATION) return 0; break; default: /* currently FW supports only one optional cipher scheme */ if (hw->n_cipher_schemes && hw->cipher_schemes->cipher == key->cipher) key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE; else return -EOPNOTSUPP; } mutex_lock(&mvm->mutex); switch (cmd) { case SET_KEY: if ((vif->type == NL80211_IFTYPE_ADHOC || vif->type == NL80211_IFTYPE_AP) && !sta) { /* * GTK on AP interface is a TX-only key, return 0; * on IBSS they're per-station and because we're lazy * we don't support them for RX, so do the same. * CMAC/GMAC in AP/IBSS modes must be done in software. */ if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC || key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) ret = -EOPNOTSUPP; else ret = 0; if (key->cipher != WLAN_CIPHER_SUITE_GCMP && key->cipher != WLAN_CIPHER_SUITE_GCMP_256 && !iwl_mvm_has_new_tx_api(mvm)) { key->hw_key_idx = STA_KEY_IDX_INVALID; break; } } /* During FW restart, in order to restore the state as it was, * don't try to reprogram keys we previously failed for. */ if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && key->hw_key_idx == STA_KEY_IDX_INVALID) { IWL_DEBUG_MAC80211(mvm, "skip invalid idx key programming during restart\n"); ret = 0; break; } if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && sta && iwl_mvm_has_new_rx_api(mvm) && key->flags & IEEE80211_KEY_FLAG_PAIRWISE && (key->cipher == WLAN_CIPHER_SUITE_CCMP || key->cipher == WLAN_CIPHER_SUITE_GCMP || key->cipher == WLAN_CIPHER_SUITE_GCMP_256)) { struct ieee80211_key_seq seq; int tid, q; mvmsta = iwl_mvm_sta_from_mac80211(sta); WARN_ON(rcu_access_pointer(mvmsta->ptk_pn[keyidx])); ptk_pn = kzalloc(struct_size(ptk_pn, q, mvm->trans->num_rx_queues), GFP_KERNEL); if (!ptk_pn) { ret = -ENOMEM; break; } for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++) { ieee80211_get_key_rx_seq(key, tid, &seq); for (q = 0; q < mvm->trans->num_rx_queues; q++) memcpy(ptk_pn->q[q].pn[tid], seq.ccmp.pn, IEEE80211_CCMP_PN_LEN); } rcu_assign_pointer(mvmsta->ptk_pn[keyidx], ptk_pn); } /* in HW restart reuse the index, otherwise request a new one */ if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) key_offset = key->hw_key_idx; else key_offset = STA_KEY_IDX_INVALID; IWL_DEBUG_MAC80211(mvm, "set hwcrypto key\n"); ret = iwl_mvm_set_sta_key(mvm, vif, sta, key, key_offset); if (ret) { IWL_WARN(mvm, "set key failed\n"); /* * can't add key for RX, but we don't need it * in the device for TX so still return 0 */ key->hw_key_idx = STA_KEY_IDX_INVALID; ret = 0; } break; case DISABLE_KEY: if (key->hw_key_idx == STA_KEY_IDX_INVALID) { ret = 0; break; } if (sta && iwl_mvm_has_new_rx_api(mvm) && key->flags & IEEE80211_KEY_FLAG_PAIRWISE && (key->cipher == WLAN_CIPHER_SUITE_CCMP || key->cipher == WLAN_CIPHER_SUITE_GCMP || key->cipher == WLAN_CIPHER_SUITE_GCMP_256)) { mvmsta = iwl_mvm_sta_from_mac80211(sta); ptk_pn = rcu_dereference_protected( mvmsta->ptk_pn[keyidx], lockdep_is_held(&mvm->mutex)); RCU_INIT_POINTER(mvmsta->ptk_pn[keyidx], NULL); if (ptk_pn) kfree_rcu(ptk_pn, rcu_head); } IWL_DEBUG_MAC80211(mvm, "disable hwcrypto key\n"); ret = iwl_mvm_remove_sta_key(mvm, vif, sta, key); break; default: ret = -EINVAL; } mutex_unlock(&mvm->mutex); return ret; } static void iwl_mvm_mac_update_tkip_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_key_conf *keyconf, struct ieee80211_sta *sta, u32 iv32, u16 *phase1key) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); if (keyconf->hw_key_idx == STA_KEY_IDX_INVALID) return; iwl_mvm_update_tkip_key(mvm, vif, keyconf, sta, iv32, phase1key); } static bool iwl_mvm_rx_aux_roc(struct iwl_notif_wait_data *notif_wait, struct iwl_rx_packet *pkt, void *data) { struct iwl_mvm *mvm = container_of(notif_wait, struct iwl_mvm, notif_wait); struct iwl_hs20_roc_res *resp; int resp_len = iwl_rx_packet_payload_len(pkt); struct iwl_mvm_time_event_data *te_data = data; if (WARN_ON(pkt->hdr.cmd != HOT_SPOT_CMD)) return true; if (WARN_ON_ONCE(resp_len != sizeof(*resp))) { IWL_ERR(mvm, "Invalid HOT_SPOT_CMD response\n"); return true; } resp = (void *)pkt->data; IWL_DEBUG_TE(mvm, "Aux ROC: Recieved response from ucode: status=%d uid=%d\n", resp->status, resp->event_unique_id); te_data->uid = le32_to_cpu(resp->event_unique_id); IWL_DEBUG_TE(mvm, "TIME_EVENT_CMD response - UID = 0x%x\n", te_data->uid); spin_lock_bh(&mvm->time_event_lock); list_add_tail(&te_data->list, &mvm->aux_roc_te_list); spin_unlock_bh(&mvm->time_event_lock); return true; } #define AUX_ROC_MIN_DURATION MSEC_TO_TU(100) #define AUX_ROC_MIN_DELAY MSEC_TO_TU(200) #define AUX_ROC_MAX_DELAY MSEC_TO_TU(600) #define AUX_ROC_SAFETY_BUFFER MSEC_TO_TU(20) #define AUX_ROC_MIN_SAFETY_BUFFER MSEC_TO_TU(10) static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm, struct ieee80211_channel *channel, struct ieee80211_vif *vif, int duration) { int res, time_reg = DEVICE_SYSTEM_TIME_REG; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_time_event_data *te_data = &mvmvif->hs_time_event_data; static const u16 time_event_response[] = { HOT_SPOT_CMD }; struct iwl_notification_wait wait_time_event; u32 dtim_interval = vif->bss_conf.dtim_period * vif->bss_conf.beacon_int; u32 req_dur, delay; struct iwl_hs20_roc_req aux_roc_req = { .action = cpu_to_le32(FW_CTXT_ACTION_ADD), .id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(MAC_INDEX_AUX, 0)), .sta_id_and_color = cpu_to_le32(mvm->aux_sta.sta_id), /* Set the channel info data */ .channel_info.band = (channel->band == NL80211_BAND_2GHZ) ? PHY_BAND_24 : PHY_BAND_5, .channel_info.channel = channel->hw_value, .channel_info.width = PHY_VHT_CHANNEL_MODE20, /* Set the time and duration */ .apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)), }; delay = AUX_ROC_MIN_DELAY; req_dur = MSEC_TO_TU(duration); /* * If we are associated we want the delay time to be at least one * dtim interval so that the FW can wait until after the DTIM and * then start the time event, this will potentially allow us to * remain off-channel for the max duration. * Since we want to use almost a whole dtim interval we would also * like the delay to be for 2-3 dtim intervals, in case there are * other time events with higher priority. */ if (vif->bss_conf.assoc) { delay = min_t(u32, dtim_interval * 3, AUX_ROC_MAX_DELAY); /* We cannot remain off-channel longer than the DTIM interval */ if (dtim_interval <= req_dur) { req_dur = dtim_interval - AUX_ROC_SAFETY_BUFFER; if (req_dur <= AUX_ROC_MIN_DURATION) req_dur = dtim_interval - AUX_ROC_MIN_SAFETY_BUFFER; } } aux_roc_req.duration = cpu_to_le32(req_dur); aux_roc_req.apply_time_max_delay = cpu_to_le32(delay); IWL_DEBUG_TE(mvm, "ROC: Requesting to remain on channel %u for %ums (requested = %ums, max_delay = %ums, dtim_interval = %ums)\n", channel->hw_value, req_dur, duration, delay, dtim_interval); /* Set the node address */ memcpy(aux_roc_req.node_addr, vif->addr, ETH_ALEN); lockdep_assert_held(&mvm->mutex); spin_lock_bh(&mvm->time_event_lock); if (WARN_ON(te_data->id == HOT_SPOT_CMD)) { spin_unlock_bh(&mvm->time_event_lock); return -EIO; } te_data->vif = vif; te_data->duration = duration; te_data->id = HOT_SPOT_CMD; spin_unlock_bh(&mvm->time_event_lock); /* * Use a notification wait, which really just processes the * command response and doesn't wait for anything, in order * to be able to process the response and get the UID inside * the RX path. Using CMD_WANT_SKB doesn't work because it * stores the buffer and then wakes up this thread, by which * time another notification (that the time event started) * might already be processed unsuccessfully. */ iwl_init_notification_wait(&mvm->notif_wait, &wait_time_event, time_event_response, ARRAY_SIZE(time_event_response), iwl_mvm_rx_aux_roc, te_data); res = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, sizeof(aux_roc_req), &aux_roc_req); if (res) { IWL_ERR(mvm, "Couldn't send HOT_SPOT_CMD: %d\n", res); iwl_remove_notification(&mvm->notif_wait, &wait_time_event); goto out_clear_te; } /* No need to wait for anything, so just pass 1 (0 isn't valid) */ res = iwl_wait_notification(&mvm->notif_wait, &wait_time_event, 1); /* should never fail */ WARN_ON_ONCE(res); if (res) { out_clear_te: spin_lock_bh(&mvm->time_event_lock); iwl_mvm_te_clear_data(mvm, te_data); spin_unlock_bh(&mvm->time_event_lock); } return res; } static int iwl_mvm_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel *channel, int duration, enum ieee80211_roc_type type) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct cfg80211_chan_def chandef; struct iwl_mvm_phy_ctxt *phy_ctxt; int ret, i; IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, duration, type); /* * Flush the done work, just in case it's still pending, so that * the work it does can complete and we can accept new frames. */ flush_work(&mvm->roc_done_wk); mutex_lock(&mvm->mutex); switch (vif->type) { case NL80211_IFTYPE_STATION: if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT)) { /* Use aux roc framework (HS20) */ ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, vif, duration); goto out_unlock; } IWL_ERR(mvm, "hotspot not supported\n"); ret = -EINVAL; goto out_unlock; case NL80211_IFTYPE_P2P_DEVICE: /* handle below */ break; default: IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); ret = -EINVAL; goto out_unlock; } for (i = 0; i < NUM_PHY_CTX; i++) { phy_ctxt = &mvm->phy_ctxts[i]; if (phy_ctxt->ref == 0 || mvmvif->phy_ctxt == phy_ctxt) continue; if (phy_ctxt->ref && channel == phy_ctxt->channel) { /* * Unbind the P2P_DEVICE from the current PHY context, * and if the PHY context is not used remove it. */ ret = iwl_mvm_binding_remove_vif(mvm, vif); if (WARN(ret, "Failed unbinding P2P_DEVICE\n")) goto out_unlock; iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); /* Bind the P2P_DEVICE to the current PHY Context */ mvmvif->phy_ctxt = phy_ctxt; ret = iwl_mvm_binding_add_vif(mvm, vif); if (WARN(ret, "Failed binding P2P_DEVICE\n")) goto out_unlock; iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); goto schedule_time_event; } } /* Need to update the PHY context only if the ROC channel changed */ if (channel == mvmvif->phy_ctxt->channel) goto schedule_time_event; cfg80211_chandef_create(&chandef, channel, NL80211_CHAN_NO_HT); /* * Change the PHY context configuration as it is currently referenced * only by the P2P Device MAC */ if (mvmvif->phy_ctxt->ref == 1) { ret = iwl_mvm_phy_ctxt_changed(mvm, mvmvif->phy_ctxt, &chandef, 1, 1); if (ret) goto out_unlock; } else { /* * The PHY context is shared with other MACs. Need to remove the * P2P Device from the binding, allocate an new PHY context and * create a new binding */ phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); if (!phy_ctxt) { ret = -ENOSPC; goto out_unlock; } ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &chandef, 1, 1); if (ret) { IWL_ERR(mvm, "Failed to change PHY context\n"); goto out_unlock; } /* Unbind the P2P_DEVICE from the current PHY context */ ret = iwl_mvm_binding_remove_vif(mvm, vif); if (WARN(ret, "Failed unbinding P2P_DEVICE\n")) goto out_unlock; iwl_mvm_phy_ctxt_unref(mvm, mvmvif->phy_ctxt); /* Bind the P2P_DEVICE to the new allocated PHY context */ mvmvif->phy_ctxt = phy_ctxt; ret = iwl_mvm_binding_add_vif(mvm, vif); if (WARN(ret, "Failed binding P2P_DEVICE\n")) goto out_unlock; iwl_mvm_phy_ctxt_ref(mvm, mvmvif->phy_ctxt); } schedule_time_event: /* Schedule the time events */ ret = iwl_mvm_start_p2p_roc(mvm, vif, duration, type); out_unlock: mutex_unlock(&mvm->mutex); IWL_DEBUG_MAC80211(mvm, "leave\n"); return ret; } static int iwl_mvm_cancel_roc(struct ieee80211_hw *hw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); IWL_DEBUG_MAC80211(mvm, "enter\n"); mutex_lock(&mvm->mutex); iwl_mvm_stop_roc(mvm); mutex_unlock(&mvm->mutex); IWL_DEBUG_MAC80211(mvm, "leave\n"); return 0; } static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx) { u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; struct iwl_mvm_phy_ctxt *phy_ctxt; int ret; lockdep_assert_held(&mvm->mutex); IWL_DEBUG_MAC80211(mvm, "Add channel context\n"); phy_ctxt = iwl_mvm_get_free_phy_ctxt(mvm); if (!phy_ctxt) { ret = -ENOSPC; goto out; } ret = iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, ctx->rx_chains_static, ctx->rx_chains_dynamic); if (ret) { IWL_ERR(mvm, "Failed to add PHY context\n"); goto out; } iwl_mvm_phy_ctxt_ref(mvm, phy_ctxt); *phy_ctxt_id = phy_ctxt->id; out: return ret; } static int iwl_mvm_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *ctx) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; mutex_lock(&mvm->mutex); ret = __iwl_mvm_add_chanctx(mvm, ctx); mutex_unlock(&mvm->mutex); return ret; } static void __iwl_mvm_remove_chanctx(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx) { u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; lockdep_assert_held(&mvm->mutex); iwl_mvm_phy_ctxt_unref(mvm, phy_ctxt); } static void iwl_mvm_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *ctx) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); mutex_lock(&mvm->mutex); __iwl_mvm_remove_chanctx(mvm, ctx); mutex_unlock(&mvm->mutex); } static void iwl_mvm_change_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *ctx, u32 changed) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; if (WARN_ONCE((phy_ctxt->ref > 1) && (changed & ~(IEEE80211_CHANCTX_CHANGE_WIDTH | IEEE80211_CHANCTX_CHANGE_RX_CHAINS | IEEE80211_CHANCTX_CHANGE_RADAR | IEEE80211_CHANCTX_CHANGE_MIN_WIDTH)), "Cannot change PHY. Ref=%d, changed=0x%X\n", phy_ctxt->ref, changed)) return; mutex_lock(&mvm->mutex); /* we are only changing the min_width, may be a noop */ if (changed == IEEE80211_CHANCTX_CHANGE_MIN_WIDTH) { if (phy_ctxt->width == ctx->min_def.width) goto out_unlock; /* we are just toggling between 20_NOHT and 20 */ if (phy_ctxt->width <= NL80211_CHAN_WIDTH_20 && ctx->min_def.width <= NL80211_CHAN_WIDTH_20) goto out_unlock; } iwl_mvm_bt_coex_vif_change(mvm); iwl_mvm_phy_ctxt_changed(mvm, phy_ctxt, &ctx->min_def, ctx->rx_chains_static, ctx->rx_chains_dynamic); out_unlock: mutex_unlock(&mvm->mutex); } static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *ctx, bool switching_chanctx) { u16 *phy_ctxt_id = (u16 *)ctx->drv_priv; struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id]; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); int ret; lockdep_assert_held(&mvm->mutex); mvmvif->phy_ctxt = phy_ctxt; switch (vif->type) { case NL80211_IFTYPE_AP: /* only needed if we're switching chanctx (i.e. during CSA) */ if (switching_chanctx) { mvmvif->ap_ibss_active = true; break; } case NL80211_IFTYPE_ADHOC: /* * The AP binding flow is handled as part of the start_ap flow * (in bss_info_changed), similarly for IBSS. */ ret = 0; goto out; case NL80211_IFTYPE_STATION: mvmvif->csa_bcn_pending = false; break; case NL80211_IFTYPE_MONITOR: /* always disable PS when a monitor interface is active */ mvmvif->ps_disabled = true; break; default: ret = -EINVAL; goto out; } ret = iwl_mvm_binding_add_vif(mvm, vif); if (ret) goto out; /* * Power state must be updated before quotas, * otherwise fw will complain. */ iwl_mvm_power_update_mac(mvm); /* Setting the quota at this stage is only required for monitor * interfaces. For the other types, the bss_info changed flow * will handle quota settings. */ if (vif->type == NL80211_IFTYPE_MONITOR) { mvmvif->monitor_active = true; ret = iwl_mvm_update_quotas(mvm, false, NULL); if (ret) goto out_remove_binding; ret = iwl_mvm_add_snif_sta(mvm, vif); if (ret) goto out_remove_binding; } /* Handle binding during CSA */ if (vif->type == NL80211_IFTYPE_AP) { iwl_mvm_update_quotas(mvm, false, NULL); iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); } if (switching_chanctx && vif->type == NL80211_IFTYPE_STATION) { u32 duration = 3 * vif->bss_conf.beacon_int; /* iwl_mvm_protect_session() reads directly from the * device (the system time), so make sure it is * available. */ ret = iwl_mvm_ref_sync(mvm, IWL_MVM_REF_PROTECT_CSA); if (ret) goto out_remove_binding; /* Protect the session to make sure we hear the first * beacon on the new channel. */ mvmvif->csa_bcn_pending = true; iwl_mvm_protect_session(mvm, vif, duration, duration, vif->bss_conf.beacon_int / 2, true); iwl_mvm_unref(mvm, IWL_MVM_REF_PROTECT_CSA); iwl_mvm_update_quotas(mvm, false, NULL); } goto out; out_remove_binding: iwl_mvm_binding_remove_vif(mvm, vif); iwl_mvm_power_update_mac(mvm); out: if (ret) mvmvif->phy_ctxt = NULL; return ret; } static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *ctx) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; mutex_lock(&mvm->mutex); ret = __iwl_mvm_assign_vif_chanctx(mvm, vif, ctx, false); mutex_unlock(&mvm->mutex); return ret; } static void __iwl_mvm_unassign_vif_chanctx(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *ctx, bool switching_chanctx) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct ieee80211_vif *disabled_vif = NULL; lockdep_assert_held(&mvm->mutex); iwl_mvm_remove_time_event(mvm, mvmvif, &mvmvif->time_event_data); switch (vif->type) { case NL80211_IFTYPE_ADHOC: goto out; case NL80211_IFTYPE_MONITOR: mvmvif->monitor_active = false; mvmvif->ps_disabled = false; iwl_mvm_rm_snif_sta(mvm, vif); break; case NL80211_IFTYPE_AP: /* This part is triggered only during CSA */ if (!switching_chanctx || !mvmvif->ap_ibss_active) goto out; mvmvif->csa_countdown = false; /* Set CS bit on all the stations */ iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, true); /* Save blocked iface, the timeout is set on the next beacon */ rcu_assign_pointer(mvm->csa_tx_blocked_vif, vif); mvmvif->ap_ibss_active = false; break; case NL80211_IFTYPE_STATION: if (!switching_chanctx) break; disabled_vif = vif; iwl_mvm_mac_ctxt_changed(mvm, vif, true, NULL); break; default: break; } iwl_mvm_update_quotas(mvm, false, disabled_vif); iwl_mvm_binding_remove_vif(mvm, vif); out: mvmvif->phy_ctxt = NULL; iwl_mvm_power_update_mac(mvm); } static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_chanctx_conf *ctx) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); mutex_lock(&mvm->mutex); __iwl_mvm_unassign_vif_chanctx(mvm, vif, ctx, false); mutex_unlock(&mvm->mutex); } static int iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm, struct ieee80211_vif_chanctx_switch *vifs) { int ret; mutex_lock(&mvm->mutex); __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); __iwl_mvm_remove_chanctx(mvm, vifs[0].old_ctx); ret = __iwl_mvm_add_chanctx(mvm, vifs[0].new_ctx); if (ret) { IWL_ERR(mvm, "failed to add new_ctx during channel switch\n"); goto out_reassign; } ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, true); if (ret) { IWL_ERR(mvm, "failed to assign new_ctx during channel switch\n"); goto out_remove; } /* we don't support TDLS during DCM - can be caused by channel switch */ if (iwl_mvm_phy_ctx_count(mvm) > 1) iwl_mvm_teardown_tdls_peers(mvm); goto out; out_remove: __iwl_mvm_remove_chanctx(mvm, vifs[0].new_ctx); out_reassign: if (__iwl_mvm_add_chanctx(mvm, vifs[0].old_ctx)) { IWL_ERR(mvm, "failed to add old_ctx back after failure.\n"); goto out_restart; } if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true)) { IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); goto out_restart; } goto out; out_restart: /* things keep failing, better restart the hw */ iwl_mvm_nic_restart(mvm, false); out: mutex_unlock(&mvm->mutex); return ret; } static int iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm, struct ieee80211_vif_chanctx_switch *vifs) { int ret; mutex_lock(&mvm->mutex); __iwl_mvm_unassign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true); ret = __iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].new_ctx, true); if (ret) { IWL_ERR(mvm, "failed to assign new_ctx during channel switch\n"); goto out_reassign; } goto out; out_reassign: if (__iwl_mvm_assign_vif_chanctx(mvm, vifs[0].vif, vifs[0].old_ctx, true)) { IWL_ERR(mvm, "failed to reassign old_ctx after failure.\n"); goto out_restart; } goto out; out_restart: /* things keep failing, better restart the hw */ iwl_mvm_nic_restart(mvm, false); out: mutex_unlock(&mvm->mutex); return ret; } static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, enum ieee80211_chanctx_switch_mode mode) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; /* we only support a single-vif right now */ if (n_vifs > 1) return -EOPNOTSUPP; switch (mode) { case CHANCTX_SWMODE_SWAP_CONTEXTS: ret = iwl_mvm_switch_vif_chanctx_swap(mvm, vifs); break; case CHANCTX_SWMODE_REASSIGN_VIF: ret = iwl_mvm_switch_vif_chanctx_reassign(mvm, vifs); break; default: ret = -EOPNOTSUPP; break; } return ret; } static int iwl_mvm_tx_last_beacon(struct ieee80211_hw *hw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); return mvm->ibss_manager; } static int iwl_mvm_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); if (!mvm_sta || !mvm_sta->vif) { IWL_ERR(mvm, "Station is not associated to a vif\n"); return -EINVAL; } return iwl_mvm_mac_ctxt_beacon_changed(mvm, mvm_sta->vif); } #ifdef CONFIG_NL80211_TESTMODE static const struct nla_policy iwl_mvm_tm_policy[IWL_MVM_TM_ATTR_MAX + 1] = { [IWL_MVM_TM_ATTR_CMD] = { .type = NLA_U32 }, [IWL_MVM_TM_ATTR_NOA_DURATION] = { .type = NLA_U32 }, [IWL_MVM_TM_ATTR_BEACON_FILTER_STATE] = { .type = NLA_U32 }, }; static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, void *data, int len) { struct nlattr *tb[IWL_MVM_TM_ATTR_MAX + 1]; int err; u32 noa_duration; err = nla_parse(tb, IWL_MVM_TM_ATTR_MAX, data, len, iwl_mvm_tm_policy, NULL); if (err) return err; if (!tb[IWL_MVM_TM_ATTR_CMD]) return -EINVAL; switch (nla_get_u32(tb[IWL_MVM_TM_ATTR_CMD])) { case IWL_MVM_TM_CMD_SET_NOA: if (!vif || vif->type != NL80211_IFTYPE_AP || !vif->p2p || !vif->bss_conf.enable_beacon || !tb[IWL_MVM_TM_ATTR_NOA_DURATION]) return -EINVAL; noa_duration = nla_get_u32(tb[IWL_MVM_TM_ATTR_NOA_DURATION]); if (noa_duration >= vif->bss_conf.beacon_int) return -EINVAL; mvm->noa_duration = noa_duration; mvm->noa_vif = vif; return iwl_mvm_update_quotas(mvm, true, NULL); case IWL_MVM_TM_CMD_SET_BEACON_FILTER: /* must be associated client vif - ignore authorized */ if (!vif || vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc || !vif->bss_conf.dtim_period || !tb[IWL_MVM_TM_ATTR_BEACON_FILTER_STATE]) return -EINVAL; if (nla_get_u32(tb[IWL_MVM_TM_ATTR_BEACON_FILTER_STATE])) return iwl_mvm_enable_beacon_filter(mvm, vif, 0); return iwl_mvm_disable_beacon_filter(mvm, vif, 0); } return -EOPNOTSUPP; } static int iwl_mvm_mac_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void *data, int len) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int err; mutex_lock(&mvm->mutex); err = __iwl_mvm_mac_testmode_cmd(mvm, vif, data, len); mutex_unlock(&mvm->mutex); return err; } #endif static void iwl_mvm_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel_switch *chsw) { /* By implementing this operation, we prevent mac80211 from * starting its own channel switch timer, so that we can call * ieee80211_chswitch_done() ourselves at the right time * (which is when the absence time event starts). */ IWL_DEBUG_MAC80211(IWL_MAC80211_GET_MVM(hw), "dummy channel switch op\n"); } static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel_switch *chsw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct ieee80211_vif *csa_vif; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); u32 apply_time; int ret; mutex_lock(&mvm->mutex); mvmvif->csa_failed = false; IWL_DEBUG_MAC80211(mvm, "pre CSA to freq %d\n", chsw->chandef.center_freq1); iwl_fw_dbg_trigger_simple_stop(&mvm->fwrt, ieee80211_vif_to_wdev(vif), FW_DBG_TRIGGER_CHANNEL_SWITCH); switch (vif->type) { case NL80211_IFTYPE_AP: csa_vif = rcu_dereference_protected(mvm->csa_vif, lockdep_is_held(&mvm->mutex)); if (WARN_ONCE(csa_vif && csa_vif->csa_active, "Another CSA is already in progress")) { ret = -EBUSY; goto out_unlock; } /* we still didn't unblock tx. prevent new CS meanwhile */ if (rcu_dereference_protected(mvm->csa_tx_blocked_vif, lockdep_is_held(&mvm->mutex))) { ret = -EBUSY; goto out_unlock; } rcu_assign_pointer(mvm->csa_vif, vif); if (WARN_ONCE(mvmvif->csa_countdown, "Previous CSA countdown didn't complete")) { ret = -EBUSY; goto out_unlock; } mvmvif->csa_target_freq = chsw->chandef.chan->center_freq; break; case NL80211_IFTYPE_STATION: /* Schedule the time event to a bit before beacon 1, * to make sure we're in the new channel when the * GO/AP arrives. In case count <= 1 immediately schedule the * TE (this might result with some packet loss or connection * loss). */ if (chsw->count <= 1) apply_time = 0; else apply_time = chsw->device_timestamp + ((vif->bss_conf.beacon_int * (chsw->count - 1) - IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT) * 1024); if (chsw->block_tx) iwl_mvm_csa_client_absent(mvm, vif); iwl_mvm_schedule_csa_period(mvm, vif, vif->bss_conf.beacon_int, apply_time); if (mvmvif->bf_data.bf_enabled) { ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); if (ret) goto out_unlock; } break; default: break; } mvmvif->ps_disabled = true; ret = iwl_mvm_power_update_ps(mvm); if (ret) goto out_unlock; /* we won't be on this channel any longer */ iwl_mvm_teardown_tdls_peers(mvm); out_unlock: mutex_unlock(&mvm->mutex); return ret; } static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; mutex_lock(&mvm->mutex); if (mvmvif->csa_failed) { mvmvif->csa_failed = false; ret = -EIO; goto out_unlock; } if (vif->type == NL80211_IFTYPE_STATION) { struct iwl_mvm_sta *mvmsta; mvmvif->csa_bcn_pending = false; mvmsta = iwl_mvm_sta_from_staid_protected(mvm, mvmvif->ap_sta_id); if (WARN_ON(!mvmsta)) { ret = -EIO; goto out_unlock; } iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); if (ret) goto out_unlock; iwl_mvm_stop_session_protection(mvm, vif); } mvmvif->ps_disabled = false; ret = iwl_mvm_power_update_ps(mvm); out_unlock: mutex_unlock(&mvm->mutex); return ret; } static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) { int i; if (!iwl_mvm_has_new_tx_api(mvm)) { if (drop) { mutex_lock(&mvm->mutex); iwl_mvm_flush_tx_path(mvm, iwl_mvm_flushable_queues(mvm) & queues, 0); mutex_unlock(&mvm->mutex); } else { iwl_trans_wait_tx_queues_empty(mvm->trans, queues); } return; } mutex_lock(&mvm->mutex); for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { struct ieee80211_sta *sta; sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], lockdep_is_held(&mvm->mutex)); if (IS_ERR_OR_NULL(sta)) continue; if (drop) iwl_mvm_flush_sta_tids(mvm, i, 0xFF, 0); else iwl_mvm_wait_sta_queues_empty(mvm, iwl_mvm_sta_from_mac80211(sta)); } mutex_unlock(&mvm->mutex); } static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif; struct iwl_mvm_sta *mvmsta; struct ieee80211_sta *sta; int i; u32 msk = 0; if (!vif) { iwl_mvm_flush_no_vif(mvm, queues, drop); return; } if (vif->type != NL80211_IFTYPE_STATION) return; /* Make sure we're done with the deferred traffic before flushing */ flush_work(&mvm->add_stream_wk); mutex_lock(&mvm->mutex); mvmvif = iwl_mvm_vif_from_mac80211(vif); /* flush the AP-station and all TDLS peers */ for (i = 0; i < ARRAY_SIZE(mvm->fw_id_to_mac_id); i++) { sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i], lockdep_is_held(&mvm->mutex)); if (IS_ERR_OR_NULL(sta)) continue; mvmsta = iwl_mvm_sta_from_mac80211(sta); if (mvmsta->vif != vif) continue; /* make sure only TDLS peers or the AP are flushed */ WARN_ON(i != mvmvif->ap_sta_id && !sta->tdls); if (drop) { if (iwl_mvm_flush_sta(mvm, mvmsta, false, 0)) IWL_ERR(mvm, "flush request fail\n"); } else { msk |= mvmsta->tfd_queue_msk; if (iwl_mvm_has_new_tx_api(mvm)) iwl_mvm_wait_sta_queues_empty(mvm, mvmsta); } } mutex_unlock(&mvm->mutex); /* this can take a while, and we may need/want other operations * to succeed while doing this, so do it without the mutex held */ if (!drop && !iwl_mvm_has_new_tx_api(mvm)) iwl_trans_wait_tx_queues_empty(mvm->trans, msk); } static int iwl_mvm_mac_get_survey(struct ieee80211_hw *hw, int idx, struct survey_info *survey) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); int ret; memset(survey, 0, sizeof(*survey)); /* only support global statistics right now */ if (idx != 0) return -ENOENT; if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS)) return -ENOENT; mutex_lock(&mvm->mutex); if (iwl_mvm_firmware_running(mvm)) { ret = iwl_mvm_request_statistics(mvm, false); if (ret) goto out; } survey->filled = SURVEY_INFO_TIME | SURVEY_INFO_TIME_RX | SURVEY_INFO_TIME_TX | SURVEY_INFO_TIME_SCAN; survey->time = mvm->accu_radio_stats.on_time_rf + mvm->radio_stats.on_time_rf; do_div(survey->time, USEC_PER_MSEC); survey->time_rx = mvm->accu_radio_stats.rx_time + mvm->radio_stats.rx_time; do_div(survey->time_rx, USEC_PER_MSEC); survey->time_tx = mvm->accu_radio_stats.tx_time + mvm->radio_stats.tx_time; do_div(survey->time_tx, USEC_PER_MSEC); survey->time_scan = mvm->accu_radio_stats.on_time_scan + mvm->radio_stats.on_time_scan; do_div(survey->time_scan, USEC_PER_MSEC); ret = 0; out: mutex_unlock(&mvm->mutex); return ret; } static void iwl_mvm_mac_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct station_info *sinfo) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); if (mvmsta->avg_energy) { sinfo->signal_avg = mvmsta->avg_energy; sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL_AVG); } if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS)) return; /* if beacon filtering isn't on mac80211 does it anyway */ if (!(vif->driver_flags & IEEE80211_VIF_BEACON_FILTER)) return; if (!vif->bss_conf.assoc) return; mutex_lock(&mvm->mutex); if (mvmvif->ap_sta_id != mvmsta->sta_id) goto unlock; if (iwl_mvm_request_statistics(mvm, false)) goto unlock; sinfo->rx_beacon = mvmvif->beacon_stats.num_beacons + mvmvif->beacon_stats.accu_num_beacons; sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_RX); if (mvmvif->beacon_stats.avg_signal) { /* firmware only reports a value after RXing a few beacons */ sinfo->rx_beacon_signal_avg = mvmvif->beacon_stats.avg_signal; sinfo->filled |= BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG); } unlock: mutex_unlock(&mvm->mutex); } static void iwl_mvm_event_mlme_callback(struct iwl_mvm *mvm, struct ieee80211_vif *vif, const struct ieee80211_event *event) { #define CHECK_MLME_TRIGGER(_cnt, _fmt...) \ do { \ if ((trig_mlme->_cnt) && --(trig_mlme->_cnt)) \ break; \ iwl_fw_dbg_collect_trig(&(mvm)->fwrt, trig, _fmt); \ } while (0) struct iwl_fw_dbg_trigger_tlv *trig; struct iwl_fw_dbg_trigger_mlme *trig_mlme; trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), FW_DBG_TRIGGER_MLME); if (!trig) return; trig_mlme = (void *)trig->data; if (event->u.mlme.data == ASSOC_EVENT) { if (event->u.mlme.status == MLME_DENIED) CHECK_MLME_TRIGGER(stop_assoc_denied, "DENIED ASSOC: reason %d", event->u.mlme.reason); else if (event->u.mlme.status == MLME_TIMEOUT) CHECK_MLME_TRIGGER(stop_assoc_timeout, "ASSOC TIMEOUT"); } else if (event->u.mlme.data == AUTH_EVENT) { if (event->u.mlme.status == MLME_DENIED) CHECK_MLME_TRIGGER(stop_auth_denied, "DENIED AUTH: reason %d", event->u.mlme.reason); else if (event->u.mlme.status == MLME_TIMEOUT) CHECK_MLME_TRIGGER(stop_auth_timeout, "AUTH TIMEOUT"); } else if (event->u.mlme.data == DEAUTH_RX_EVENT) { CHECK_MLME_TRIGGER(stop_rx_deauth, "DEAUTH RX %d", event->u.mlme.reason); } else if (event->u.mlme.data == DEAUTH_TX_EVENT) { CHECK_MLME_TRIGGER(stop_tx_deauth, "DEAUTH TX %d", event->u.mlme.reason); } #undef CHECK_MLME_TRIGGER } static void iwl_mvm_event_bar_rx_callback(struct iwl_mvm *mvm, struct ieee80211_vif *vif, const struct ieee80211_event *event) { struct iwl_fw_dbg_trigger_tlv *trig; struct iwl_fw_dbg_trigger_ba *ba_trig; trig = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), FW_DBG_TRIGGER_BA); if (!trig) return; ba_trig = (void *)trig->data; if (!(le16_to_cpu(ba_trig->rx_bar) & BIT(event->u.ba.tid))) return; iwl_fw_dbg_collect_trig(&mvm->fwrt, trig, "BAR received from %pM, tid %d, ssn %d", event->u.ba.sta->addr, event->u.ba.tid, event->u.ba.ssn); } static void iwl_mvm_mac_event_callback(struct ieee80211_hw *hw, struct ieee80211_vif *vif, const struct ieee80211_event *event) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); switch (event->type) { case MLME_EVENT: iwl_mvm_event_mlme_callback(mvm, vif, event); break; case BAR_RX_EVENT: iwl_mvm_event_bar_rx_callback(mvm, vif, event); break; case BA_FRAME_TIMEOUT: iwl_mvm_event_frame_timeout_callback(mvm, vif, event->u.ba.sta, event->u.ba.tid); break; default: break; } } void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm, struct iwl_mvm_internal_rxq_notif *notif, u32 size) { u32 qmask = BIT(mvm->trans->num_rx_queues) - 1; int ret; lockdep_assert_held(&mvm->mutex); if (!iwl_mvm_has_new_rx_api(mvm)) return; notif->cookie = mvm->queue_sync_cookie; if (notif->sync) atomic_set(&mvm->queue_sync_counter, mvm->trans->num_rx_queues); ret = iwl_mvm_notify_rx_queue(mvm, qmask, (u8 *)notif, size); if (ret) { IWL_ERR(mvm, "Failed to trigger RX queues sync (%d)\n", ret); goto out; } if (notif->sync) { ret = wait_event_timeout(mvm->rx_sync_waitq, atomic_read(&mvm->queue_sync_counter) == 0 || iwl_mvm_is_radio_killed(mvm), HZ); WARN_ON_ONCE(!ret && !iwl_mvm_is_radio_killed(mvm)); } out: atomic_set(&mvm->queue_sync_counter, 0); mvm->queue_sync_cookie++; } static void iwl_mvm_sync_rx_queues(struct ieee80211_hw *hw) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); struct iwl_mvm_internal_rxq_notif data = { .type = IWL_MVM_RXQ_EMPTY, .sync = 1, }; mutex_lock(&mvm->mutex); iwl_mvm_sync_rx_queues_internal(mvm, &data, sizeof(data)); mutex_unlock(&mvm->mutex); } const struct ieee80211_ops iwl_mvm_hw_ops = { .tx = iwl_mvm_mac_tx, .ampdu_action = iwl_mvm_mac_ampdu_action, .start = iwl_mvm_mac_start, .reconfig_complete = iwl_mvm_mac_reconfig_complete, .stop = iwl_mvm_mac_stop, .add_interface = iwl_mvm_mac_add_interface, .remove_interface = iwl_mvm_mac_remove_interface, .config = iwl_mvm_mac_config, .prepare_multicast = iwl_mvm_prepare_multicast, .configure_filter = iwl_mvm_configure_filter, .config_iface_filter = iwl_mvm_config_iface_filter, .bss_info_changed = iwl_mvm_bss_info_changed, .hw_scan = iwl_mvm_mac_hw_scan, .cancel_hw_scan = iwl_mvm_mac_cancel_hw_scan, .sta_pre_rcu_remove = iwl_mvm_sta_pre_rcu_remove, .sta_state = iwl_mvm_mac_sta_state, .sta_notify = iwl_mvm_mac_sta_notify, .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames, .release_buffered_frames = iwl_mvm_mac_release_buffered_frames, .set_rts_threshold = iwl_mvm_mac_set_rts_threshold, .sta_rc_update = iwl_mvm_sta_rc_update, .conf_tx = iwl_mvm_mac_conf_tx, .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover, .flush = iwl_mvm_mac_flush, .sched_scan_start = iwl_mvm_mac_sched_scan_start, .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, .set_key = iwl_mvm_mac_set_key, .update_tkip_key = iwl_mvm_mac_update_tkip_key, .remain_on_channel = iwl_mvm_roc, .cancel_remain_on_channel = iwl_mvm_cancel_roc, .add_chanctx = iwl_mvm_add_chanctx, .remove_chanctx = iwl_mvm_remove_chanctx, .change_chanctx = iwl_mvm_change_chanctx, .assign_vif_chanctx = iwl_mvm_assign_vif_chanctx, .unassign_vif_chanctx = iwl_mvm_unassign_vif_chanctx, .switch_vif_chanctx = iwl_mvm_switch_vif_chanctx, .start_ap = iwl_mvm_start_ap_ibss, .stop_ap = iwl_mvm_stop_ap_ibss, .join_ibss = iwl_mvm_start_ap_ibss, .leave_ibss = iwl_mvm_stop_ap_ibss, .tx_last_beacon = iwl_mvm_tx_last_beacon, .set_tim = iwl_mvm_set_tim, .channel_switch = iwl_mvm_channel_switch, .pre_channel_switch = iwl_mvm_pre_channel_switch, .post_channel_switch = iwl_mvm_post_channel_switch, .tdls_channel_switch = iwl_mvm_tdls_channel_switch, .tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch, .tdls_recv_channel_switch = iwl_mvm_tdls_recv_channel_switch, .event_callback = iwl_mvm_mac_event_callback, .sync_rx_queues = iwl_mvm_sync_rx_queues, CFG80211_TESTMODE_CMD(iwl_mvm_mac_testmode_cmd) #ifdef CONFIG_PM_SLEEP /* look at d3.c */ .suspend = iwl_mvm_suspend, .resume = iwl_mvm_resume, .set_wakeup = iwl_mvm_set_wakeup, .set_rekey_data = iwl_mvm_set_rekey_data, #if IS_ENABLED(CONFIG_IPV6) .ipv6_addr_change = iwl_mvm_ipv6_addr_change, #endif .set_default_unicast_key = iwl_mvm_set_default_unicast_key, #endif .get_survey = iwl_mvm_mac_get_survey, .sta_statistics = iwl_mvm_mac_sta_statistics, #ifdef CONFIG_IWLWIFI_DEBUGFS .sta_add_debugfs = iwl_mvm_sta_add_debugfs, #endif };
gpl-2.0
o11c/shiboken2
tests/libsample/abstract.h
2663
/* * This file is part of the Shiboken Python Binding Generator project. * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef ABSTRACT_H #define ABSTRACT_H #include "libsamplemacros.h" #include "point.h" #include "complex.h" class ObjectType; // this class is not exported to python class HideType { }; class LIBSAMPLE_API Abstract { private: enum PrivateEnum { PrivValue0, PrivValue1, PrivValue2 = PrivValue1 + 2 }; public: enum PrintFormat { Short, Verbose, OnlyId, ClassNameAndId, DummyItemToTestPrivateEnum1 = Abstract::PrivValue1, DummyItemToTestPrivateEnum2 = PrivValue2, }; enum Type { TpAbstract, TpDerived }; static const int staticPrimitiveField; int primitiveField; Complex userPrimitiveField; Point valueTypeField; ObjectType* objectTypeField; Abstract(int id = -1); virtual ~Abstract(); inline int id() { return m_id; } // factory method inline static Abstract* createObject() { return 0; } // method that receives an Object Type inline static int getObjectId(Abstract* obj) { return obj->id(); } virtual void pureVirtual() = 0; virtual void* pureVirtualReturningVoidPtr() = 0; virtual void unpureVirtual(); virtual PrintFormat returnAnEnum() = 0; void callVirtualGettingEnum(PrintFormat p); virtual void virtualGettingAEnum(PrintFormat p); void callPureVirtual(); void callUnpureVirtual(); void show(PrintFormat format = Verbose); virtual Type type() const { return TpAbstract; } virtual void hideFunction(HideType* arg) = 0; protected: virtual const char* className() { return "Abstract"; } // Protected bit-field structure member. unsigned int bitField: 1; private: int m_id; }; #endif // ABSTRACT_H
gpl-2.0
architech-backup/grub-fedora
netboot/misc.c
5334
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Based on "src/misc.c" in etherboot-5.0.5. */ #define GRUB 1 #include <etherboot.h> #include <stdarg.h> void sleep (int secs) { unsigned long tmo = currticks () + secs; while (currticks () < tmo) ; } void twiddle (void) { static unsigned long lastticks = 0; static int count = 0; static const char tiddles[]="-\\|/"; unsigned long ticks; if (debug) { if ((ticks = currticks ()) == lastticks) return; lastticks = ticks; grub_putchar (tiddles[(count++) & 3]); grub_putchar ('\b'); } } /* Because Etherboot uses its own formats for the printf family, define separate definitions from GRUB. */ /************************************************************************** PRINTF and friends Formats: %[#]x - 4 bytes long (8 hex digits, lower case) %[#]X - 4 bytes long (8 hex digits, upper case) %[#]hx - 2 bytes int (4 hex digits, lower case) %[#]hX - 2 bytes int (4 hex digits, upper case) %[#]hhx - 1 byte int (2 hex digits, lower case) %[#]hhX - 1 byte int (2 hex digits, upper case) - optional # prefixes 0x or 0X %d - decimal int %c - char %s - string %@ - Internet address in ddd.ddd.ddd.ddd notation %! - Ethernet address in xx:xx:xx:xx:xx:xx notation Note: width specification not supported **************************************************************************/ static int etherboot_vsprintf (char *buf, const char *fmt, va_list args) { char *p, *s; int n; s = buf; for ( ; *fmt != '\0'; ++fmt) { if (*fmt != '%') { buf ? *s++ = *fmt : grub_putchar (*fmt); continue; } if (*++fmt == 's') { for (p = va_arg (args, char *); *p != '\0'; p++) buf ? *s++ = *p : grub_putchar (*p); } else { /* Length of item is bounded */ char tmp[20], *q = tmp; int alt = 0; int shift = 28; if (*fmt == '#') { alt = 1; fmt++; } if (*fmt == 'h') { shift = 12; fmt++; } if (*fmt == 'h') { shift = 4; fmt++; } /* * Before each format q points to tmp buffer * After each format q points past end of item */ if ((*fmt | 0x20) == 'x') { int ncase = (*fmt & 0x20); n = va_arg (args, int); if (alt) { *q++ = '0'; *q++ = 'X' | ncase; } for (; shift >= 0; shift -= 4) *q++ = "0123456789ABCDEF"[(n >> shift) & 0xF] | ncase; } else if (*fmt == 'd') { char *r; n = va_arg (args, int); if (n < 0) { *q++ = '-'; n = -n; } p = q; /* save beginning of digits */ do { *q++ = '0' + (n % 10); n /= 10; } while (n); /* reverse digits, stop in middle */ r = q; /* don't alter q */ while (--r > p) { n = *r; *r = *p; *p++ = n; } } else if (*fmt == '@') { unsigned char *r; union { int l; unsigned char c[4]; } u; u.l = va_arg (args, int); for (r = &u.c[0]; r < &u.c[4]; ++r) q += etherboot_sprintf (q, "%d.", *r); --q; } else if (*fmt == '!') { char *r; p = va_arg (args, char *); for (r = p + ETH_ALEN; p < r; ++p) q += etherboot_sprintf (q, "%hhX:", *p); --q; } else if (*fmt == 'c') *q++ = va_arg (args, int); else *q++ = *fmt; /* now output the saved string */ for (p = tmp; p < q; ++p) buf ? *s++ = *p : grub_putchar (*p); } } if (buf) *s = '\0'; return (s - buf); } int etherboot_sprintf (char *buf, const char *fmt, ...) { va_list ap; int ret; va_start (ap, fmt); ret = etherboot_vsprintf (buf, fmt, ap); va_end (ap); return ret; } void etherboot_printf (const char *fmt, ...) { va_list ap; va_start (ap, fmt); (void) etherboot_vsprintf (0, fmt, ap); va_end (ap); } int inet_aton (char *p, in_addr *addr) { unsigned long ip = 0; int val; int i; for (i = 0; i < 4; i++) { val = getdec (&p); if (val < 0 || val > 255) return 0; if (i != 3 && *p++ != '.') return 0; ip = (ip << 8) | val; } addr->s_addr = htonl (ip); return 1; } int getdec (char **ptr) { char *p = *ptr; int ret = 0; if (*p < '0' || *p > '9') return -1; while (*p >= '0' && *p <= '9') { ret = ret * 10 + (*p - '0'); p++; } *ptr = p; return ret; }
gpl-2.0
ashmastaflash/IDCOAS
integration/heatmaps/heatmap/colorschemes.py
33688
""" color scheme source data """ schemes = {'classic': [(255, 237, 237), (255, 224, 224), (255, 209, 209), (255, 193, 193), (255, 176, 176), (255, 159, 159), (255, 142, 142), (255, 126, 126), (255, 110, 110), (255, 94, 94), (255, 81, 81), (255, 67, 67), (255, 56, 56), (255, 46, 46), (255, 37, 37), (255, 29, 29), (255, 23, 23), (255, 18, 18), (255, 14, 14), (255, 11, 11), (255, 8, 8), (255, 6, 6), (255, 5, 5), (255, 3, 3), (255, 2, 2), (255, 2, 2), (255, 1, 1), (255, 1, 1), (255, 0, 0), (255, 0, 0), (255, 0, 0), (255, 0, 0), (255, 0, 0), (255, 0, 0), (255, 0, 0), (255, 0, 0), (255, 1, 0), (255, 4, 0), (255, 6, 0), (255, 10, 0), (255, 14, 0), (255, 18, 0), (255, 22, 0), (255, 26, 0), (255, 31, 0), (255, 36, 0), (255, 41, 0), (255, 45, 0), (255, 51, 0), (255, 57, 0), (255, 62, 0), (255, 68, 0), (255, 74, 0), (255, 81, 0), (255, 86, 0), (255, 93, 0), (255, 99, 0), (255, 105, 0), (255, 111, 0), (255, 118, 0), (255, 124, 0), (255, 131, 0), (255, 137, 0), (255, 144, 0), (255, 150, 0), (255, 156, 0), (255, 163, 0), (255, 169, 0), (255, 175, 0), (255, 181, 0), (255, 187, 0), (255, 192, 0), (255, 198, 0), (255, 203, 0), (255, 208, 0), (255, 213, 0), (255, 218, 0), (255, 222, 0), (255, 227, 0), (255, 232, 0), (255, 235, 0), (255, 238, 0), (255, 242, 0), (255, 245, 0), (255, 247, 0), (255, 250, 0), (255, 251, 0), (253, 252, 0), (250, 252, 1), (248, 252, 2), (244, 252, 2), (241, 252, 3), (237, 252, 3), (233, 252, 3), (229, 252, 4), (225, 252, 4), (220, 252, 5), (216, 252, 5), (211, 252, 6), (206, 252, 7), (201, 252, 7), (197, 252, 8), (191, 251, 8), (185, 249, 9), (180, 247, 9), (174, 246, 10), (169, 244, 11), (164, 242, 11), (158, 240, 12), (151, 238, 13), (146, 236, 14), (140, 233, 14), (134, 231, 15), (128, 228, 16), (122, 226, 17), (116, 223, 18), (110, 221, 19), (105, 218, 20), (99, 216, 21), (93, 214, 22), (88, 211, 23), (82, 209, 24), (76, 207, 25), (71, 204, 26), (66, 202, 28), (60, 200, 30), (55, 198, 31), (50, 196, 33), (45, 194, 34), (40, 191, 35), (36, 190, 37), (31, 188, 39), (27, 187, 40), (23, 185, 43), (19, 184, 44), (15, 183, 46), (12, 182, 48), (9, 181, 51), (6, 181, 53), (3, 180, 55), (1, 180, 57), (0, 180, 60), (0, 180, 62), (0, 180, 65), (0, 181, 68), (0, 182, 70), (0, 182, 74), (0, 183, 77), (0, 184, 80), (0, 184, 84), (0, 186, 88), (0, 187, 92), (0, 188, 95), (0, 190, 99), (0, 191, 104), (0, 193, 108), (0, 194, 112), (0, 196, 116), (0, 198, 120), (0, 200, 125), (0, 201, 129), (0, 203, 134), (0, 205, 138), (0, 207, 143), (0, 209, 147), (0, 211, 151), (0, 213, 156), (0, 215, 160), (0, 216, 165), (0, 219, 171), (0, 222, 178), (0, 224, 184), (0, 227, 190), (0, 229, 197), (0, 231, 203), (0, 233, 209), (0, 234, 214), (0, 234, 220), (0, 234, 225), (0, 234, 230), (0, 234, 234), (0, 234, 238), (0, 234, 242), (0, 234, 246), (0, 234, 248), (0, 234, 251), (0, 234, 254), (0, 234, 255), (0, 232, 255), (0, 228, 255), (0, 224, 255), (0, 219, 255), (0, 214, 254), (0, 208, 252), (0, 202, 250), (0, 195, 247), (0, 188, 244), (0, 180, 240), (0, 173, 236), (0, 164, 232), (0, 156, 228), (0, 147, 222), (0, 139, 218), (0, 130, 213), (0, 122, 208), (0, 117, 205), (0, 112, 203), (0, 107, 199), (0, 99, 196), (0, 93, 193), (0, 86, 189), (0, 78, 184), (0, 71, 180), (0, 65, 175), (0, 58, 171), (0, 52, 167), (0, 46, 162), (0, 40, 157), (0, 35, 152), (0, 30, 147), (0, 26, 142), (0, 22, 136), (0, 18, 131), (0, 15, 126), (0, 12, 120), (0, 9, 115), (1, 8, 110), (1, 6, 106), (1, 5, 101), (2, 4, 97), (3, 4, 92), (4, 5, 89), (5, 5, 85), (6, 6, 82), (7, 7, 79), (8, 8, 77), (10, 10, 77), (12, 12, 77), (14, 14, 76), (16, 16, 74), (19, 19, 73), (21, 21, 72), (24, 24, 71), (26, 26, 69), (29, 29, 70), (32, 32, 69), (35, 35, 68), (37, 37, 67), (40, 40, 67), (42, 42, 65), (44, 44, 65), (46, 46, 64), (48, 48, 63), (49, 50, 62), (51, 51, 61), (53, 52, 61)], 'fire': [(255, 255, 255), (255, 255, 253), (255, 255, 250), (255, 255, 247), (255, 255, 244), (255, 255, 241), (255, 255, 238), (255, 255, 234), (255, 255, 231), (255, 255, 227), (255, 255, 223), (255, 255, 219), (255, 255, 214), (255, 255, 211), (255, 255, 206), (255, 255, 202), (255, 255, 197), (255, 255, 192), (255, 255, 187), (255, 255, 183), (255, 255, 178), (255, 255, 172), (255, 255, 167), (255, 255, 163), (255, 255, 157), (255, 255, 152), (255, 255, 147), (255, 255, 142), (255, 255, 136), (255, 255, 132), (255, 255, 126), (255, 255, 121), (255, 255, 116), (255, 255, 111), (255, 255, 106), (255, 255, 102), (255, 255, 97), (255, 255, 91), (255, 255, 87), (255, 255, 82), (255, 255, 78), (255, 255, 74), (255, 255, 70), (255, 255, 65), (255, 255, 61), (255, 255, 57), (255, 255, 53), (255, 255, 50), (255, 255, 46), (255, 255, 43), (255, 255, 39), (255, 255, 38), (255, 255, 34), (255, 255, 31), (255, 255, 29), (255, 255, 26), (255, 255, 25), (255, 254, 23), (255, 251, 22), (255, 250, 22), (255, 247, 23), (255, 245, 23), (255, 242, 24), (255, 239, 24), (255, 236, 25), (255, 232, 25), (255, 229, 26), (255, 226, 26), (255, 222, 27), (255, 218, 27), (255, 215, 28), (255, 210, 28), (255, 207, 29), (255, 203, 29), (255, 199, 30), (255, 194, 30), (255, 190, 31), (255, 186, 31), (255, 182, 32), (255, 176, 32), (255, 172, 33), (255, 168, 34), (255, 163, 34), (255, 159, 35), (255, 154, 35), (255, 150, 36), (255, 145, 36), (255, 141, 37), (255, 136, 37), (255, 132, 38), (255, 128, 39), (255, 124, 39), (255, 119, 40), (255, 115, 40), (255, 111, 41), (255, 107, 41), (255, 103, 42), (255, 99, 42), (255, 95, 43), (255, 92, 44), (255, 89, 44), (255, 85, 45), (255, 81, 45), (255, 79, 46), (255, 76, 47), (255, 72, 47), (255, 70, 48), (255, 67, 48), (255, 65, 49), (255, 63, 50), (255, 60, 50), (255, 59, 51), (255, 57, 51), (255, 55, 52), (255, 55, 53), (255, 53, 53), (253, 54, 54), (253, 54, 54), (251, 55, 55), (250, 56, 56), (248, 56, 56), (247, 57, 57), (246, 57, 57), (244, 58, 58), (242, 59, 59), (240, 59, 59), (239, 60, 60), (238, 61, 61), (235, 61, 61), (234, 62, 62), (232, 62, 62), (229, 63, 63), (228, 64, 64), (226, 64, 64), (224, 65, 65), (222, 66, 66), (219, 66, 66), (218, 67, 67), (216, 67, 67), (213, 68, 68), (211, 69, 69), (209, 69, 69), (207, 70, 70), (205, 71, 71), (203, 71, 71), (200, 72, 72), (199, 73, 73), (196, 73, 73), (194, 74, 74), (192, 74, 74), (190, 75, 75), (188, 76, 76), (186, 76, 76), (183, 77, 77), (181, 78, 78), (179, 78, 78), (177, 79, 79), (175, 80, 80), (173, 80, 80), (170, 81, 81), (169, 82, 82), (166, 82, 82), (165, 83, 83), (162, 83, 83), (160, 84, 84), (158, 85, 85), (156, 85, 85), (154, 86, 86), (153, 87, 87), (150, 87, 87), (149, 88, 88), (147, 89, 89), (146, 90, 90), (144, 91, 91), (142, 92, 92), (142, 94, 94), (141, 95, 95), (140, 96, 96), (139, 98, 98), (138, 99, 99), (136, 100, 100), (135, 101, 101), (135, 103, 103), (134, 104, 104), (133, 105, 105), (133, 107, 107), (132, 108, 108), (131, 109, 109), (132, 111, 111), (131, 112, 112), (130, 113, 113), (130, 114, 114), (130, 116, 116), (130, 117, 117), (130, 118, 118), (129, 119, 119), (130, 121, 121), (130, 122, 122), (130, 123, 123), (130, 124, 124), (131, 126, 126), (131, 127, 127), (130, 128, 128), (131, 129, 129), (132, 131, 131), (132, 132, 132), (133, 133, 133), (134, 134, 134), (135, 135, 135), (136, 136, 136), (138, 138, 138), (139, 139, 139), (140, 140, 140), (141, 141, 141), (142, 142, 142), (143, 143, 143), (144, 144, 144), (145, 145, 145), (147, 147, 147), (148, 148, 148), (149, 149, 149), (150, 150, 150), (151, 151, 151), (152, 152, 152), (153, 153, 153), (154, 154, 154), (155, 155, 155), (156, 156, 156), (157, 157, 157), (158, 158, 158), (159, 159, 159), (160, 160, 160), (160, 160, 160), (161, 161, 161), (162, 162, 162), (163, 163, 163), (164, 164, 164), (165, 165, 165), (166, 166, 166), (167, 167, 167), (167, 167, 167), (168, 168, 168), (169, 169, 169), (170, 170, 170), (170, 170, 170), (171, 171, 171), (172, 172, 172), (173, 173, 173), (173, 173, 173), (174, 174, 174), (175, 175, 175), (175, 175, 175), (176, 176, 176), (176, 176, 176), (177, 177, 177), (177, 177, 177)], 'omg': [(255, 255, 255), (255, 254, 254), (255, 253, 253), (255, 251, 251), (255, 250, 250), (255, 249, 249), (255, 247, 247), (255, 246, 246), (255, 244, 244), (255, 242, 242), (255, 241, 241), (255, 239, 239), (255, 237, 237), (255, 235, 235), (255, 233, 233), (255, 231, 231), (255, 229, 229), (255, 227, 227), (255, 226, 226), (255, 224, 224), (255, 222, 222), (255, 220, 220), (255, 217, 217), (255, 215, 215), (255, 213, 213), (255, 210, 210), (255, 208, 208), (255, 206, 206), (255, 204, 204), (255, 202, 202), (255, 199, 199), (255, 197, 197), (255, 194, 194), (255, 192, 192), (255, 189, 189), (255, 188, 188), (255, 185, 185), (255, 183, 183), (255, 180, 180), (255, 178, 178), (255, 176, 176), (255, 173, 173), (255, 171, 171), (255, 169, 169), (255, 167, 167), (255, 164, 164), (255, 162, 162), (255, 160, 160), (255, 158, 158), (255, 155, 155), (255, 153, 153), (255, 151, 151), (255, 149, 149), (255, 147, 147), (255, 145, 145), (255, 143, 143), (255, 141, 141), (255, 139, 139), (255, 137, 137), (255, 136, 136), (255, 134, 134), (255, 132, 132), (255, 131, 131), (255, 129, 129), (255, 128, 128), (255, 127, 127), (255, 127, 127), (255, 126, 126), (255, 125, 125), (255, 125, 125), (255, 124, 124), (255, 123, 122), (255, 123, 122), (255, 122, 121), (255, 122, 121), (255, 121, 120), (255, 120, 119), (255, 119, 118), (255, 119, 118), (255, 118, 116), (255, 117, 116), (255, 117, 115), (255, 115, 114), (255, 115, 114), (255, 114, 113), (255, 114, 112), (255, 113, 111), (255, 113, 111), (255, 112, 110), (255, 111, 108), (255, 111, 108), (255, 110, 107), (255, 110, 107), (255, 109, 105), (255, 109, 105), (255, 108, 104), (255, 107, 104), (255, 107, 102), (255, 106, 102), (255, 106, 101), (255, 105, 101), (255, 104, 99), (255, 104, 99), (255, 103, 98), (255, 103, 98), (255, 102, 97), (255, 102, 96), (255, 101, 96), (255, 101, 96), (255, 100, 94), (255, 100, 94), (255, 99, 93), (255, 99, 92), (255, 98, 91), (255, 98, 91), (255, 97, 90), (255, 97, 89), (255, 96, 89), (255, 96, 89), (255, 95, 88), (255, 95, 88), (255, 94, 86), (255, 93, 86), (255, 93, 85), (255, 93, 85), (255, 92, 85), (255, 92, 84), (255, 91, 83), (255, 91, 83), (255, 90, 82), (255, 90, 82), (255, 89, 81), (255, 89, 82), (255, 89, 80), (255, 89, 80), (255, 89, 79), (255, 89, 79), (255, 88, 79), (255, 88, 79), (255, 87, 78), (255, 87, 78), (255, 87, 78), (255, 87, 77), (255, 87, 77), (255, 86, 77), (255, 86, 77), (255, 85, 76), (255, 85, 76), (255, 85, 75), (255, 85, 76), (255, 85, 75), (255, 85, 76), (255, 84, 75), (255, 84, 75), (255, 84, 75), (255, 84, 75), (255, 85, 75), (255, 84, 75), (255, 84, 75), (255, 83, 74), (255, 83, 75), (255, 83, 75), (255, 84, 75), (255, 83, 75), (255, 83, 75), (255, 83, 75), (255, 83, 75), (255, 83, 76), (255, 83, 76), (255, 83, 76), (255, 83, 76), (255, 83, 76), (255, 83, 76), (255, 83, 76), (255, 83, 76), (255, 83, 77), (255, 84, 78), (255, 83, 78), (255, 84, 79), (255, 84, 78), (255, 84, 79), (255, 83, 79), (255, 84, 80), (255, 83, 80), (255, 84, 81), (255, 85, 82), (255, 85, 82), (255, 85, 83), (255, 85, 83), (255, 85, 84), (255, 85, 84), (255, 86, 85), (255, 86, 85), (255, 87, 87), (254, 89, 89), (254, 91, 92), (253, 92, 93), (252, 94, 96), (251, 96, 98), (251, 97, 100), (249, 99, 103), (249, 100, 105), (248, 102, 108), (247, 104, 111), (246, 105, 113), (245, 107, 116), (244, 109, 119), (243, 110, 122), (242, 112, 125), (241, 113, 127), (240, 115, 130), (239, 117, 134), (238, 118, 136), (237, 120, 140), (236, 121, 142), (235, 123, 145), (234, 124, 148), (233, 126, 151), (232, 127, 154), (232, 129, 157), (230, 130, 159), (230, 132, 162), (229, 133, 165), (228, 135, 168), (227, 136, 170), (227, 138, 173), (226, 139, 176), (225, 140, 178), (224, 142, 181), (223, 143, 183), (223, 144, 185), (223, 146, 188), (222, 147, 190), (221, 148, 192), (221, 150, 195), (220, 151, 197), (219, 152, 199), (219, 153, 201), (219, 154, 202), (219, 156, 205), (218, 157, 207), (217, 158, 208), (217, 159, 210), (217, 160, 211), (217, 161, 213), (216, 162, 214), (216, 163, 216), (216, 164, 217), (215, 165, 218), (216, 166, 219), (215, 166, 220), (215, 167, 222), (215, 168, 223), (215, 169, 223), (215, 170, 224), (215, 170, 225)], 'pbj': [(41, 10, 89), (41, 10, 89), (42, 10, 89), (42, 10, 89), (42, 10, 88), (43, 10, 88), (43, 9, 88), (43, 9, 88), (44, 9, 88), (44, 9, 88), (45, 10, 89), (46, 10, 88), (46, 9, 88), (47, 9, 88), (47, 9, 88), (47, 9, 88), (48, 8, 88), (48, 8, 87), (49, 8, 87), (49, 8, 87), (49, 7, 87), (50, 7, 87), (50, 7, 87), (51, 7, 86), (51, 6, 86), (53, 7, 86), (53, 7, 86), (54, 7, 86), (54, 6, 85), (55, 6, 85), (55, 6, 85), (56, 5, 85), (56, 5, 85), (57, 5, 84), (57, 5, 84), (58, 4, 84), (59, 4, 84), (59, 5, 84), (60, 4, 84), (60, 4, 84), (61, 4, 84), (61, 4, 83), (62, 3, 83), (63, 3, 83), (63, 3, 83), (64, 3, 82), (64, 3, 82), (65, 3, 82), (66, 3, 82), (67, 4, 82), (68, 4, 82), (69, 4, 82), (69, 4, 81), (70, 4, 81), (71, 4, 81), (71, 4, 80), (72, 4, 80), (73, 4, 80), (73, 4, 79), (75, 5, 80), (76, 5, 80), (77, 5, 79), (77, 5, 79), (78, 5, 79), (79, 5, 78), (80, 5, 78), (80, 5, 78), (80, 5, 77), (81, 5, 77), (83, 6, 76), (83, 6, 76), (84, 6, 76), (85, 6, 75), (86, 6, 75), (87, 6, 74), (88, 6, 74), (88, 6, 73), (89, 6, 73), (91, 7, 73), (92, 7, 73), (93, 7, 72), (94, 7, 72), (94, 7, 71), (95, 7, 71), (96, 7, 70), (96, 7, 70), (97, 7, 69), (99, 9, 70), (100, 9, 69), (101, 10, 69), (102, 10, 68), (103, 11, 67), (104, 11, 67), (105, 12, 66), (106, 13, 66), (107, 14, 66), (108, 15, 65), (109, 16, 64), (110, 16, 64), (111, 17, 63), (112, 18, 62), (113, 18, 61), (114, 19, 61), (115, 20, 60), (118, 22, 60), (119, 22, 59), (120, 22, 58), (120, 23, 58), (121, 24, 57), (122, 25, 56), (124, 26, 55), (125, 27, 54), (127, 29, 54), (128, 30, 54), (130, 31, 53), (131, 32, 52), (132, 33, 51), (133, 34, 50), (134, 35, 49), (135, 36, 48), (137, 38, 48), (138, 39, 47), (140, 40, 46), (141, 41, 46), (142, 42, 45), (143, 42, 44), (144, 43, 43), (145, 44, 42), (146, 45, 42), (149, 47, 41), (150, 48, 41), (151, 49, 40), (152, 50, 39), (153, 51, 38), (154, 52, 38), (155, 53, 37), (157, 55, 36), (159, 57, 36), (160, 57, 35), (160, 58, 34), (162, 59, 33), (163, 60, 33), (164, 61, 32), (165, 62, 31), (167, 63, 30), (168, 65, 30), (169, 66, 29), (170, 67, 29), (172, 68, 28), (173, 69, 27), (174, 70, 26), (175, 71, 26), (176, 71, 25), (178, 73, 25), (179, 74, 24), (180, 75, 24), (181, 76, 23), (182, 77, 23), (183, 78, 23), (184, 79, 22), (186, 80, 22), (187, 81, 21), (188, 82, 21), (189, 83, 21), (190, 83, 20), (191, 84, 20), (192, 85, 19), (192, 86, 19), (193, 87, 18), (194, 87, 18), (196, 89, 18), (196, 90, 18), (197, 90, 18), (198, 90, 18), (199, 91, 18), (200, 92, 18), (201, 93, 18), (202, 93, 18), (203, 94, 18), (204, 96, 19), (204, 96, 19), (205, 97, 19), (206, 98, 19), (207, 99, 19), (208, 99, 19), (209, 100, 19), (210, 100, 19), (211, 100, 19), (212, 102, 20), (213, 103, 20), (214, 103, 20), (214, 104, 20), (215, 105, 20), (215, 105, 20), (216, 106, 20), (217, 107, 20), (218, 107, 20), (219, 108, 20), (220, 109, 21), (221, 109, 21), (222, 110, 21), (222, 111, 21), (223, 111, 21), (224, 112, 21), (225, 113, 21), (226, 113, 21), (227, 114, 21), (227, 114, 21), (228, 115, 22), (229, 116, 22), (229, 116, 22), (230, 117, 22), (231, 117, 22), (231, 118, 22), (232, 119, 22), (233, 119, 22), (234, 120, 22), (234, 120, 22), (235, 121, 22), (236, 121, 22), (237, 122, 23), (237, 122, 23), (238, 123, 23), (239, 124, 23), (239, 124, 23), (240, 125, 23), (240, 125, 23), (241, 126, 23), (241, 126, 23), (242, 127, 23), (243, 127, 23), (243, 128, 23), (244, 128, 24), (244, 128, 24), (245, 129, 24), (246, 129, 24), (246, 130, 24), (247, 130, 24), (247, 131, 24), (248, 131, 24), (249, 131, 24), (249, 132, 24), (250, 132, 24), (250, 133, 24), (250, 133, 24), (250, 133, 24), (251, 134, 24), (251, 134, 25), (252, 135, 25), (252, 135, 25), (253, 135, 25), (253, 136, 25), (253, 136, 25), (254, 136, 25), (254, 136, 25), (255, 137, 25)], 'pgaitch': [(255, 254, 165), (255, 254, 164), (255, 253, 163), (255, 253, 162), (255, 253, 161), (255, 252, 160), (255, 252, 159), (255, 252, 157), (255, 251, 156), (255, 251, 155), (255, 251, 153), (255, 250, 152), (255, 250, 150), (255, 250, 149), (255, 249, 148), (255, 249, 146), (255, 249, 145), (255, 248, 143), (255, 248, 141), (255, 248, 139), (255, 247, 138), (255, 247, 136), (255, 246, 134), (255, 246, 132), (255, 246, 130), (255, 245, 129), (255, 245, 127), (255, 245, 125), (255, 244, 123), (255, 244, 121), (255, 243, 119), (255, 243, 117), (255, 242, 114), (255, 242, 112), (255, 241, 111), (255, 241, 109), (255, 240, 107), (255, 240, 105), (255, 239, 102), (255, 239, 100), (255, 238, 99), (255, 238, 97), (255, 237, 95), (255, 237, 92), (255, 236, 90), (255, 237, 89), (255, 236, 87), (255, 235, 84), (255, 235, 82), (255, 234, 80), (255, 233, 79), (255, 233, 77), (255, 232, 74), (255, 231, 72), (255, 230, 70), (255, 230, 69), (255, 229, 67), (255, 228, 65), (255, 227, 63), (255, 226, 61), (255, 225, 60), (255, 225, 58), (255, 224, 56), (255, 223, 54), (255, 222, 52), (255, 222, 51), (255, 221, 49), (255, 220, 47), (255, 219, 46), (255, 218, 44), (255, 216, 43), (255, 215, 42), (255, 214, 41), (255, 213, 39), (255, 212, 39), (255, 211, 37), (255, 209, 36), (255, 208, 34), (255, 208, 33), (255, 206, 33), (255, 205, 32), (255, 204, 30), (255, 202, 29), (255, 201, 29), (255, 199, 28), (254, 199, 28), (254, 199, 27), (253, 198, 27), (252, 197, 27), (251, 196, 27), (250, 195, 26), (249, 195, 26), (248, 194, 26), (248, 193, 26), (247, 192, 26), (246, 192, 25), (245, 191, 26), (244, 190, 26), (243, 189, 25), (241, 188, 25), (240, 187, 25), (239, 187, 25), (238, 186, 25), (236, 185, 25), (236, 184, 26), (235, 183, 26), (233, 182, 25), (232, 181, 25), (230, 181, 26), (229, 180, 26), (228, 179, 25), (227, 178, 25), (226, 177, 26), (224, 176, 26), (222, 176, 25), (221, 175, 25), (220, 173, 26), (219, 172, 26), (217, 171, 25), (215, 170, 25), (214, 170, 26), (212, 169, 26), (211, 167, 25), (209, 166, 25), (208, 166, 26), (206, 165, 26), (204, 163, 26), (203, 162, 26), (202, 161, 25), (200, 161, 26), (198, 159, 26), (197, 158, 26), (195, 157, 26), (193, 157, 27), (192, 155, 27), (190, 154, 27), (189, 153, 27), (187, 152, 28), (186, 151, 28), (184, 150, 28), (182, 149, 28), (181, 148, 29), (179, 147, 29), (177, 146, 29), (175, 144, 29), (174, 144, 30), (172, 142, 30), (170, 141, 30), (169, 140, 30), (167, 139, 31), (165, 138, 31), (164, 137, 31), (162, 136, 31), (161, 135, 32), (159, 134, 32), (157, 133, 32), (154, 132, 32), (153, 131, 33), (151, 130, 33), (150, 129, 33), (148, 127, 33), (147, 127, 34), (145, 126, 34), (143, 124, 34), (141, 123, 34), (140, 122, 35), (139, 121, 35), (137, 120, 35), (135, 119, 35), (134, 118, 36), (132, 117, 36), (130, 116, 36), (129, 115, 36), (127, 113, 36), (126, 113, 37), (124, 112, 37), (122, 111, 37), (121, 110, 37), (120, 109, 38), (118, 108, 38), (116, 107, 38), (115, 105, 38), (113, 104, 38), (112, 104, 39), (110, 103, 39), (108, 102, 39), (107, 101, 39), (106, 100, 40), (104, 99, 40), (102, 98, 40), (101, 96, 40), (99, 96, 40), (99, 96, 41), (97, 94, 41), (96, 93, 41), (94, 92, 41), (92, 91, 41), (92, 90, 42), (90, 90, 42), (89, 89, 42), (87, 87, 42), (86, 86, 42), (85, 86, 43), (84, 85, 43), (83, 84, 43), (81, 83, 43), (80, 82, 43), (80, 82, 44), (78, 80, 44), (77, 80, 44), (75, 79, 44), (75, 78, 44), (74, 78, 45), (73, 76, 45), (71, 75, 45), (71, 75, 45), (70, 74, 45), (69, 74, 46), (68, 73, 46), (67, 72, 46), (66, 71, 46), (65, 71, 46), (64, 69, 46), (64, 69, 47), (63, 68, 47), (62, 67, 47), (61, 67, 47), (60, 66, 47), (59, 65, 47), (59, 65, 48), (59, 64, 48), (58, 63, 48), (57, 63, 48), (56, 62, 48), (56, 62, 48), (55, 61, 48), (55, 61, 49), (55, 60, 49), (55, 60, 49), (54, 59, 49), (53, 58, 49), (53, 57, 49), (52, 57, 49), (52, 57, 50), (52, 56, 50), (52, 56, 50), (52, 56, 50), (52, 55, 50), (51, 54, 50), (51, 53, 50), (51, 53, 50), (51, 52, 50), (51, 53, 51), (51, 53, 51), (51, 52, 51), (51, 52, 51)]} def valid_schemes(): return schemes.keys()
gpl-2.0
CG77/ezpublish-legacy
kernel/private/rest/classes/exceptions/bad_request.php
558
<?php /** * File containing the ezpOauthBadRequestException class. * * @copyright Copyright (C) eZ Systems AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. * @version 2014.11.1 * @package kernel */ /** * This is the base exception for triggering BAD REQUEST response. * * @package oauth */ abstract class ezpOauthBadRequestException extends ezpOauthException { public function __construct( $message ) { parent::__construct( $message ); } } ?>
gpl-2.0
shubham49/teammates
src/test/resources/pages/instructorHomeTestingSanitization.html
12243
<div class="container" id="mainContent"> <div id="topOfPage"> </div> <h1> Home </h1> <br> <div class="well well-plain"> <div class="row"> <div class="col-md-12"> <form action="/page/instructorSearchPage?user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse" method="get" name="search_form"> <div class="input-group"> <input class="form-control" data-original-title="Search for student's information, e.g. name, email" data-placement="top" data-toggle="tooltip" id="searchbox" name="searchkey" placeholder="e.g. Charles Shultz, charles@gmail.com" title="" type="text"> <span class="input-group-btn"> <button class="btn btn-default" id="buttonSearch" type="submit" value="Search"> Search </button> </span> </div> <input name="searchstudents" type="hidden" value="true"> <input name="searchcommentforresponses" type="hidden" value="false"> <input name="user" type="hidden" value="CHomeUiT.idOfInstructor1OfTestingSanitizationCourse"> </form> </div> </div> </div> <br> <div id="statusMessagesToUser" style="display: none;"> </div> <div aria-hidden="true" aria-labelledby="remindModal" class="modal fade" id="remindModal" role="dialog" tabindex="-1"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <form action="/page/instructorFeedbackRemindParticularStudents?next=%2Fpage%2FinstructorHomePage&token=${sessionToken}" method="post" name="form_remind_list" role="form"> <div class="modal-header"> <button aria-hidden="true" class="close" data-dismiss="modal" type="button"> × </button> <h4 class="modal-title"> Remind Particular Students <small> (Select the student(s) you want to remind) </small> </h4> </div> <div class="modal-body"> <div class="form-group" id="studentList"> </div> </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal" type="button"> Cancel </button> <input class="btn btn-primary remind-particular-button" data-dismiss="modal" type="button" value="Remind"> <input name="user" type="hidden" value="CHomeUiT.idOfInstructor1OfTestingSanitizationCourse"> </div> </form> </div> </div> </div> <div class="row"> <div class="col-xs-2"> <a class="btn btn-primary btn-md" href="/page/instructorCoursesPage?user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse" id="addNewCourse"> Add New Course </a> </div> <div class="col-xs-10"> <div class="pull-right"> <h5 class="inline-block"> <strong> Sort By: </strong> </h5> <div class="btn-group" data-toggle="buttons"> <label class="btn btn-default" data="id" disabled="" id="sortById" name="sortby"> <input type="radio"> Course ID </label> <label class="btn btn-default" data="name" disabled="" id="sortByName" name="sortby"> <input name="sortby" type="radio" value="name"> Course Name </label> <label class="btn btn-default active" data="createdAt" disabled="" id="sortByDate" name="sortby"> <input type="radio"> Creation Date </label> </div> </div> </div> </div> <br> <div class="panel panel-primary" id="course-0"> <div class="panel-heading" id="panelHeading-0" style="cursor: pointer;"> <div class="row"> <div class="col-sm-6"> <strong> [CHomeUiT.idOfTestingSanitizationCourse] : Testing&lt;script&gt; alert('hi!'); &lt;/script&gt; </strong> </div> <div class="mobile-margin-top-10px col-sm-6"> <span class="mobile-no-pull pull-right"> <div class="dropdown courses-table-dropdown"> <button class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" type="button"> Students <span class="caret dropdown-toggle"> </span> </button> <ul class="dropdown-menu"> <li> <a class="btn-tm-actions course-enroll-for-test" data-original-title="Enroll student into the course" data-placement="left" data-toggle="tooltip" href="/page/instructorCourseEnrollPage?courseid=CHomeUiT.idOfTestingSanitizationCourse&user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse" title=""> Enroll </a> </li> <li> <a class="btn-tm-actions course-view-for-test" data-original-title="View, edit and send invitation emails to the students in the course" data-placement="left" data-toggle="tooltip" href="/page/instructorCourseDetailsPage?courseid=CHomeUiT.idOfTestingSanitizationCourse&user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse" title=""> View / Edit </a> </li> </ul> </div> <div class="dropdown courses-table-dropdown"> <button class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" type="button"> Instructors <span class="caret dropdown-toggle"> </span> </button> <ul class="dropdown-menu"> <li> <a class="btn-tm-actions course-edit-for-test" data-original-title="Edit Course information and instructor list" data-placement="left" data-toggle="tooltip" href="/page/instructorCourseEditPage?courseid=CHomeUiT.idOfTestingSanitizationCourse&user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse" title=""> View / Edit </a> </li> </ul> </div> <div class="dropdown courses-table-dropdown"> <button class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" type="button"> Sessions <span class="caret dropdown-toggle"> </span> </button> <ul class="dropdown-menu"> <li> <a class="btn-tm-actions course-add-eval-for-test" data-original-title="Add a feedback session for the course" data-placement="left" data-toggle="tooltip" href="/page/instructorFeedbackSessionsPage?user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse&courseid=CHomeUiT.idOfTestingSanitizationCourse" title=""> Add </a> </li> </ul> </div> <div class="dropdown courses-table-dropdown"> <button class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" type="button"> Course <span class="caret dropdown-toggle"> </span> </button> <ul class="dropdown-menu"> <li> <a class="btn-tm-actions course-archive-for-test" data-course-id="CHomeUiT.idOfTestingSanitizationCourse" data-original-title="Archive the course so that it will not be shown in the home page any more (you can still access it from the 'Courses' tab)" data-placement="left" data-toggle="tooltip" href="/page/instructorCourseArchive?courseid=CHomeUiT.idOfTestingSanitizationCourse&archive=true&next=%2Fpage%2FinstructorHomePage&user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse&token=${sessionToken}" title=""> Archive </a> </li> <li> <a class="btn-tm-actions course-delete-for-test course-delete-link" data-course-id="CHomeUiT.idOfTestingSanitizationCourse" data-original-title="Delete the course and its corresponding students and sessions" data-placement="left" data-toggle="tooltip" href="/page/instructorCourseDelete?courseid=CHomeUiT.idOfTestingSanitizationCourse&next=%2Fpage%2FinstructorHomePage&user=CHomeUiT.idOfInstructor1OfTestingSanitizationCourse&token=${sessionToken}" title=""> Delete </a> </li> </ul> </div> <span class="glyphicon glyphicon-chevron-up"> </span> </span> </div> </div> </div> <form> <input name="user" type="hidden" value="CHomeUiT.idOfInstructor1OfTestingSanitizationCourse"> <input name="coursetoload" type="hidden" value="CHomeUiT.idOfTestingSanitizationCourse"> <input name="index" type="hidden" value="0"> </form> <div class="panel-collapse collapse in" id="panelBodyCollapse-0" style="height: auto;"> <div class="panel-body padding-0"> <table class="table-responsive table table-striped table-bordered margin-0"> <thead> <tr> <th class="button_sortname button-sort-none toggle-sort"> Session Name <span class="icon-sort unsorted"> </span> </th> <th class="button_sortstartdate button-sort-none toggle-sort" data-toggle-sort-comparator="sortDate" data-toggle-sort-extractor="tooltipExtractor"> Start Date <span class="icon-sort unsorted"> </span> </th> <th class="button_sortenddate button-sort-none toggle-sort" data-toggle-sort-comparator="sortDate" data-toggle-sort-extractor="tooltipExtractor"> End Date <span class="icon-sort unsorted"> </span> </th> <th> Submissions </th> <th> Responses </th> <th> <span class="text-nowrap tool-tip-decorate" data-original-title="Number of students submitted / Class size" data-placement="top" data-toggle="tooltip" title=""> Response Rate </span> </th> <th class="col-lg-4 no-print"> Action(s) </th> </tr> </thead> <tbody> <tr> <td> <span class="text-muted"> This course does not have any sessions yet. </span> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> </div> </div> </div> <div aria-hidden="true" aria-labelledby="fsCopyModal" class="modal fade" id="fsCopyModal" role="dialog" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <form action="/page/instructorFeedbackEditCopy?next=%2Fpage%2FinstructorHomePage&token=${sessionToken}" id="instructorCopyModalForm" method="post" role="form"> <div class="modal-header"> <button aria-hidden="true" class="close" data-dismiss="modal" type="button"> × </button> <h4 class="modal-title"> Copy this feedback session to other courses <br> <small> (Select the course(s) you want to copy this feedback session to) </small> </h4> </div> <div class="modal-body"> <div class="form-group" id="courseList"> </div> </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal" type="button"> Cancel </button> <input class="btn btn-primary" id="fscopy_submit" type="submit" value="Copy"> <input name="user" type="hidden" value="CHomeUiT.idOfInstructor1OfTestingSanitizationCourse"> </div> </form> </div> </div> </div> </div>
gpl-2.0
Kali-/lge-kernel-msm7x30
arch/arm/mach-msm/board-qt8660.c
139126
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/gpio.h> #include <linux/irq.h> #include <linux/io.h> #include <linux/mfd/pmic8058.h> #include <linux/pmic8058-pwrkey.h> #include <linux/pmic8058-othc.h> #include <linux/mfd/pmic8901.h> #include <linux/regulator/pmic8058-regulator.h> #include <linux/regulator/pmic8901-regulator.h> #include <linux/bootmem.h> #include <linux/pwm.h> #include <linux/pmic8058-pwm.h> #include <linux/pmic8058-xoadc.h> #include <linux/msm_adc.h> #include <linux/m_adcproc.h> #include <linux/mfd/marimba.h> #include <linux/i2c.h> #include <linux/spi/spi.h> #include <linux/dma-mapping.h> #include <linux/gpio_keys.h> #include <linux/input/matrix_keypad.h> #include <linux/msm-charger.h> #include <linux/i2c/isl9519.h> #include <linux/atmel_maxtouch.h> #ifdef CONFIG_ANDROID_PMEM #include <linux/android_pmem.h> #endif #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/setup.h> #include <mach/dma.h> #include <mach/mpp.h> #include <mach/board.h> #include <mach/irqs.h> #include <mach/msm_spi.h> #include <mach/msm_serial_hs.h> #include <mach/msm_serial_hs_lite.h> #include <mach/msm_iomap.h> #include <asm/mach/mmc.h> #include <mach/msm_hsusb.h> #include <mach/msm_xo.h> #include <mach/msm_bus_board.h> #include <mach/msm_tsif.h> #include <mach/socinfo.h> #include <mach/rpm.h> #ifdef CONFIG_USB_ANDROID #include <linux/usb/android_composite.h> #endif #include <mach/usb_gadget_fserial.h> #include <linux/regulator/consumer.h> #include <linux/regulator/machine.h> #include "devices.h" #include "devices-msm8x60.h" #include "cpuidle.h" #include "pm.h" #include "spm.h" #include "rpm_log.h" #include "timer.h" #include "saw-regulator.h" #include "rpm-regulator.h" #include "gpiomux.h" #include "gpiomux-8x60.h" #define MSM_SHARED_RAM_PHYS 0x40000000 /* Macros assume PMIC GPIOs start at 0 */ #define PM8058_GPIO_BASE NR_MSM_GPIOS #define PM8058_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + PM8058_GPIO_BASE) #define PM8058_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - PM8058_GPIO_BASE) #define PM8058_MPP_BASE (PM8058_GPIO_BASE + PM8058_GPIOS) #define PM8058_MPP_PM_TO_SYS(pm_gpio) (pm_gpio + PM8058_MPP_BASE) #define PM8058_MPP_SYS_TO_PM(sys_gpio) (sys_gpio - PM8058_MPP_BASE) #define PM8058_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) #define PM8901_GPIO_BASE (PM8058_GPIO_BASE + \ PM8058_GPIOS + PM8058_MPPS) #define PM8901_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + PM8901_GPIO_BASE) #define PM8901_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - PM901_GPIO_BASE) #define PM8901_IRQ_BASE (PM8058_IRQ_BASE + \ NR_PMIC8058_IRQS) #define MDM2AP_SYNC 129 #define GPIO_AUX_CAM_2P7_EN 94 #define GPIO_WEB_CAMIF_STANDBY 105 #define GPIO_MS_SYS_RESET_N PM8058_GPIO_PM_TO_SYS(2) /* * The UI_INTx_N lines are pmic gpio lines which connect i2c * gpio expanders to the pm8058. */ #define UI_INT1_N 25 #define UI_INT2_N 34 #define UI_INT3_N 14 /* FM GPIO is GPIO 18 on PMIC 8058. As the index starts from 0 in the PMIC driver, and hence 17 corresponds to GPIO 18 on PMIC 8058. */ #define FM_GPIO 17 static struct msm_spm_platform_data msm_spm_data_v1[] __initdata = { [0] = { .reg_base_addr = MSM_SAW0_BASE, #ifdef CONFIG_MSM_AVS_HW .reg_init_values[MSM_SPM_REG_SAW_AVS_CTL] = 0x586020FF, #endif .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x0F, .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x68, .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x01, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x07, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01, .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00, .awake_vlevel = 0x94, .retention_vlevel = 0x81, .collapse_vlevel = 0x20, .retention_mid_vlevel = 0x94, .collapse_mid_vlevel = 0x8C, .vctl_timeout_us = 50, }, [1] = { .reg_base_addr = MSM_SAW1_BASE, #ifdef CONFIG_MSM_AVS_HW .reg_init_values[MSM_SPM_REG_SAW_AVS_CTL] = 0x586020FF, #endif .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x0F, .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x68, .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x13, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x07, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01, .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00, .awake_vlevel = 0x94, .retention_vlevel = 0x81, .collapse_vlevel = 0x20, .retention_mid_vlevel = 0x94, .collapse_mid_vlevel = 0x8C, .vctl_timeout_us = 50, }, }; static struct msm_spm_platform_data msm_spm_data[] __initdata = { [0] = { .reg_base_addr = MSM_SAW0_BASE, #ifdef CONFIG_MSM_AVS_HW .reg_init_values[MSM_SPM_REG_SAW_AVS_CTL] = 0x586020FF, #endif .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x1F, .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x68, .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x01, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x07, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01, .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00, .awake_vlevel = 0xA0, .retention_vlevel = 0x8D, .collapse_vlevel = 0x20, .retention_mid_vlevel = 0xA0, .collapse_mid_vlevel = 0x98, .vctl_timeout_us = 50, }, [1] = { .reg_base_addr = MSM_SAW1_BASE, #ifdef CONFIG_MSM_AVS_HW .reg_init_values[MSM_SPM_REG_SAW_AVS_CTL] = 0x586020FF, #endif .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x1F, .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x68, .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFFFFFFFF, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x13, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x07, .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01, .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00, .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00, .awake_vlevel = 0xA0, .retention_vlevel = 0x8D, .collapse_vlevel = 0x20, .retention_mid_vlevel = 0xA0, .collapse_mid_vlevel = 0x98, .vctl_timeout_us = 50, }, }; static struct msm_acpu_clock_platform_data msm8x60_acpu_clock_data = { }; static struct regulator_consumer_supply saw_s0_supply = REGULATOR_SUPPLY("8901_s0", NULL); static struct regulator_consumer_supply saw_s1_supply = REGULATOR_SUPPLY("8901_s1", NULL); static struct regulator_init_data saw_s0_init_data = { .constraints = { .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, .min_uV = 840000, .max_uV = 1200000, }, .num_consumer_supplies = 1, .consumer_supplies = &saw_s0_supply, }; static struct regulator_init_data saw_s1_init_data = { .constraints = { .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, .min_uV = 840000, .max_uV = 1200000, }, .num_consumer_supplies = 1, .consumer_supplies = &saw_s1_supply, }; static struct platform_device msm_device_saw_s0 = { .name = "saw-regulator", .id = SAW_VREG_ID_S0, .dev = { .platform_data = &saw_s0_init_data, }, }; static struct platform_device msm_device_saw_s1 = { .name = "saw-regulator", .id = SAW_VREG_ID_S1, .dev = { .platform_data = &saw_s1_init_data, }, }; static struct msm_pm_platform_data msm_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = { [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { .supported = 1, .suspend_enabled = 0, .idle_enabled = 0, .latency = 4000, .residency = 13000, }, [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { .supported = 1, .suspend_enabled = 0, .idle_enabled = 0, .latency = 500, .residency = 6000, }, [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { .supported = 1, .suspend_enabled = 1, .idle_enabled = 1, .latency = 2, .residency = 0, }, [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { .supported = 1, .suspend_enabled = 0, .idle_enabled = 0, .latency = 600, .residency = 7200, }, [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { .supported = 1, .suspend_enabled = 0, .idle_enabled = 0, .latency = 500, .residency = 6000, }, [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { .supported = 1, .suspend_enabled = 1, .idle_enabled = 1, .latency = 2, .residency = 0, }, }; static struct msm_cpuidle_state msm_cstates[] __initdata = { {0, 0, "C0", "WFI", MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, {0, 1, "C1", "STANDALONE_POWER_COLLAPSE", MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, {0, 2, "C2", "POWER_COLLAPSE", MSM_PM_SLEEP_MODE_POWER_COLLAPSE}, {1, 0, "C0", "WFI", MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, {1, 1, "C1", "STANDALONE_POWER_COLLAPSE", MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, }; #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K) static struct regulator *ldo6_3p3; static struct regulator *ldo7_1p8; static struct regulator *vdd_cx; static int usb_phy_susp_dig_vol = 750000; #define USB_PHY_OPERATIONAL_MIN_VDD_DIG_VOL 1000000 #define USB_PHY_MAX_VDD_DIG_VOL 1320000 static int msm_hsusb_init_vddcx(int init) { int ret = 0; if (init) { vdd_cx = regulator_get(NULL, "8058_s1"); if (IS_ERR(vdd_cx)) return PTR_ERR(vdd_cx); ret = regulator_set_voltage(vdd_cx, USB_PHY_OPERATIONAL_MIN_VDD_DIG_VOL, USB_PHY_MAX_VDD_DIG_VOL); if (ret) { pr_err("%s: unable to set the voltage for regulator" "vdd_cx\n", __func__); regulator_put(vdd_cx); return ret; } ret = regulator_enable(vdd_cx); if (ret) { pr_err("%s: unable to enable regulator" "vdd_cx\n", __func__); regulator_put(vdd_cx); } } else { ret = regulator_disable(vdd_cx); if (ret) { pr_err("%s: Unable to disable the regulator:" "vdd_cx\n", __func__); return ret; } regulator_put(vdd_cx); } return ret; } static int msm_hsusb_config_vddcx(int high) { int max_vol = USB_PHY_MAX_VDD_DIG_VOL; int min_vol; int ret; if (high) min_vol = USB_PHY_OPERATIONAL_MIN_VDD_DIG_VOL; else min_vol = usb_phy_susp_dig_vol; ret = regulator_set_voltage(vdd_cx, min_vol, max_vol); if (ret) { pr_err("%s: unable to set the voltage for regulator" "vdd_cx\n", __func__); return ret; } pr_debug("%s: min_vol:%d max_vol:%d\n", __func__, min_vol, max_vol); return ret; } #define USB_PHY_3P3_VOL_MIN 3050000 /* uV */ #define USB_PHY_3P3_VOL_MAX 3050000 /* uV */ #define USB_PHY_3P3_HPM_LOAD 50000 /* uA */ #define USB_PHY_3P3_LPM_LOAD 4000 /* uA */ #define USB_PHY_1P8_VOL_MIN 1800000 /* uV */ #define USB_PHY_1P8_VOL_MAX 1800000 /* uV */ #define USB_PHY_1P8_HPM_LOAD 50000 /* uA */ #define USB_PHY_1P8_LPM_LOAD 4000 /* uA */ static int msm_hsusb_ldo_init(int init) { int rc = 0; if (init) { ldo6_3p3 = regulator_get(NULL, "8058_l6"); if (IS_ERR(ldo6_3p3)) return PTR_ERR(ldo6_3p3); ldo7_1p8 = regulator_get(NULL, "8058_l7"); if (IS_ERR(ldo7_1p8)) { rc = PTR_ERR(ldo7_1p8); goto put_3p3; } rc = regulator_set_voltage(ldo6_3p3, USB_PHY_3P3_VOL_MIN, USB_PHY_3P3_VOL_MAX); if (rc) { pr_err("%s: Unable to set voltage level for" "ldo6_3p3 regulator\n", __func__); goto put_1p8; } rc = regulator_enable(ldo6_3p3); if (rc) { pr_err("%s: Unable to enable the regulator:" "ldo6_3p3\n", __func__); goto put_1p8; } rc = regulator_set_voltage(ldo7_1p8, USB_PHY_1P8_VOL_MIN, USB_PHY_1P8_VOL_MAX); if (rc) { pr_err("%s: Unable to set voltage level for" "ldo7_1p8 regulator\n", __func__); goto disable_3p3; } rc = regulator_enable(ldo7_1p8); if (rc) { pr_err("%s: Unable to enable the regulator:" "ldo7_1p8\n", __func__); goto disable_3p3; } return 0; } regulator_disable(ldo7_1p8); disable_3p3: regulator_disable(ldo6_3p3); put_1p8: regulator_put(ldo7_1p8); put_3p3: regulator_put(ldo6_3p3); return rc; } static int msm_hsusb_ldo_enable(int on) { int ret = 0; if (!ldo7_1p8 || IS_ERR(ldo7_1p8)) { pr_err("%s: ldo7_1p8 is not initialized\n", __func__); return -ENODEV; } if (!ldo6_3p3 || IS_ERR(ldo6_3p3)) { pr_err("%s: ldo6_3p3 is not initialized\n", __func__); return -ENODEV; } if (on) { ret = regulator_set_optimum_mode(ldo7_1p8, USB_PHY_1P8_HPM_LOAD); if (ret < 0) { pr_err("%s: Unable to set HPM of the regulator:" "ldo7_1p8\n", __func__); return ret; } ret = regulator_set_optimum_mode(ldo6_3p3, USB_PHY_3P3_HPM_LOAD); if (ret < 0) { pr_err("%s: Unable to set HPM of the regulator:" "ldo6_3p3\n", __func__); regulator_set_optimum_mode(ldo7_1p8, USB_PHY_1P8_LPM_LOAD); return ret; } } else { ret = regulator_set_optimum_mode(ldo7_1p8, USB_PHY_1P8_LPM_LOAD); if (ret < 0) pr_err("%s: Unable to set LPM of the regulator:" "ldo7_1p8\n", __func__); ret = regulator_set_optimum_mode(ldo6_3p3, USB_PHY_3P3_LPM_LOAD); if (ret < 0) pr_err("%s: Unable to set LPM of the regulator:" "ldo6_3p3\n", __func__); } pr_debug("reg (%s)\n", on ? "HPM" : "LPM"); return ret < 0 ? ret : 0; } #endif #ifdef CONFIG_USB_EHCI_MSM_72K static void msm_hsusb_vbus_power(unsigned phy_info, int on) { static struct regulator *votg_5v_switch; static struct regulator *ext_5v_reg; static int vbus_is_on; /* If VBUS is already on (or off), do nothing. */ if (on == vbus_is_on) return; if (!votg_5v_switch) { votg_5v_switch = regulator_get(NULL, "8901_usb_otg"); if (IS_ERR(votg_5v_switch)) { pr_err("%s: unable to get votg_5v_switch\n", __func__); return; } } if (!ext_5v_reg) { ext_5v_reg = regulator_get(NULL, "8901_mpp0"); if (IS_ERR(ext_5v_reg)) { pr_err("%s: unable to get ext_5v_reg\n", __func__); return; } } if (on) { if (regulator_enable(ext_5v_reg)) { pr_err("%s: Unable to enable the regulator:" " ext_5v_reg\n", __func__); return; } if (regulator_enable(votg_5v_switch)) { pr_err("%s: Unable to enable the regulator:" " votg_5v_switch\n", __func__); return; } } else { if (regulator_disable(votg_5v_switch)) pr_err("%s: Unable to enable the regulator:" " votg_5v_switch\n", __func__); if (regulator_disable(ext_5v_reg)) pr_err("%s: Unable to enable the regulator:" " ext_5v_reg\n", __func__); } vbus_is_on = on; } static struct msm_usb_host_platform_data msm_usb_host_pdata = { .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM), .power_budget = 390, }; #endif #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K) #define USB_SWITCH_EN_GPIO 132 /* !CS of analog switch */ #define USB_SWITCH_CNTL_GPIO 131 /* 0: Host, 1: Peripheral */ #define USB_HUB_RESET_GPIO 63 /* 0: HUB is RESET */ static int msm_otg_init_analog_switch_gpio(int on) { int rc = 0; if (on) { /* USB SWITCH ENABLE*/ rc = gpio_request(USB_SWITCH_EN_GPIO, "USB_SWITCH_ENABLE"); if (rc) { pr_err("%s: SW_EN gpio %d request failed\n", __func__, USB_SWITCH_EN_GPIO); return rc; } /* USB SWITCH CONTROL */ rc = gpio_request(USB_SWITCH_CNTL_GPIO, "USB_SWITCH_CONTROL"); if (rc) { pr_err("%s: SW_CNTL gpio %d request failed\n", __func__, USB_SWITCH_CNTL_GPIO); goto fail_gpio_usb_switch_en; } /* USB HUB RESET */ rc = gpio_request(USB_HUB_RESET_GPIO, "USB_HUB_RESET"); if (rc) { pr_err("%s: HUB_RESET gpio %d request failed\n", __func__, USB_HUB_RESET_GPIO); goto fail_gpio_usb_switch_cntl; } /* Set direction of USB SWITCH ENABLE gpio */ rc = gpio_direction_output(USB_SWITCH_EN_GPIO, 0); if (rc) { pr_err("%s: gpio_direction_output failed for %d\n", __func__, USB_SWITCH_EN_GPIO); goto fail_gpio_usb_hub_reset; } /* Set direction of USB SWITCH CONTROL gpio */ rc = gpio_direction_output(USB_SWITCH_CNTL_GPIO, 0); if (rc) { pr_err("%s: gpio_direction_output failed for %d\n", __func__, USB_SWITCH_CNTL_GPIO); goto fail_gpio_usb_hub_reset; } /* Set direction of USB HUB RESET gpio */ rc = gpio_direction_output(USB_HUB_RESET_GPIO, 0); if (rc) { pr_err("%s: gpio_direction_output failed for %d\n", __func__, USB_HUB_RESET_GPIO); goto fail_gpio_usb_hub_reset; } return rc; } fail_gpio_usb_hub_reset: gpio_free(USB_HUB_RESET_GPIO); fail_gpio_usb_switch_cntl: gpio_free(USB_SWITCH_CNTL_GPIO); fail_gpio_usb_switch_en: gpio_free(USB_SWITCH_EN_GPIO); return rc; } static void msm_otg_setup_analog_switch_gpio(enum usb_switch_control mode) { switch (mode) { case USB_SWITCH_HOST: /* Configure analog switch as USB host. */ gpio_set_value(USB_SWITCH_EN_GPIO, 0); gpio_set_value(USB_SWITCH_CNTL_GPIO, 0); /* Bring HUB out of RESET */ gpio_set_value(USB_HUB_RESET_GPIO, 1); break; case USB_SWITCH_PERIPHERAL: /* Configure analog switch as USB peripheral. */ gpio_set_value(USB_SWITCH_EN_GPIO, 0); gpio_set_value(USB_SWITCH_CNTL_GPIO, 1); gpio_set_value(USB_HUB_RESET_GPIO, 0); break; case USB_SWITCH_DISABLE: default: /* Disable Switch */ gpio_set_value(USB_SWITCH_EN_GPIO, 1); gpio_set_value(USB_HUB_RESET_GPIO, 0); } } static struct msm_otg_platform_data msm_otg_pdata = { /* if usb link is in sps there is no need for * usb pclk as dayatona fabric clock will be * used instead */ .pclk_src_name = "dfab_usb_hs_clk", .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT, .cdr_autoreset = CDR_AUTO_RESET_DISABLE, .se1_gating = SE1_GATING_DISABLE, #ifdef CONFIG_USB_EHCI_MSM_72K .vbus_power = msm_hsusb_vbus_power, #endif .ldo_init = msm_hsusb_ldo_init, .ldo_enable = msm_hsusb_ldo_enable, .config_vddcx = msm_hsusb_config_vddcx, .init_vddcx = msm_hsusb_init_vddcx, .otg_mode = OTG_USER_CONTROL, .usb_mode = USB_PERIPHERAL_MODE, .init_gpio = msm_otg_init_analog_switch_gpio, .setup_gpio = msm_otg_setup_analog_switch_gpio, }; #endif #ifdef CONFIG_USB_ANDROID static char *usb_functions_default[] = { "diag", "modem", "nmea", "rmnet", "usb_mass_storage", }; static char *usb_functions_default_adb[] = { "diag", "adb", "modem", "nmea", "rmnet", "usb_mass_storage", }; static char *usb_functions_rndis[] = { "rndis", }; static char *usb_functions_rndis_adb[] = { "rndis", "adb", }; static char *usb_functions_all[] = { #ifdef CONFIG_USB_ANDROID_RNDIS "rndis", #endif #ifdef CONFIG_USB_ANDROID_DIAG "diag", #endif "adb", #ifdef CONFIG_USB_F_SERIAL "modem", "nmea", #endif #ifdef CONFIG_USB_ANDROID_RMNET "rmnet", #endif "usb_mass_storage", #ifdef CONFIG_USB_ANDROID_ACM "acm", #endif }; static struct android_usb_product usb_products[] = { { .product_id = 0x9026, .num_functions = ARRAY_SIZE(usb_functions_default), .functions = usb_functions_default, }, { .product_id = 0x9025, .num_functions = ARRAY_SIZE(usb_functions_default_adb), .functions = usb_functions_default_adb, }, { .product_id = 0xf00e, .num_functions = ARRAY_SIZE(usb_functions_rndis), .functions = usb_functions_rndis, }, { .product_id = 0x9024, .num_functions = ARRAY_SIZE(usb_functions_rndis_adb), .functions = usb_functions_rndis_adb, }, }; static struct usb_mass_storage_platform_data mass_storage_pdata = { .nluns = 1, .vendor = "Qualcomm Incorporated", .product = "Mass storage", }; static struct platform_device usb_mass_storage_device = { .name = "usb_mass_storage", .id = -1, .dev = { .platform_data = &mass_storage_pdata, }, }; static struct usb_ether_platform_data rndis_pdata = { /* ethaddr is filled by board_serialno_setup */ .vendorID = 0x05C6, .vendorDescr = "Qualcomm Incorporated", }; static struct platform_device rndis_device = { .name = "rndis", .id = -1, .dev = { .platform_data = &rndis_pdata, }, }; static struct android_usb_platform_data android_usb_pdata = { .vendor_id = 0x05C6, .product_id = 0x9026, .version = 0x0100, .product_name = "Qualcomm HSUSB Device", .manufacturer_name = "Qualcomm Incorporated", .num_products = ARRAY_SIZE(usb_products), .products = usb_products, .num_functions = ARRAY_SIZE(usb_functions_all), .functions = usb_functions_all, .serial_number = "1234567890ABCDEF", }; static struct platform_device android_usb_device = { .name = "android_usb", .id = -1, .dev = { .platform_data = &android_usb_pdata, }, }; static int __init board_serialno_setup(char *serialno) { int i; char *src = serialno; /* create a fake MAC address from our serial number. * first byte is 0x02 to signify locally administered. */ rndis_pdata.ethaddr[0] = 0x02; for (i = 0; *src; i++) { /* XOR the USB serial across the remaining bytes */ rndis_pdata.ethaddr[i % (ETH_ALEN - 1) + 1] ^= *src++; } android_usb_pdata.serial_number = serialno; return 1; } __setup("androidboot.serialno=", board_serialno_setup); #endif #ifdef CONFIG_MSM_VPE static struct resource msm_vpe_resources[] = { { .start = 0x05300000, .end = 0x05300000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, { .start = INT_VPE, .end = INT_VPE, .flags = IORESOURCE_IRQ, }, }; static struct platform_device msm_vpe_device = { .name = "msm_vpe", .id = 0, .num_resources = ARRAY_SIZE(msm_vpe_resources), .resource = msm_vpe_resources, }; #endif #ifdef CONFIG_MSM_CAMERA static int msm_cam_gpio_tbl[] = { 32,/*CAMIF_MCLK*/ 47,/*CAMIF_I2C_DATA*/ 48,/*CAMIF_I2C_CLK*/ 105,/*STANDBY*/ }; enum msm_cam_stat{ MSM_CAM_OFF, MSM_CAM_ON, }; static int config_gpio_table(enum msm_cam_stat stat) { int rc = 0, i = 0; if (stat == MSM_CAM_ON) { for (i = 0; i < ARRAY_SIZE(msm_cam_gpio_tbl); i++) { rc = gpio_request(msm_cam_gpio_tbl[i], "CAM_GPIO"); if (unlikely(rc < 0)) { pr_err("%s not able to get gpio\n", __func__); for (i--; i >= 0; i--) gpio_free(msm_cam_gpio_tbl[i]); break; } } } else { for (i = 0; i < ARRAY_SIZE(msm_cam_gpio_tbl); i++) gpio_free(msm_cam_gpio_tbl[i]); } return rc; } static int config_camera_on_gpios(void) { int rc = 0; rc = config_gpio_table(MSM_CAM_ON); if (rc < 0) { printk(KERN_ERR "%s: CAMSENSOR gpio table request" "failed\n", __func__); return rc; } return rc; } static void config_camera_off_gpios(void) { config_gpio_table(MSM_CAM_OFF); } static int config_camera_on_gpios_web_cam(void) { int rc = 0; rc = config_gpio_table(MSM_CAM_ON); if (rc < 0) { printk(KERN_ERR "%s: CAMSENSOR gpio table request" "failed\n", __func__); return rc; } rc = gpio_request(GPIO_WEB_CAMIF_STANDBY, "CAM_EN"); if (rc < 0) { config_gpio_table(MSM_CAM_OFF); pr_err(KERN_ERR "%s: CAMSENSOR gpio %d request" "failed\n", __func__, GPIO_WEB_CAMIF_STANDBY); return rc; } gpio_direction_output(GPIO_WEB_CAMIF_STANDBY, 0); return rc; } static void config_camera_off_gpios_web_cam(void) { config_gpio_table(MSM_CAM_OFF); gpio_set_value_cansleep(GPIO_WEB_CAMIF_STANDBY, 1); gpio_free(GPIO_WEB_CAMIF_STANDBY); } static struct msm_camera_device_platform_data msm_camera_device_data = { .camera_gpio_on = config_camera_on_gpios, .camera_gpio_off = config_camera_off_gpios, .ioext.csiphy = 0x04800000, .ioext.csisz = 0x00000400, .ioext.csiirq = CSI_0_IRQ, .ioclk.mclk_clk_rate = 24000000, .ioclk.vfe_clk_rate = 228570000, }; static struct msm_camera_device_platform_data msm_camera_device_data_web_cam = { .camera_gpio_on = config_camera_on_gpios_web_cam, .camera_gpio_off = config_camera_off_gpios_web_cam, .ioext.csiphy = 0x04900000, .ioext.csisz = 0x00000400, .ioext.csiirq = CSI_1_IRQ, .ioclk.mclk_clk_rate = 24000000, .ioclk.vfe_clk_rate = 228570000, }; static struct resource msm_camera_resources[] = { { .start = 0x04500000, .end = 0x04500000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, { .start = VFE_IRQ, .end = VFE_IRQ, .flags = IORESOURCE_IRQ, }, }; #ifdef CONFIG_MSM_CAMERA_FLASH static struct msm_camera_sensor_flash_src msm_flash_src = { .flash_sr_type = MSM_CAMERA_FLASH_SRC_PMIC, ._fsrc.pmic_src.num_of_src = 2, ._fsrc.pmic_src.low_current = 100, ._fsrc.pmic_src.high_current = 300, ._fsrc.pmic_src.led_src_1 = PMIC8058_ID_FLASH_LED_0, ._fsrc.pmic_src.led_src_2 = PMIC8058_ID_FLASH_LED_1, ._fsrc.pmic_src.pmic_set_current = pm8058_set_flash_led_current, }; #endif #ifdef CONFIG_MT9E013 static struct msm_camera_sensor_flash_data flash_mt9e013 = { .flash_type = MSM_CAMERA_FLASH_LED, .flash_src = &msm_flash_src }; static struct msm_camera_sensor_info msm_camera_sensor_mt9e013_data = { .sensor_name = "mt9e013", .sensor_reset = GPIO_AUX_CAM_2P7_EN, .sensor_pwd = 85, .vcm_pwd = 1, .vcm_enable = 1, .pdata = &msm_camera_device_data, .resource = msm_camera_resources, .num_resources = ARRAY_SIZE(msm_camera_resources), .flash_data = &flash_mt9e013, .csi_if = 1 }; static struct platform_device msm_camera_sensor_mt9e013 = { .name = "msm_camera_mt9e013", .dev = { .platform_data = &msm_camera_sensor_mt9e013_data, }, }; #endif #ifdef CONFIG_WEBCAM_OV9726 static struct msm_camera_sensor_flash_data flash_ov9726 = { .flash_type = MSM_CAMERA_FLASH_LED, .flash_src = &msm_flash_src }; static struct msm_camera_sensor_info msm_camera_sensor_ov9726_data = { .sensor_name = "ov9726", .sensor_reset = 106, .sensor_pwd = 85, .vcm_pwd = 1, .vcm_enable = 0, .pdata = &msm_camera_device_data_web_cam, .resource = msm_camera_resources, .num_resources = ARRAY_SIZE(msm_camera_resources), .flash_data = &flash_ov9726, .csi_if = 1 }; static struct platform_device msm_camera_sensor_webcam_ov9726 = { .name = "msm_camera_ov9726", .dev = { .platform_data = &msm_camera_sensor_ov9726_data, }, }; #endif #ifdef CONFIG_WEBCAM_OV7692 static struct msm_camera_sensor_flash_data flash_ov7692 = { .flash_type = MSM_CAMERA_FLASH_LED, .flash_src = &msm_flash_src }; static struct msm_camera_sensor_info msm_camera_sensor_ov7692_data = { .sensor_name = "ov7692", .sensor_reset = 106, .sensor_pwd = 85, .vcm_pwd = 1, .vcm_enable = 0, .pdata = &msm_camera_device_data_web_cam, .resource = msm_camera_resources, .num_resources = ARRAY_SIZE(msm_camera_resources), .flash_data = &flash_ov7692, .csi_if = 1 }; static struct platform_device msm_camera_sensor_webcam_ov7692 = { .name = "msm_camera_ov7692", .dev = { .platform_data = &msm_camera_sensor_ov7692_data, }, }; #endif static struct i2c_board_info msm_camera_boardinfo[] __initdata = { #ifdef CONFIG_MT9E013 { I2C_BOARD_INFO("mt9e013", 0x6C >> 2), }, #endif #ifdef CONFIG_WEBCAM_OV7692 { I2C_BOARD_INFO("ov7692", 0x78), }, #endif #ifdef CONFIG_WEBCAM_OV9726 { I2C_BOARD_INFO("ov9726", 0x10), }, #endif }; #endif #ifdef CONFIG_MSM_GEMINI static struct resource msm_gemini_resources[] = { { .start = 0x04600000, .end = 0x04600000 + SZ_1M - 1, .flags = IORESOURCE_MEM, }, { .start = INT_JPEG, .end = INT_JPEG, .flags = IORESOURCE_IRQ, }, }; static struct platform_device msm_gemini_device = { .name = "msm_gemini", .resource = msm_gemini_resources, .num_resources = ARRAY_SIZE(msm_gemini_resources), }; #endif #ifdef CONFIG_I2C_QUP static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type) { } static struct msm_i2c_platform_data msm_gsbi3_qup_i2c_pdata = { .clk_freq = 384000, .src_clk_rate = 24000000, .clk = "gsbi_qup_clk", .pclk = "gsbi_pclk", .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, }; static struct msm_i2c_platform_data msm_gsbi4_qup_i2c_pdata = { .clk_freq = 100000, .src_clk_rate = 24000000, .clk = "gsbi_qup_clk", .pclk = "gsbi_pclk", .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, }; static struct msm_i2c_platform_data msm_gsbi7_qup_i2c_pdata = { .clk_freq = 100000, .src_clk_rate = 24000000, .clk = "gsbi_qup_clk", .pclk = "gsbi_pclk", .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, }; static struct msm_i2c_platform_data msm_gsbi8_qup_i2c_pdata = { .clk_freq = 100000, .src_clk_rate = 24000000, .clk = "gsbi_qup_clk", .pclk = "gsbi_pclk", .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, }; static struct msm_i2c_platform_data msm_gsbi9_qup_i2c_pdata = { .clk_freq = 100000, .src_clk_rate = 24000000, .clk = "gsbi_qup_clk", .pclk = "gsbi_pclk", .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, }; static struct msm_i2c_platform_data msm_gsbi12_qup_i2c_pdata = { .clk_freq = 100000, .src_clk_rate = 24000000, .clk = "gsbi_qup_clk", .pclk = "gsbi_pclk", .use_gsbi_shared_mode = 1, .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, }; #endif #if defined(CONFIG_SPI_QUP) || defined(CONFIG_SPI_QUP_MODULE) static struct msm_spi_platform_data msm_gsbi1_qup_spi_pdata = { .max_clock_speed = 24000000, }; #endif #ifdef CONFIG_I2C_SSBI /* PMIC SSBI */ static struct msm_i2c_ssbi_platform_data msm_ssbi1_pdata = { .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, }; /* PMIC SSBI */ static struct msm_i2c_ssbi_platform_data msm_ssbi2_pdata = { .controller_type = MSM_SBI_CTRL_PMIC_ARBITER, }; /* CODEC/TSSC SSBI */ static struct msm_i2c_ssbi_platform_data msm_ssbi3_pdata = { .controller_type = MSM_SBI_CTRL_SSBI, }; #endif #ifdef CONFIG_FB_MSM_LCDC_DSUB /* VGA = 1440 x 900 x 4(bpp) x 2(pages) prim = 1024 x 600 x 4(bpp) x 2(pages) This is the difference. */ #define MSM_FB_DSUB_PMEM_ADDER (0x9E3400-0x4B0000) #else #define MSM_FB_DSUB_PMEM_ADDER (0) #endif #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL /* prim = 1376 x 768 x 4(bpp) x 2(pages) * hdmi = 1920 x 1080 x 2(bpp) x 1(page) * Note: must be multiple of 4096 */ #define MSM_FB_SIZE roundup(0x810000 + 0x3F4800 + MSM_FB_DSUB_PMEM_ADDER, 4096) #else /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ #define MSM_FB_SIZE roundup(0x810000 + MSM_FB_DSUB_PMEM_ADDER, 4096) #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ #define MSM_PMEM_SF_SIZE 0x4000000 /* 64 Mbytes */ #define MSM_PMEM_KERNEL_EBI1_SIZE 0x600000 #define MSM_PMEM_ADSP_SIZE 0x2000000 #define MSM_PMEM_AUDIO_SIZE 0x239000 #define MSM_SMI_BASE 0x38000000 /* Kernel SMI PMEM Region for video core, used for Firmware */ /* and encoder,decoder scratch buffers */ /* Kernel SMI PMEM Region Should always precede the user space */ /* SMI PMEM Region, as the video core will use offset address */ /* from the Firmware base */ #define PMEM_KERNEL_SMI_BASE (MSM_SMI_BASE) #define PMEM_KERNEL_SMI_SIZE 0x300000 /* User space SMI PMEM Region for video core*/ /* used for encoder, decoder input & output buffers */ #define MSM_PMEM_SMIPOOL_BASE (PMEM_KERNEL_SMI_BASE + PMEM_KERNEL_SMI_SIZE) #define MSM_PMEM_SMIPOOL_SIZE 0x3D00000 static unsigned fb_size = MSM_FB_SIZE; static int __init fb_size_setup(char *p) { fb_size = memparse(p, NULL); return 0; } early_param("fb_size", fb_size_setup); #ifdef CONFIG_KERNEL_PMEM_EBI_REGION static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; static int __init pmem_kernel_ebi1_size_setup(char *p) { pmem_kernel_ebi1_size = memparse(p, NULL); return 0; } early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); #endif #ifdef CONFIG_ANDROID_PMEM static unsigned pmem_sf_size = MSM_PMEM_SF_SIZE; static int __init pmem_sf_size_setup(char *p) { pmem_sf_size = memparse(p, NULL); return 0; } early_param("pmem_sf_size", pmem_sf_size_setup); static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; static int __init pmem_adsp_size_setup(char *p) { pmem_adsp_size = memparse(p, NULL); return 0; } early_param("pmem_adsp_size", pmem_adsp_size_setup); static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; static int __init pmem_audio_size_setup(char *p) { pmem_audio_size = memparse(p, NULL); return 0; } early_param("pmem_audio_size", pmem_audio_size_setup); #endif static struct resource msm_fb_resources[] = { { .flags = IORESOURCE_DMA, } }; static int msm_fb_detect_panel(const char *name) { if (!strcmp(name, "lcdc_chimei_lvds_wxga")) return 0; pr_warning("%s: not supported '%s'", __func__, name); return -ENODEV; } static struct msm_fb_platform_data msm_fb_pdata = { .detect_client = msm_fb_detect_panel, }; static struct platform_device msm_fb_device = { .name = "msm_fb", .id = 0, .num_resources = ARRAY_SIZE(msm_fb_resources), .resource = msm_fb_resources, .dev.platform_data = &msm_fb_pdata, }; #ifdef CONFIG_KERNEL_PMEM_EBI_REGION static struct android_pmem_platform_data android_pmem_kernel_ebi1_pdata = { .name = PMEM_KERNEL_EBI1_DATA_NAME, .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, .cached = 0, }; static struct platform_device android_pmem_kernel_ebi1_device = { .name = "android_pmem", .id = 1, .dev = { .platform_data = &android_pmem_kernel_ebi1_pdata }, }; #endif #ifdef CONFIG_KERNEL_PMEM_SMI_REGION static struct android_pmem_platform_data android_pmem_kernel_smi_pdata = { .name = PMEM_KERNEL_SMI_DATA_NAME, /* defaults to bitmap don't edit */ .cached = 0, }; static struct platform_device android_pmem_kernel_smi_device = { .name = "android_pmem", .id = 6, .dev = { .platform_data = &android_pmem_kernel_smi_pdata }, }; #endif #ifdef CONFIG_ANDROID_PMEM static struct android_pmem_platform_data android_pmem_pdata = { .name = "pmem", .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, .cached = 1, }; static struct platform_device android_pmem_device = { .name = "android_pmem", .id = 0, .dev = {.platform_data = &android_pmem_pdata}, }; static struct android_pmem_platform_data android_pmem_adsp_pdata = { .name = "pmem_adsp", .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, .cached = 0, }; static struct platform_device android_pmem_adsp_device = { .name = "android_pmem", .id = 2, .dev = { .platform_data = &android_pmem_adsp_pdata }, }; static struct android_pmem_platform_data android_pmem_audio_pdata = { .name = "pmem_audio", .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, .cached = 0, }; static struct platform_device android_pmem_audio_device = { .name = "android_pmem", .id = 4, .dev = { .platform_data = &android_pmem_audio_pdata }, }; static struct android_pmem_platform_data android_pmem_smipool_pdata = { .name = "pmem_smipool", .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, .cached = 0, }; static struct platform_device android_pmem_smipool_device = { .name = "android_pmem", .id = 7, .dev = { .platform_data = &android_pmem_smipool_pdata }, }; #endif #define GPIO_PM8058_LED_PWM 0 /* pm8058, gpio-24, channel 0 */ #define GPIO_PM8058_LED_EN 0 /* pm8058, gpio-1 */ #define GPIO_LVDS_PWR_DOWN 30 /* msm */ static int chimei_gpios[3] = { GPIO_PM8058_LED_PWM, PM8058_GPIO_PM_TO_SYS(GPIO_PM8058_LED_EN), GPIO_LVDS_PWR_DOWN }; static struct msm_panel_common_pdata lcdc_chimei_panel_data = { .gpio_num = chimei_gpios, }; static struct platform_device lcdc_chimei_panel_device = { .name = "lcdc_chimei_lvds_wxga", .id = 0, .dev = { .platform_data = &lcdc_chimei_panel_data, } }; #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL static struct resource hdmi_msm_resources[] = { { .name = "hdmi_msm_qfprom_addr", .start = 0x00700000, .end = 0x007060FF, .flags = IORESOURCE_MEM, }, { .name = "hdmi_msm_hdmi_addr", .start = 0x04A00000, .end = 0x04A00FFF, .flags = IORESOURCE_MEM, }, { .name = "hdmi_msm_irq", .start = HDMI_IRQ, .end = HDMI_IRQ, .flags = IORESOURCE_IRQ, }, }; static int hdmi_enable_5v(int on); static int hdmi_core_power(int on, int show); static int hdmi_cec_power(int on); static struct msm_hdmi_platform_data hdmi_msm_data = { .irq = HDMI_IRQ, .enable_5v = hdmi_enable_5v, .core_power = hdmi_core_power, .cec_power = hdmi_cec_power, }; static struct platform_device hdmi_msm_device = { .name = "hdmi_msm", .id = 0, .num_resources = ARRAY_SIZE(hdmi_msm_resources), .resource = hdmi_msm_resources, .dev.platform_data = &hdmi_msm_data, }; #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ static void __init msm8x60_allocate_memory_regions(void) { void *addr; unsigned long size; size = MSM_FB_SIZE; addr = alloc_bootmem(size); msm_fb_resources[0].start = __pa(addr); msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1; pr_info("allocating %lu bytes at %p (%lx physical) for fb\n", size, addr, __pa(addr)); #ifdef CONFIG_KERNEL_PMEM_EBI_REGION size = pmem_kernel_ebi1_size; if (size) { addr = alloc_bootmem_aligned(size, 0x100000); android_pmem_kernel_ebi1_pdata.start = __pa(addr); android_pmem_kernel_ebi1_pdata.size = size; pr_info("allocating %lu bytes at %p (%lx physical) for kernel" " ebi1 pmem arena\n", size, addr, __pa(addr)); } #endif #ifdef CONFIG_KERNEL_PMEM_SMI_REGION size = PMEM_KERNEL_SMI_SIZE; if (size) { android_pmem_kernel_smi_pdata.start = PMEM_KERNEL_SMI_BASE; android_pmem_kernel_smi_pdata.size = size; pr_info("allocating %lu bytes at %lx physical for kernel" " smi pmem arena\n", size, (unsigned long) PMEM_KERNEL_SMI_BASE); } #endif #ifdef CONFIG_ANDROID_PMEM size = pmem_adsp_size; if (size) { addr = alloc_bootmem(size); android_pmem_adsp_pdata.start = __pa(addr); android_pmem_adsp_pdata.size = size; pr_info("allocating %lu bytes at %p (%lx physical) for adsp " "pmem arena\n", size, addr, __pa(addr)); } size = MSM_PMEM_SMIPOOL_SIZE; if (size) { android_pmem_smipool_pdata.start = MSM_PMEM_SMIPOOL_BASE; android_pmem_smipool_pdata.size = size; pr_info("allocating %lu bytes at %lx physical for user" " smi pmem arena\n", size, (unsigned long) MSM_PMEM_SMIPOOL_BASE); } size = MSM_PMEM_AUDIO_SIZE; if (size) { addr = alloc_bootmem(size); android_pmem_audio_pdata.start = __pa(addr); android_pmem_audio_pdata.size = size; pr_info("allocating %lu bytes at %p (%lx physical) for audio " "pmem arena\n", size, addr, __pa(addr)); } size = pmem_sf_size; if (size) { addr = alloc_bootmem(size); android_pmem_pdata.start = __pa(addr); android_pmem_pdata.size = size; pr_info("allocating %lu bytes at %p (%lx physical) for sf " "pmem arena\n", size, addr, __pa(addr)); } #endif } #ifdef CONFIG_SERIAL_MSM_HS static int configure_uart_gpios(int on) { int ret = 0, i; int uart_gpios[] = {53, 54, 55, 56}; for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) { if (on) { ret = msm_gpiomux_get(uart_gpios[i]); if (unlikely(ret)) break; } else { ret = msm_gpiomux_put(uart_gpios[i]); if (unlikely(ret)) return ret; } } if (ret) for (; i >= 0; i--) msm_gpiomux_put(uart_gpios[i]); return ret; } static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = { .inject_rx_on_wakeup = 1, .rx_to_inject = 0xFD, .gpio_config = configure_uart_gpios, }; #endif #ifdef CONFIG_BATTERY_MSM8X60 static struct msm_charger_platform_data msm_charger_data = { .safety_time = 180, .update_time = 1, .max_voltage = 4200, .min_voltage = 3200, .resume_voltage = 4100, }; static struct platform_device msm_charger_device = { .name = "msm-charger", .id = -1, .dev = { .platform_data = &msm_charger_data, } }; #endif #if defined(CONFIG_MSM_RPM_LOG) || defined(CONFIG_MSM_RPM_LOG_MODULE) static struct msm_rpm_log_platform_data msm_rpm_log_pdata = { .phys_addr_base = 0x00106000, .reg_offsets = { [MSM_RPM_LOG_PAGE_INDICES] = 0x00000C80, [MSM_RPM_LOG_PAGE_BUFFER] = 0x00000CA0, }, .phys_size = SZ_8K, .log_len = 4096, /* log's buffer length in bytes */ .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */ }; static struct platform_device msm_rpm_log_device = { .name = "msm_rpm_log", .id = -1, .dev = { .platform_data = &msm_rpm_log_pdata, }, }; #endif static struct regulator_consumer_supply rpm_vreg_supply[RPM_VREG_ID_MAX] = { [RPM_VREG_ID_PM8058_L0] = REGULATOR_SUPPLY("8058_l0", NULL), [RPM_VREG_ID_PM8058_L1] = REGULATOR_SUPPLY("8058_l1", NULL), [RPM_VREG_ID_PM8058_L2] = REGULATOR_SUPPLY("8058_l2", NULL), [RPM_VREG_ID_PM8058_L3] = REGULATOR_SUPPLY("8058_l3", NULL), [RPM_VREG_ID_PM8058_L4] = REGULATOR_SUPPLY("8058_l4", NULL), [RPM_VREG_ID_PM8058_L5] = REGULATOR_SUPPLY("8058_l5", NULL), [RPM_VREG_ID_PM8058_L6] = REGULATOR_SUPPLY("8058_l6", NULL), [RPM_VREG_ID_PM8058_L7] = REGULATOR_SUPPLY("8058_l7", NULL), [RPM_VREG_ID_PM8058_L8] = REGULATOR_SUPPLY("8058_l8", NULL), [RPM_VREG_ID_PM8058_L9] = REGULATOR_SUPPLY("8058_l9", NULL), [RPM_VREG_ID_PM8058_L10] = REGULATOR_SUPPLY("8058_l10", NULL), [RPM_VREG_ID_PM8058_L11] = REGULATOR_SUPPLY("8058_l11", NULL), [RPM_VREG_ID_PM8058_L12] = REGULATOR_SUPPLY("8058_l12", NULL), [RPM_VREG_ID_PM8058_L13] = REGULATOR_SUPPLY("8058_l13", NULL), [RPM_VREG_ID_PM8058_L14] = REGULATOR_SUPPLY("8058_l14", NULL), [RPM_VREG_ID_PM8058_L15] = REGULATOR_SUPPLY("8058_l15", NULL), [RPM_VREG_ID_PM8058_L16] = REGULATOR_SUPPLY("8058_l16", NULL), [RPM_VREG_ID_PM8058_L17] = REGULATOR_SUPPLY("8058_l17", NULL), [RPM_VREG_ID_PM8058_L18] = REGULATOR_SUPPLY("8058_l18", NULL), [RPM_VREG_ID_PM8058_L19] = REGULATOR_SUPPLY("8058_l19", NULL), [RPM_VREG_ID_PM8058_L20] = REGULATOR_SUPPLY("8058_l20", NULL), [RPM_VREG_ID_PM8058_L21] = REGULATOR_SUPPLY("8058_l21", NULL), [RPM_VREG_ID_PM8058_L22] = REGULATOR_SUPPLY("8058_l22", NULL), [RPM_VREG_ID_PM8058_L23] = REGULATOR_SUPPLY("8058_l23", NULL), [RPM_VREG_ID_PM8058_L24] = REGULATOR_SUPPLY("8058_l24", NULL), [RPM_VREG_ID_PM8058_L25] = REGULATOR_SUPPLY("8058_l25", NULL), [RPM_VREG_ID_PM8058_S0] = REGULATOR_SUPPLY("8058_s0", NULL), [RPM_VREG_ID_PM8058_S1] = REGULATOR_SUPPLY("8058_s1", NULL), [RPM_VREG_ID_PM8058_S2] = REGULATOR_SUPPLY("8058_s2", NULL), [RPM_VREG_ID_PM8058_S3] = REGULATOR_SUPPLY("8058_s3", NULL), [RPM_VREG_ID_PM8058_S4] = REGULATOR_SUPPLY("8058_s4", NULL), [RPM_VREG_ID_PM8058_LVS0] = REGULATOR_SUPPLY("8058_lvs0", NULL), [RPM_VREG_ID_PM8058_LVS1] = REGULATOR_SUPPLY("8058_lvs1", NULL), [RPM_VREG_ID_PM8058_NCP] = REGULATOR_SUPPLY("8058_ncp", NULL), [RPM_VREG_ID_PM8901_L0] = REGULATOR_SUPPLY("8901_l0", NULL), [RPM_VREG_ID_PM8901_L1] = REGULATOR_SUPPLY("8901_l1", NULL), [RPM_VREG_ID_PM8901_L2] = REGULATOR_SUPPLY("8901_l2", NULL), [RPM_VREG_ID_PM8901_L3] = REGULATOR_SUPPLY("8901_l3", NULL), [RPM_VREG_ID_PM8901_L4] = REGULATOR_SUPPLY("8901_l4", NULL), [RPM_VREG_ID_PM8901_L5] = REGULATOR_SUPPLY("8901_l5", NULL), [RPM_VREG_ID_PM8901_L6] = REGULATOR_SUPPLY("8901_l6", NULL), [RPM_VREG_ID_PM8901_S2] = REGULATOR_SUPPLY("8901_s2", NULL), [RPM_VREG_ID_PM8901_S3] = REGULATOR_SUPPLY("8901_s3", NULL), [RPM_VREG_ID_PM8901_S4] = REGULATOR_SUPPLY("8901_s4", NULL), [RPM_VREG_ID_PM8901_LVS0] = REGULATOR_SUPPLY("8901_lvs0", NULL), [RPM_VREG_ID_PM8901_LVS1] = REGULATOR_SUPPLY("8901_lvs1", NULL), [RPM_VREG_ID_PM8901_LVS2] = REGULATOR_SUPPLY("8901_lvs2", NULL), [RPM_VREG_ID_PM8901_LVS3] = REGULATOR_SUPPLY("8901_lvs3", NULL), [RPM_VREG_ID_PM8901_MVS0] = REGULATOR_SUPPLY("8901_mvs0", NULL), }; #define RPM_VREG_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, \ _default_uV, _peak_uA, _avg_uA, _pull_down, _pin_ctrl, \ _freq, _pin_fn, _rpm_mode, _state, _sleep_selectable, \ _always_on) \ [RPM_VREG_ID_##_id] = { \ .init_data = { \ .constraints = { \ .valid_modes_mask = _modes, \ .valid_ops_mask = _ops, \ .min_uV = _min_uV, \ .max_uV = _max_uV, \ .input_uV = _min_uV, \ .apply_uV = _apply_uV, \ .always_on = _always_on, \ }, \ .num_consumer_supplies = 1, \ .consumer_supplies = \ &rpm_vreg_supply[RPM_VREG_ID_##_id], \ }, \ .default_uV = _default_uV, \ .peak_uA = _peak_uA, \ .avg_uA = _avg_uA, \ .pull_down_enable = _pull_down, \ .pin_ctrl = _pin_ctrl, \ .freq = _freq, \ .pin_fn = _pin_fn, \ .mode = _rpm_mode, \ .state = _state, \ .sleep_selectable = _sleep_selectable, \ } /* * The default LPM/HPM state of an RPM controlled regulator can be controlled * via the peak_uA value specified in the table below. If the value is less * than the high power min threshold for the regulator, then the regulator will * be set to LPM. Otherwise, it will be set to HPM. * * This value can be further overridden by specifying an initial mode via * .init_data.constraints.initial_mode. */ #define RPM_VREG_INIT_LDO(_id, _always_on, _pd, _sleep_selectable, _min_uV, \ _max_uV, _init_peak_uA, _pin_ctrl) \ RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_FAST | \ REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | \ REGULATOR_MODE_STANDBY, REGULATOR_CHANGE_VOLTAGE | \ REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ REGULATOR_CHANGE_DRMS, 0, _min_uV, _init_peak_uA, \ _init_peak_uA, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \ RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \ RPM_VREG_STATE_OFF, _sleep_selectable, _always_on) #define RPM_VREG_INIT_LDO_PF(_id, _always_on, _pd, _sleep_selectable, _min_uV, \ _max_uV, _init_peak_uA, _pin_ctrl, _pin_fn) \ RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_FAST | \ REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | \ REGULATOR_MODE_STANDBY, REGULATOR_CHANGE_VOLTAGE | \ REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ REGULATOR_CHANGE_DRMS, 0, _min_uV, _init_peak_uA, \ _init_peak_uA, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \ _pin_fn, RPM_VREG_MODE_NONE, RPM_VREG_STATE_OFF, \ _sleep_selectable, _always_on) #define RPM_VREG_INIT_SMPS(_id, _always_on, _pd, _sleep_selectable, _min_uV, \ _max_uV, _init_peak_uA, _pin_ctrl, _freq) \ RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_FAST | \ REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | \ REGULATOR_MODE_STANDBY, REGULATOR_CHANGE_VOLTAGE | \ REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE | \ REGULATOR_CHANGE_DRMS, 0, _min_uV, _init_peak_uA, \ _init_peak_uA, _pd, _pin_ctrl, _freq, \ RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \ RPM_VREG_STATE_OFF, _sleep_selectable, _always_on) #define RPM_VREG_INIT_VS(_id, _always_on, _pd, _sleep_selectable, _pin_ctrl) \ RPM_VREG_INIT(_id, 0, 0, REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE, \ REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE, 0, 0, \ 1000, 1000, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \ RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \ RPM_VREG_STATE_OFF, _sleep_selectable, _always_on) #define RPM_VREG_INIT_NCP(_id, _always_on, _pd, _sleep_selectable, _min_uV, \ _max_uV, _pin_ctrl) \ RPM_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL, \ REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, 0, \ _min_uV, 1000, 1000, _pd, _pin_ctrl, RPM_VREG_FREQ_NONE, \ RPM_VREG_PIN_FN_ENABLE, RPM_VREG_MODE_NONE, \ RPM_VREG_STATE_OFF, _sleep_selectable, _always_on) #define LDO50HMIN RPM_VREG_LDO_50_HPM_MIN_LOAD #define LDO150HMIN RPM_VREG_LDO_150_HPM_MIN_LOAD #define LDO300HMIN RPM_VREG_LDO_300_HPM_MIN_LOAD #define SMPS_HMIN RPM_VREG_SMPS_HPM_MIN_LOAD #define FTS_HMIN RPM_VREG_FTSMPS_HPM_MIN_LOAD static struct rpm_vreg_pdata rpm_vreg_init_pdata[RPM_VREG_ID_MAX] = { RPM_VREG_INIT_LDO_PF(PM8058_L0, 0, 1, 0, 1200000, 1200000, LDO150HMIN, RPM_VREG_PIN_CTRL_NONE, RPM_VREG_PIN_FN_SLEEP_B), RPM_VREG_INIT_LDO(PM8058_L1, 0, 1, 0, 1200000, 1200000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L2, 0, 1, 0, 1800000, 2600000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L3, 0, 1, 0, 1800000, 1800000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L4, 0, 1, 0, 2850000, 2850000, LDO50HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L5, 0, 1, 0, 2850000, 2850000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L6, 0, 1, 0, 3000000, 3600000, LDO50HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L7, 0, 1, 0, 1800000, 1800000, LDO50HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L8, 0, 1, 0, 2900000, 3050000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L9, 0, 1, 0, 1800000, 1800000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L10, 0, 1, 0, 2600000, 2600000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L11, 0, 1, 0, 1500000, 1500000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L12, 0, 1, 0, 2900000, 2900000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L13, 0, 1, 0, 2050000, 2050000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L14, 0, 0, 0, 2850000, 2850000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L15, 0, 1, 0, 2850000, 2850000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L16, 1, 1, 1, 1800000, 1800000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L17, 0, 1, 0, 2600000, 2600000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L18, 0, 1, 1, 2200000, 2200000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L19, 0, 1, 0, 2500000, 2500000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L20, 0, 1, 0, 1800000, 1800000, LDO150HMIN, 0), RPM_VREG_INIT_LDO_PF(PM8058_L21, 1, 1, 0, 1200000, 1200000, LDO150HMIN, RPM_VREG_PIN_CTRL_NONE, RPM_VREG_PIN_FN_SLEEP_B), RPM_VREG_INIT_LDO(PM8058_L22, 0, 1, 0, 1200000, 1200000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L23, 0, 1, 0, 1200000, 1200000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L24, 0, 1, 0, 1200000, 1200000, LDO150HMIN, 0), RPM_VREG_INIT_LDO(PM8058_L25, 0, 1, 0, 1200000, 1200000, LDO150HMIN, 0), RPM_VREG_INIT_SMPS(PM8058_S0, 0, 1, 1, 500000, 1200000, SMPS_HMIN, 0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_SMPS(PM8058_S1, 0, 1, 1, 500000, 1200000, SMPS_HMIN, 0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_SMPS(PM8058_S2, 0, 1, 0, 1200000, 1400000, SMPS_HMIN, RPM_VREG_PIN_CTRL_A0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_SMPS(PM8058_S3, 1, 1, 0, 1800000, 1800000, SMPS_HMIN, 0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_SMPS(PM8058_S4, 1, 1, 0, 2200000, 2200000, SMPS_HMIN, 0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_VS(PM8058_LVS0, 0, 1, 0, 0), RPM_VREG_INIT_VS(PM8058_LVS1, 0, 1, 0, 0), RPM_VREG_INIT_NCP(PM8058_NCP, 0, 1, 0, 1800000, 1800000, 0), RPM_VREG_INIT_LDO(PM8901_L0, 0, 1, 0, 1200000, 1200000, LDO300HMIN, RPM_VREG_PIN_CTRL_A0), RPM_VREG_INIT_LDO(PM8901_L1, 0, 1, 0, 3300000, 3300000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8901_L2, 0, 1, 0, 2850000, 3300000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8901_L3, 0, 1, 0, 3300000, 3300000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8901_L4, 0, 1, 0, 2600000, 2600000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8901_L5, 0, 1, 0, 2850000, 2850000, LDO300HMIN, 0), RPM_VREG_INIT_LDO(PM8901_L6, 0, 1, 0, 2200000, 2200000, LDO300HMIN, 0), RPM_VREG_INIT_SMPS(PM8901_S2, 0, 1, 0, 1300000, 1300000, FTS_HMIN, 0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_SMPS(PM8901_S3, 0, 1, 0, 1100000, 1100000, FTS_HMIN, 0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_SMPS(PM8901_S4, 0, 1, 0, 1225000, 1225000, FTS_HMIN, RPM_VREG_PIN_CTRL_A0, RPM_VREG_FREQ_1p60), RPM_VREG_INIT_VS(PM8901_LVS0, 1, 1, 0, 0), RPM_VREG_INIT_VS(PM8901_LVS1, 0, 1, 0, 0), RPM_VREG_INIT_VS(PM8901_LVS2, 0, 1, 0, 0), RPM_VREG_INIT_VS(PM8901_LVS3, 0, 1, 0, 0), RPM_VREG_INIT_VS(PM8901_MVS0, 0, 1, 0, 0), }; #define RPM_VREG(_id) \ [_id] = { \ .name = "rpm-regulator", \ .id = _id, \ .dev = { \ .platform_data = &rpm_vreg_init_pdata[_id], \ }, \ } static struct platform_device rpm_vreg_device[RPM_VREG_ID_MAX] = { RPM_VREG(RPM_VREG_ID_PM8058_L0), RPM_VREG(RPM_VREG_ID_PM8058_L1), RPM_VREG(RPM_VREG_ID_PM8058_L2), RPM_VREG(RPM_VREG_ID_PM8058_L3), RPM_VREG(RPM_VREG_ID_PM8058_L4), RPM_VREG(RPM_VREG_ID_PM8058_L5), RPM_VREG(RPM_VREG_ID_PM8058_L6), RPM_VREG(RPM_VREG_ID_PM8058_L7), RPM_VREG(RPM_VREG_ID_PM8058_L8), RPM_VREG(RPM_VREG_ID_PM8058_L9), RPM_VREG(RPM_VREG_ID_PM8058_L10), RPM_VREG(RPM_VREG_ID_PM8058_L11), RPM_VREG(RPM_VREG_ID_PM8058_L12), RPM_VREG(RPM_VREG_ID_PM8058_L13), RPM_VREG(RPM_VREG_ID_PM8058_L14), RPM_VREG(RPM_VREG_ID_PM8058_L15), RPM_VREG(RPM_VREG_ID_PM8058_L16), RPM_VREG(RPM_VREG_ID_PM8058_L17), RPM_VREG(RPM_VREG_ID_PM8058_L18), RPM_VREG(RPM_VREG_ID_PM8058_L19), RPM_VREG(RPM_VREG_ID_PM8058_L20), RPM_VREG(RPM_VREG_ID_PM8058_L21), RPM_VREG(RPM_VREG_ID_PM8058_L22), RPM_VREG(RPM_VREG_ID_PM8058_L23), RPM_VREG(RPM_VREG_ID_PM8058_L24), RPM_VREG(RPM_VREG_ID_PM8058_L25), RPM_VREG(RPM_VREG_ID_PM8058_S0), RPM_VREG(RPM_VREG_ID_PM8058_S1), RPM_VREG(RPM_VREG_ID_PM8058_S2), RPM_VREG(RPM_VREG_ID_PM8058_S3), RPM_VREG(RPM_VREG_ID_PM8058_S4), RPM_VREG(RPM_VREG_ID_PM8058_LVS0), RPM_VREG(RPM_VREG_ID_PM8058_LVS1), RPM_VREG(RPM_VREG_ID_PM8058_NCP), RPM_VREG(RPM_VREG_ID_PM8901_L0), RPM_VREG(RPM_VREG_ID_PM8901_L1), RPM_VREG(RPM_VREG_ID_PM8901_L2), RPM_VREG(RPM_VREG_ID_PM8901_L3), RPM_VREG(RPM_VREG_ID_PM8901_L4), RPM_VREG(RPM_VREG_ID_PM8901_L5), RPM_VREG(RPM_VREG_ID_PM8901_L6), RPM_VREG(RPM_VREG_ID_PM8901_S2), RPM_VREG(RPM_VREG_ID_PM8901_S3), RPM_VREG(RPM_VREG_ID_PM8901_S4), RPM_VREG(RPM_VREG_ID_PM8901_LVS0), RPM_VREG(RPM_VREG_ID_PM8901_LVS1), RPM_VREG(RPM_VREG_ID_PM8901_LVS2), RPM_VREG(RPM_VREG_ID_PM8901_LVS3), RPM_VREG(RPM_VREG_ID_PM8901_MVS0), }; static struct platform_device *early_regulators[] __initdata = { &msm_device_saw_s0, &msm_device_saw_s1, #ifdef CONFIG_PMIC8058 &rpm_vreg_device[RPM_VREG_ID_PM8058_S0], &rpm_vreg_device[RPM_VREG_ID_PM8058_S1], #endif }; static struct platform_device *early_devices[] __initdata = { #ifdef CONFIG_MSM_BUS_SCALING &msm_bus_apps_fabric, &msm_bus_sys_fabric, &msm_bus_mm_fabric, &msm_bus_sys_fpb, &msm_bus_cpss_fpb, #endif }; #if (defined(CONFIG_MARIMBA_CORE)) && \ (defined(CONFIG_MSM_BT_POWER) || defined(CONFIG_MSM_BT_POWER_MODULE)) static int bluetooth_power(int); static struct platform_device msm_bt_power_device = { .name = "bt_power", .id = -1, .dev = { .platform_data = &bluetooth_power, }, }; #endif static struct platform_device msm_tsens_device = { .name = "tsens-tm", .id = -1, }; #ifdef CONFIG_SENSORS_M_ADC static struct resource resources_adc[] = { { .start = PM8058_ADC_IRQ(PM8058_IRQ_BASE), .end = PM8058_ADC_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, }; static struct adc_access_fn xoadc_fn = { pm8058_xoadc_select_chan_and_start_conv, pm8058_xoadc_read_adc_code, pm8058_xoadc_get_properties, pm8058_xoadc_slot_request, pm8058_xoadc_restore_slot, pm8058_xoadc_calibrate, }; static struct msm_adc_channels msm_adc_channels_data[] = { {"vbatt", CHANNEL_ADC_VBATT, 0, &xoadc_fn, CHAN_PATH_TYPE2, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE3, scale_default}, {"vcoin", CHANNEL_ADC_VCOIN, 0, &xoadc_fn, CHAN_PATH_TYPE1, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE2, scale_default}, {"vcharger_channel", CHANNEL_ADC_VCHG, 0, &xoadc_fn, CHAN_PATH_TYPE3, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE4, scale_default}, {"charger_current_monitor", CHANNEL_ADC_CHG_MONITOR, 0, &xoadc_fn, CHAN_PATH_TYPE4, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE1, scale_default}, {"vph_pwr", CHANNEL_ADC_VPH_PWR, 0, &xoadc_fn, CHAN_PATH_TYPE5, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE3, scale_default}, {"usb_vbus", CHANNEL_ADC_USB_VBUS, 0, &xoadc_fn, CHAN_PATH_TYPE11, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE3, scale_default}, {"pmic_therm", CHANNEL_ADC_DIE_TEMP, 0, &xoadc_fn, CHAN_PATH_TYPE12, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE1, scale_pmic_therm}, {"pmic_therm_4K", CHANNEL_ADC_DIE_TEMP_4K, 0, &xoadc_fn, CHAN_PATH_TYPE12, ADC_CONFIG_TYPE1, ADC_CALIB_CONFIG_TYPE7, scale_pmic_therm}, {"xo_therm", CHANNEL_ADC_XOTHERM, 0, &xoadc_fn, CHAN_PATH_TYPE_NONE, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE5, tdkntcgtherm}, {"xo_therm_4K", CHANNEL_ADC_XOTHERM_4K, 0, &xoadc_fn, CHAN_PATH_TYPE_NONE, ADC_CONFIG_TYPE1, ADC_CALIB_CONFIG_TYPE6, tdkntcgtherm}, {"hdset_detect", CHANNEL_ADC_HDSET, 0, &xoadc_fn, CHAN_PATH_TYPE6, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE1, scale_default}, {"chg_batt_amon", CHANNEL_ADC_BATT_AMON, 0, &xoadc_fn, CHAN_PATH_TYPE10, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE1, scale_xtern_chgr_cur}, {"msm_therm", CHANNEL_ADC_MSM_THERM, 0, &xoadc_fn, CHAN_PATH_TYPE8, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE2, scale_msm_therm}, {"batt_therm", CHANNEL_ADC_BATT_THERM, 0, &xoadc_fn, CHAN_PATH_TYPE7, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE2, scale_batt_therm}, {"batt_id", CHANNEL_ADC_BATT_ID, 0, &xoadc_fn, CHAN_PATH_TYPE9, ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE2, scale_default}, }; static struct msm_adc_platform_data msm_adc_pdata = { .channel = msm_adc_channels_data, .num_chan_supported = ARRAY_SIZE(msm_adc_channels_data), }; static struct platform_device msm_adc_device = { .name = "msm_adc", .id = -1, .dev = { .platform_data = &msm_adc_pdata, }, }; static void pmic8058_xoadc_mpp_config(void) { int rc; rc = pm8901_mpp_config_digital_out(XOADC_MPP_4, PM8901_MPP_DIG_LEVEL_S4, PM_MPP_DOUT_CTL_LOW); if (rc) pr_err("%s: Config mpp4 on pmic 8901 failed\n", __func__); rc = pm8058_mpp_config_analog_input(XOADC_MPP_3, PM_MPP_AIN_AMUX_CH5, PM_MPP_AOUT_CTL_DISABLE); if (rc) pr_err("%s: Config mpp3 on pmic 8058 failed\n", __func__); rc = pm8058_mpp_config_analog_input(XOADC_MPP_5, PM_MPP_AIN_AMUX_CH9, PM_MPP_AOUT_CTL_DISABLE); if (rc) pr_err("%s: Config mpp5 on pmic 8058 failed\n", __func__); rc = pm8058_mpp_config_analog_input(XOADC_MPP_7, PM_MPP_AIN_AMUX_CH6, PM_MPP_AOUT_CTL_DISABLE); if (rc) pr_err("%s: Config mpp7 on pmic 8058 failed\n", __func__); rc = pm8058_mpp_config_analog_input(XOADC_MPP_8, PM_MPP_AIN_AMUX_CH8, PM_MPP_AOUT_CTL_DISABLE); if (rc) pr_err("%s: Config mpp8 on pmic 8058 failed\n", __func__); rc = pm8058_mpp_config_analog_input(XOADC_MPP_10, PM_MPP_AIN_AMUX_CH7, PM_MPP_AOUT_CTL_DISABLE); if (rc) pr_err("%s: Config mpp10 on pmic 8058 failed\n", __func__); } static int pmic8058_xoadc_rpm_vreg_config(int on) { int rc; rc = rpm_vreg_set_voltage(RPM_VREG_ID_PM8058_L18, RPM_VREG_VOTER3, (on ? 2200000 : 0), 0); return rc; } /* usec. For this ADC, * this time represents clk rate @ txco w/ 1024 decimation ratio. * Each channel has different configuration, thus at the time of starting * the conversion, xoadc will return actual conversion time * */ static struct adc_properties pm8058_xoadc_data = { .adc_reference = 2200, /* milli-voltage for this adc */ .bitresolution = 15, .bipolar = 0, .conversiontime = 54, }; static struct xoadc_platform_data xoadc_pdata = { .xoadc_prop = &pm8058_xoadc_data, .xoadc_mpp_config = pmic8058_xoadc_mpp_config, .xoadc_vreg_set = pmic8058_xoadc_rpm_vreg_config, .xoadc_num = XOADC_PMIC_0, }; #endif #define QT_ATMEL_TS_GPIO_IRQ 61 #define QT_ATMEL_LDO_ENABLE_GPIO 69 #define ATMEL_I2C_NAME "maXTouch" static struct regulator *pm8901_l2; static int atmel_qt_platform_init(struct i2c_client *client) { int rc = -EINVAL; pm8901_l2 = regulator_get(NULL, "8901_l2"); if (IS_ERR(pm8901_l2)) { pr_err("%s: regulator get of 8901_l2 failed (%ld)\n", __func__, PTR_ERR(pm8901_l2)); rc = PTR_ERR(pm8901_l2); return rc; } rc = regulator_set_voltage(pm8901_l2, 3300000, 3300000); if (rc) { pr_err("%s: regulator_set_voltage of 8901_l2 failed(%d)\n", __func__, rc); goto reg_put; } rc = regulator_enable(pm8901_l2); if (rc) { pr_err("%s: regulator_enable of 8901_l2 failed(%d)\n", __func__, rc); goto reg_put; } /* configure touchscreen interrupt gpio */ rc = gpio_request(QT_ATMEL_TS_GPIO_IRQ, "atmel_irq_gpio"); if (rc) { pr_err("%s: unable to request gpio %d\n", __func__, QT_ATMEL_TS_GPIO_IRQ); goto reg_disable; } rc = gpio_direction_input(QT_ATMEL_TS_GPIO_IRQ); if (rc < 0) { pr_err("%s: unable to set the direction of gpio %d\n", __func__, QT_ATMEL_TS_GPIO_IRQ); goto free_gpio; } rc = gpio_request(QT_ATMEL_LDO_ENABLE_GPIO, "atmel_ldo_gpio"); if (rc) { pr_err("%s: unable to request gpio %d\n", __func__, QT_ATMEL_LDO_ENABLE_GPIO); goto free_gpio; } rc = gpio_direction_output(QT_ATMEL_LDO_ENABLE_GPIO, 1); if (rc < 0) { pr_err("%s: unable to set the direction of gpio %d\n", __func__, QT_ATMEL_LDO_ENABLE_GPIO); goto free_ldo_gpio; } return 0; free_ldo_gpio: gpio_free(QT_ATMEL_LDO_ENABLE_GPIO); free_gpio: gpio_free(QT_ATMEL_TS_GPIO_IRQ); reg_disable: regulator_disable(pm8901_l2); reg_put: regulator_put(pm8901_l2); return rc; } static int atmel_qt_platform_exit(struct i2c_client *client) { return 0; } static u8 atmel_qt_read_chg(void) { return gpio_get_value(QT_ATMEL_TS_GPIO_IRQ); } static u8 atmel_qt_valid_interrupt(void) { return !atmel_qt_read_chg(); } static struct mxt_platform_data atmel_qt_pdata = { .numtouch = 10, .init_platform_hw = atmel_qt_platform_init, .exit_platform_hw = atmel_qt_platform_exit, .max_x = 1366, .max_y = 768, .valid_interrupt = atmel_qt_valid_interrupt, .read_chg = atmel_qt_read_chg, }; static struct i2c_board_info atmel_i2c_info[] __initdata = { { I2C_BOARD_INFO(ATMEL_I2C_NAME, 0x4c), .platform_data = &atmel_qt_pdata, .irq = MSM_GPIO_TO_INT(QT_ATMEL_TS_GPIO_IRQ), }, }; #define LOCK_KEY_GPIO 67 static struct gpio_keys_button gpio_keys_buttons[] = { { .code = KEY_SCREENLOCK, .gpio = LOCK_KEY_GPIO, .desc = "lock_key", .active_low = 1, .type = EV_KEY, .wakeup = 1 }, }; static struct gpio_keys_platform_data gpio_keys_data = { .buttons = gpio_keys_buttons, .nbuttons = ARRAY_SIZE(gpio_keys_buttons), .rep = 0, }; static struct platform_device qt_gpio_keys = { .name = "gpio-keys", .id = -1, .dev = { .platform_data = &gpio_keys_data, }, }; static const unsigned int qt_keymap[] = { KEY(0, 3, KEY_VOLUMEDOWN), KEY(1, 3, KEY_VOLUMEUP), KEY(2, 3, KEY_HOME), }; static struct matrix_keymap_data qt_keymap_data = { .keymap_size = ARRAY_SIZE(qt_keymap), .keymap = qt_keymap, }; static unsigned int qt_row_gpios[] = { PM8058_GPIO_PM_TO_SYS(8), PM8058_GPIO_PM_TO_SYS(9), PM8058_GPIO_PM_TO_SYS(10) }; static unsigned int qt_col_gpios[] = { PM8058_GPIO_PM_TO_SYS(3) }; static struct matrix_keypad_platform_data qt_keypad_data = { .keymap_data = &qt_keymap_data, .row_gpios = qt_row_gpios, .col_gpios = qt_col_gpios, .num_row_gpios = ARRAY_SIZE(qt_row_gpios), .num_col_gpios = ARRAY_SIZE(qt_col_gpios), .col_scan_delay_us = 32000, .debounce_ms = 10, .wakeup = 1, .active_low = 1, .no_autorepeat = 1, }; static struct platform_device qt_keypad_device = { .name = "matrix-keypad", .id = -1, .dev = { .platform_data = &qt_keypad_data, }, }; static struct platform_device *qt_devices[] __initdata = { &msm_device_smd, &msm_device_uart_dm12, &msm_device_dmov_adm0, &msm_device_dmov_adm1, #ifdef CONFIG_I2C_QUP &msm_gsbi3_qup_i2c_device, &msm_gsbi4_qup_i2c_device, &msm_gsbi7_qup_i2c_device, &msm_gsbi8_qup_i2c_device, &msm_gsbi9_qup_i2c_device, #endif #if defined(CONFIG_SPI_QUP) || defined(CONFIG_SPI_QUP_MODULE) &msm_gsbi1_qup_spi_device, #endif #ifdef CONFIG_SERIAL_MSM_HS &msm_device_uart_dm1, #endif #ifdef CONFIG_I2C_SSBI &msm_device_ssbi1, &msm_device_ssbi2, &msm_device_ssbi3, #endif #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_HCD) &msm_device_otg, #endif #ifdef CONFIG_USB_GADGET_MSM_72K &msm_device_gadget_peripheral, #endif #ifdef CONFIG_USB_ANDROID &usb_mass_storage_device, &rndis_device, #ifdef CONFIG_USB_ANDROID_DIAG &usb_diag_device, #endif #ifdef CONFIG_USB_F_SERIAL &usb_gadget_fserial_device, #endif &android_usb_device, #endif #ifdef CONFIG_KERNEL_PMEM_EBI_REGION &android_pmem_kernel_ebi1_device, #endif #ifdef CONFIG_KERNEL_PMEM_SMI_REGION &android_pmem_kernel_smi_device, #endif #ifdef CONFIG_ANDROID_PMEM &android_pmem_device, &android_pmem_adsp_device, &android_pmem_audio_device, &android_pmem_smipool_device, #endif #ifdef CONFIG_MSM_ROTATOR &msm_rotator_device, #endif &msm_fb_device, &msm_kgsl_3d0, #ifdef CONFIG_MSM_KGSL_2D &msm_kgsl_2d0, &msm_kgsl_2d1, #endif &lcdc_chimei_panel_device, #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL &hdmi_msm_device, #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ #ifdef CONFIG_MSM_CAMERA #ifdef CONFIG_MT9E013 &msm_camera_sensor_mt9e013, #endif #ifdef CONFIG_WEBCAM_OV7692 &msm_camera_sensor_webcam_ov7692, #endif #ifdef CONFIG_WEBCAM_OV9726 &msm_camera_sensor_webcam_ov9726, #endif #endif #ifdef CONFIG_MSM_GEMINI &msm_gemini_device, #endif #ifdef CONFIG_MSM_VPE &msm_vpe_device, #endif #if defined(CONFIG_MSM_RPM_LOG) || defined(CONFIG_MSM_RPM_LOG_MODULE) &msm_rpm_log_device, #endif &msm_device_vidc, #if (defined(CONFIG_MARIMBA_CORE)) && \ (defined(CONFIG_MSM_BT_POWER) || defined(CONFIG_MSM_BT_POWER_MODULE)) &msm_bt_power_device, #endif #ifdef CONFIG_SENSORS_M_ADC &msm_adc_device, #endif #ifdef CONFIG_PMIC8058 &rpm_vreg_device[RPM_VREG_ID_PM8058_L0], &rpm_vreg_device[RPM_VREG_ID_PM8058_L1], &rpm_vreg_device[RPM_VREG_ID_PM8058_L2], &rpm_vreg_device[RPM_VREG_ID_PM8058_L3], &rpm_vreg_device[RPM_VREG_ID_PM8058_L4], &rpm_vreg_device[RPM_VREG_ID_PM8058_L5], &rpm_vreg_device[RPM_VREG_ID_PM8058_L6], &rpm_vreg_device[RPM_VREG_ID_PM8058_L7], &rpm_vreg_device[RPM_VREG_ID_PM8058_L8], &rpm_vreg_device[RPM_VREG_ID_PM8058_L9], &rpm_vreg_device[RPM_VREG_ID_PM8058_L10], &rpm_vreg_device[RPM_VREG_ID_PM8058_L11], &rpm_vreg_device[RPM_VREG_ID_PM8058_L12], &rpm_vreg_device[RPM_VREG_ID_PM8058_L13], &rpm_vreg_device[RPM_VREG_ID_PM8058_L14], &rpm_vreg_device[RPM_VREG_ID_PM8058_L15], &rpm_vreg_device[RPM_VREG_ID_PM8058_L16], &rpm_vreg_device[RPM_VREG_ID_PM8058_L17], &rpm_vreg_device[RPM_VREG_ID_PM8058_L18], &rpm_vreg_device[RPM_VREG_ID_PM8058_L19], &rpm_vreg_device[RPM_VREG_ID_PM8058_L20], &rpm_vreg_device[RPM_VREG_ID_PM8058_L21], &rpm_vreg_device[RPM_VREG_ID_PM8058_L22], &rpm_vreg_device[RPM_VREG_ID_PM8058_L23], &rpm_vreg_device[RPM_VREG_ID_PM8058_L24], &rpm_vreg_device[RPM_VREG_ID_PM8058_L25], &rpm_vreg_device[RPM_VREG_ID_PM8058_S2], &rpm_vreg_device[RPM_VREG_ID_PM8058_S3], &rpm_vreg_device[RPM_VREG_ID_PM8058_S4], &rpm_vreg_device[RPM_VREG_ID_PM8058_LVS0], &rpm_vreg_device[RPM_VREG_ID_PM8058_LVS1], &rpm_vreg_device[RPM_VREG_ID_PM8058_NCP], #endif #ifdef CONFIG_PMIC8901 &rpm_vreg_device[RPM_VREG_ID_PM8901_L0], &rpm_vreg_device[RPM_VREG_ID_PM8901_L1], &rpm_vreg_device[RPM_VREG_ID_PM8901_L2], &rpm_vreg_device[RPM_VREG_ID_PM8901_L3], &rpm_vreg_device[RPM_VREG_ID_PM8901_L4], &rpm_vreg_device[RPM_VREG_ID_PM8901_L5], &rpm_vreg_device[RPM_VREG_ID_PM8901_L6], &rpm_vreg_device[RPM_VREG_ID_PM8901_S2], &rpm_vreg_device[RPM_VREG_ID_PM8901_S3], &rpm_vreg_device[RPM_VREG_ID_PM8901_S4], &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS0], &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS1], &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS2], &rpm_vreg_device[RPM_VREG_ID_PM8901_LVS3], &rpm_vreg_device[RPM_VREG_ID_PM8901_MVS0], #endif #ifdef CONFIG_HW_RANDOM_MSM &msm_device_rng, #endif &msm_tsens_device, &qt_gpio_keys, &qt_keypad_device, }; #ifdef CONFIG_PMIC8058 #define PMIC_GPIO_SDC3_DET 22 static int pm8058_kp_config_drv(int gpio_start, int num_gpios) { int rc; struct pm8058_gpio kypd_drv = { .direction = PM_GPIO_DIR_OUT, .output_buffer = PM_GPIO_OUT_BUF_OPEN_DRAIN, .output_value = 0, .pull = PM_GPIO_PULL_NO, .vin_sel = 2, .out_strength = PM_GPIO_STRENGTH_LOW, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 1, }; if (gpio_start < 0 || num_gpios < 0 || num_gpios > PM8058_GPIOS) return -EINVAL; while (num_gpios--) { rc = pm8058_gpio_config(gpio_start++, &kypd_drv); if (rc) { pr_err("%s: FAIL pm8058_gpio_config(): rc=%d.\n", __func__, rc); return rc; } } return 0; } static int pm8058_kp_config_sns(int gpio_start, int num_gpios) { int rc; struct pm8058_gpio kypd_sns = { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_UP_31P5, .vin_sel = 2, .out_strength = PM_GPIO_STRENGTH_NO, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 1, }; if (gpio_start < 0 || num_gpios < 0 || num_gpios > PM8058_GPIOS) return -EINVAL; while (num_gpios--) { rc = pm8058_gpio_config(gpio_start++, &kypd_sns); if (rc) { pr_err("%s: FAIL pm8058_gpio_config(): rc=%d.\n", __func__, rc); return rc; } } return 0; } static int pm8058_gpios_init(void) { int i; int rc; struct pm8058_gpio_cfg { int gpio; struct pm8058_gpio cfg; }; struct pm8058_gpio_cfg gpio_cfgs[] = { { /* chimei panel, led_en */ 0, { .direction = PM_GPIO_DIR_OUT, .output_value = 1, .output_buffer = PM_GPIO_OUT_BUF_CMOS, .pull = PM_GPIO_PULL_UP_30, .out_strength = PM_GPIO_STRENGTH_HIGH, .function = PM_GPIO_FUNC_NORMAL, .vin_sel = 2, .inv_int_pol = 0, } }, { /* FFA ethernet */ 6, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_DN, .vin_sel = 2, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, }, }, #ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION { PMIC_GPIO_SDC3_DET - 1, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_UP_30, .vin_sel = 2, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, }, }, #endif { /* core&surf gpio expander */ UI_INT1_N, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_NO, .vin_sel = PM_GPIO_VIN_S3, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, }, }, { /* docking gpio expander */ UI_INT2_N, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_NO, .vin_sel = PM_GPIO_VIN_S3, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, }, }, { /* FHA/keypad gpio expanders */ UI_INT3_N, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_NO, .vin_sel = PM_GPIO_VIN_S3, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, }, }, { /* TouchDisc Interrupt */ 5, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_UP_1P5, .vin_sel = 2, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, } }, { /* Timpani Reset */ 20, { .direction = PM_GPIO_DIR_OUT, .output_value = 1, .output_buffer = PM_GPIO_OUT_BUF_CMOS, .pull = PM_GPIO_PULL_DN, .out_strength = PM_GPIO_STRENGTH_HIGH, .function = PM_GPIO_FUNC_NORMAL, .vin_sel = 2, .inv_int_pol = 0, } }, { /* PMIC ID interrupt */ 36, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_UP_1P5, .function = PM_GPIO_FUNC_NORMAL, .vin_sel = 2, .inv_int_pol = 0, } }, }; #if defined(CONFIG_PMIC8058_OTHC) || defined(CONFIG_PMIC8058_OTHC_MODULE) struct pm8058_gpio_cfg line_in_gpio_cfg = { 18, { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_UP_1P5, .vin_sel = 2, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, } }; rc = pm8058_gpio_config(line_in_gpio_cfg.gpio, &line_in_gpio_cfg.cfg); if (rc < 0) { pr_err("%s pmic line_in gpio config failed\n", __func__); return rc; } #endif rc = pm8058_kp_config_sns(8, 3); rc = pm8058_kp_config_drv(3, 1); for (i = 0; i < ARRAY_SIZE(gpio_cfgs); ++i) { rc = pm8058_gpio_config(gpio_cfgs[i].gpio, &gpio_cfgs[i].cfg); if (rc < 0) { pr_err("%s pmic gpio config failed\n", __func__); return rc; } } return 0; } static struct resource resources_pwrkey[] = { { .start = PM8058_PWRKEY_REL_IRQ(PM8058_IRQ_BASE), .end = PM8058_PWRKEY_REL_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, { .start = PM8058_PWRKEY_PRESS_IRQ(PM8058_IRQ_BASE), .end = PM8058_PWRKEY_PRESS_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, }; static struct pmic8058_pwrkey_pdata pwrkey_pdata = { .pull_up = 1, .kpd_trigger_delay_us = 970, .wakeup = 1, .pwrkey_time_ms = 500, }; #if defined(CONFIG_PMIC8058_OTHC) || defined(CONFIG_PMIC8058_OTHC_MODULE) #define PM8058_OTHC_CNTR_BASE0 0xA0 #define PM8058_OTHC_CNTR_BASE1 0x134 #define PM8058_OTHC_CNTR_BASE2 0x137 #define PM8058_LINE_IN_DET_GPIO PM8058_GPIO_PM_TO_SYS(18) static struct othc_accessory_info othc_accessories[] = { { .accessory = OTHC_SVIDEO_OUT, .detect_flags = OTHC_MICBIAS_DETECT | OTHC_SWITCH_DETECT | OTHC_ADC_DETECT, .key_code = SW_VIDEOOUT_INSERT, .enabled = false, .adc_thres = { .min_threshold = 20, .max_threshold = 40, }, }, { .accessory = OTHC_ANC_HEADPHONE, .detect_flags = OTHC_MICBIAS_DETECT | OTHC_GPIO_DETECT | OTHC_SWITCH_DETECT, .gpio = PM8058_LINE_IN_DET_GPIO, .active_low = 1, .key_code = SW_HEADPHONE_INSERT, .enabled = true, }, { .accessory = OTHC_ANC_HEADSET, .detect_flags = OTHC_MICBIAS_DETECT | OTHC_GPIO_DETECT, .gpio = PM8058_LINE_IN_DET_GPIO, .active_low = 1, .key_code = SW_HEADPHONE_INSERT, .enabled = true, }, { .accessory = OTHC_HEADPHONE, .detect_flags = OTHC_MICBIAS_DETECT | OTHC_SWITCH_DETECT, .key_code = SW_HEADPHONE_INSERT, .enabled = true, }, { .accessory = OTHC_MICROPHONE, .detect_flags = OTHC_GPIO_DETECT, .gpio = PM8058_LINE_IN_DET_GPIO, .active_low = 1, .key_code = SW_MICROPHONE_INSERT, .enabled = true, }, { .accessory = OTHC_HEADSET, .detect_flags = OTHC_MICBIAS_DETECT, .key_code = SW_HEADPHONE_INSERT, .enabled = true, }, }; static struct othc_switch_info switch_info[] = { { .min_adc_threshold = 0, .max_adc_threshold = 100, .key_code = KEY_PLAYPAUSE, }, { .min_adc_threshold = 100, .max_adc_threshold = 200, .key_code = KEY_REWIND, }, { .min_adc_threshold = 200, .max_adc_threshold = 500, .key_code = KEY_FASTFORWARD, }, }; static struct othc_n_switch_config switch_config = { .voltage_settling_time_ms = 0, .num_adc_samples = 3, .adc_channel = CHANNEL_ADC_HDSET, .switch_info = switch_info, .num_keys = ARRAY_SIZE(switch_info), }; static struct hsed_bias_config hsed_bias_config = { /* HSED mic bias config info */ .othc_headset = OTHC_HEADSET_NO, .othc_lowcurr_thresh_uA = 100, .othc_highcurr_thresh_uA = 600, .othc_hyst_prediv_us = 7800, .othc_period_clkdiv_us = 62500, .othc_hyst_clk_us = 121000, .othc_period_clk_us = 312500, .othc_wakeup = 1, }; static struct othc_hsed_config hsed_config_1 = { .hsed_bias_config = &hsed_bias_config, .detection_delay_ms = 200, /* Switch info */ .switch_debounce_ms = 1000, .othc_support_n_switch = false, .switch_config = &switch_config, /* Accessory info */ .accessories_support = true, .accessories = othc_accessories, .othc_num_accessories = ARRAY_SIZE(othc_accessories), }; static struct othc_regulator_config othc_reg = { .regulator = "8058_l5", .max_uV = 2850000, .min_uV = 2850000, }; /* MIC_BIAS0 is configured as normal MIC BIAS */ static struct pmic8058_othc_config_pdata othc_config_pdata_0 = { .micbias_select = OTHC_MICBIAS_0, .micbias_capability = OTHC_MICBIAS, .micbias_enable = OTHC_SIGNAL_OFF, .micbias_regulator = &othc_reg, }; /* MIC_BIAS1 is configured as HSED_BIAS for OTHC */ static struct pmic8058_othc_config_pdata othc_config_pdata_1 = { .micbias_select = OTHC_MICBIAS_1, .micbias_capability = OTHC_MICBIAS_HSED, .micbias_enable = OTHC_SIGNAL_PWM_TCXO, .micbias_regulator = &othc_reg, .hsed_config = &hsed_config_1, .hsed_name = "8660_handset", }; /* MIC_BIAS2 is configured as normal MIC BIAS */ static struct pmic8058_othc_config_pdata othc_config_pdata_2 = { .micbias_select = OTHC_MICBIAS_2, .micbias_capability = OTHC_MICBIAS, .micbias_enable = OTHC_SIGNAL_OFF, .micbias_regulator = &othc_reg, }; static struct resource resources_othc_0[] = { { .name = "othc_base", .start = PM8058_OTHC_CNTR_BASE0, .end = PM8058_OTHC_CNTR_BASE0, .flags = IORESOURCE_IO, }, }; static struct resource resources_othc_1[] = { { .start = PM8058_SW_1_IRQ(PM8058_IRQ_BASE), .end = PM8058_SW_1_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, { .start = PM8058_IR_1_IRQ(PM8058_IRQ_BASE), .end = PM8058_IR_1_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, { .name = "othc_base", .start = PM8058_OTHC_CNTR_BASE1, .end = PM8058_OTHC_CNTR_BASE1, .flags = IORESOURCE_IO, }, }; static struct resource resources_othc_2[] = { { .name = "othc_base", .start = PM8058_OTHC_CNTR_BASE2, .end = PM8058_OTHC_CNTR_BASE2, .flags = IORESOURCE_IO, }, }; static void __init msm8x60_init_pm8058_othc(void) { if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) { /* 3-switch headset supported only by V2 FFA and FLUID */ hsed_config_1.accessories_adc_support = true, /* ADC based accessory detection works only on V2 and FLUID */ hsed_config_1.accessories_adc_channel = CHANNEL_ADC_HDSET, hsed_config_1.othc_support_n_switch = true; } } #endif static int pm8058_pwm_config(struct pwm_device *pwm, int ch, int on) { struct pm8058_gpio pwm_gpio_config = { .direction = PM_GPIO_DIR_OUT, .output_buffer = PM_GPIO_OUT_BUF_CMOS, .output_value = 0, .pull = PM_GPIO_PULL_NO, .vin_sel = PM_GPIO_VIN_VPH, .out_strength = PM_GPIO_STRENGTH_HIGH, .function = PM_GPIO_FUNC_2, }; int rc = -EINVAL; int id, mode, max_mA; id = mode = max_mA = 0; switch (ch) { case 0: case 1: case 2: if (on) { id = 24 + ch; rc = pm8058_gpio_config(id - 1, &pwm_gpio_config); if (rc) pr_err("%s: pm8058_gpio_config(%d): rc=%d\n", __func__, id, rc); } break; case 6: id = PM_PWM_LED_FLASH; mode = PM_PWM_CONF_PWM1; max_mA = 300; break; case 7: id = PM_PWM_LED_FLASH1; mode = PM_PWM_CONF_PWM1; max_mA = 300; break; default: break; } if (ch >= 6 && ch <= 7) { if (!on) { mode = PM_PWM_CONF_NONE; max_mA = 0; } rc = pm8058_pwm_config_led(pwm, id, mode, max_mA); if (rc) pr_err("%s: pm8058_pwm_config_led(ch=%d): rc=%d\n", __func__, ch, rc); } return rc; } static struct pm8058_pwm_pdata pm8058_pwm_data = { .config = pm8058_pwm_config, }; #define PM8058_GPIO_INT 88 static struct pm8058_gpio_platform_data pm8058_gpio_data = { .gpio_base = PM8058_GPIO_PM_TO_SYS(0), .irq_base = PM8058_GPIO_IRQ(PM8058_IRQ_BASE, 0), .init = pm8058_gpios_init, }; static struct pm8058_gpio_platform_data pm8058_mpp_data = { .gpio_base = PM8058_GPIO_PM_TO_SYS(PM8058_GPIOS), .irq_base = PM8058_MPP_IRQ(PM8058_IRQ_BASE, 0), }; static struct resource resources_rtc[] = { { .start = PM8058_RTC_IRQ(PM8058_IRQ_BASE), .end = PM8058_RTC_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, { .start = PM8058_RTC_ALARM_IRQ(PM8058_IRQ_BASE), .end = PM8058_RTC_ALARM_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, }; static struct resource resources_temp_alarm[] = { { .start = PM8058_TEMP_ALARM_IRQ(PM8058_IRQ_BASE), .end = PM8058_TEMP_ALARM_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, }; static struct resource resources_pm8058_misc[] = { { .start = PM8058_OSCHALT_IRQ(PM8058_IRQ_BASE), .end = PM8058_OSCHALT_IRQ(PM8058_IRQ_BASE), .flags = IORESOURCE_IRQ, }, }; static struct mfd_cell pm8058_subdevs[] = { { .name = "pm8058-gpio", .id = -1, .platform_data = &pm8058_gpio_data, .data_size = sizeof(pm8058_gpio_data), }, { .name = "pm8058-mpp", .id = -1, .platform_data = &pm8058_mpp_data, .data_size = sizeof(pm8058_mpp_data), }, { .name = "pm8058-pwrkey", .id = -1, .resources = resources_pwrkey, .num_resources = ARRAY_SIZE(resources_pwrkey), .platform_data = &pwrkey_pdata, .data_size = sizeof(pwrkey_pdata), }, { .name = "pm8058-pwm", .id = -1, .platform_data = &pm8058_pwm_data, .data_size = sizeof(pm8058_pwm_data), }, #ifdef CONFIG_SENSORS_M_ADC { .name = "pm8058-xoadc", .id = -1, .num_resources = ARRAY_SIZE(resources_adc), .resources = resources_adc, .platform_data = &xoadc_pdata, .data_size = sizeof(xoadc_pdata), }, #endif #if defined(CONFIG_PMIC8058_OTHC) || defined(CONFIG_PMIC8058_OTHC_MODULE) { .name = "pm8058-othc", .id = 0, .platform_data = &othc_config_pdata_0, .data_size = sizeof(othc_config_pdata_0), .num_resources = ARRAY_SIZE(resources_othc_0), .resources = resources_othc_0, }, { /* OTHC1 module has headset/switch dection */ .name = "pm8058-othc", .id = 1, .num_resources = ARRAY_SIZE(resources_othc_1), .resources = resources_othc_1, .platform_data = &othc_config_pdata_1, .data_size = sizeof(othc_config_pdata_1), }, { .name = "pm8058-othc", .id = 2, .platform_data = &othc_config_pdata_2, .data_size = sizeof(othc_config_pdata_2), .num_resources = ARRAY_SIZE(resources_othc_2), .resources = resources_othc_2, }, #endif { .name = "pm8058-rtc", .id = -1, .num_resources = ARRAY_SIZE(resources_rtc), .resources = resources_rtc, }, { .name = "pm8058-tm", .id = -1, .num_resources = ARRAY_SIZE(resources_temp_alarm), .resources = resources_temp_alarm, }, { .name = "pm8058-upl", .id = -1, }, { .name = "pm8058-misc", .id = -1, .num_resources = ARRAY_SIZE(resources_pm8058_misc), .resources = resources_pm8058_misc, }, }; static struct pm8058_platform_data pm8058_platform_data = { .irq_base = PM8058_IRQ_BASE, .num_subdevs = ARRAY_SIZE(pm8058_subdevs), .sub_devices = pm8058_subdevs, .irq_trigger_flags = IRQF_TRIGGER_LOW, }; static struct i2c_board_info pm8058_boardinfo[] __initdata = { { I2C_BOARD_INFO("pm8058-core", 0x55), .irq = MSM_GPIO_TO_INT(PM8058_GPIO_INT), .platform_data = &pm8058_platform_data, }, }; #endif /* CONFIG_PMIC8058 */ #define PM_GPIO_CDC_RST_N 20 #define GPIO_CDC_RST_N PM8058_GPIO_PM_TO_SYS(PM_GPIO_CDC_RST_N) static struct regulator *vreg_timpani_1; static struct regulator *vreg_timpani_2; static unsigned int msm_timpani_setup_power(void) { int rc; vreg_timpani_1 = regulator_get(NULL, "8058_l0"); if (IS_ERR(vreg_timpani_1)) { pr_err("%s: Unable to get 8058_l0\n", __func__); return -ENODEV; } vreg_timpani_2 = regulator_get(NULL, "8058_s3"); if (IS_ERR(vreg_timpani_2)) { pr_err("%s: Unable to get 8058_s3\n", __func__); regulator_put(vreg_timpani_1); return -ENODEV; } rc = regulator_set_voltage(vreg_timpani_1, 1200000, 1200000); if (rc) { pr_err("%s: unable to set L0 voltage to 1.2V\n", __func__); goto fail; } rc = regulator_set_voltage(vreg_timpani_2, 1800000, 1800000); if (rc) { pr_err("%s: unable to set S3 voltage to 1.8V\n", __func__); goto fail; } rc = regulator_enable(vreg_timpani_1); if (rc) { pr_err("%s: Enable regulator 8058_l0 failed\n", __func__); goto fail; } rc = regulator_enable(vreg_timpani_2); if (rc) { pr_err("%s: Enable regulator 8058_s3 failed\n", __func__); regulator_disable(vreg_timpani_1); goto fail; } rc = gpio_request(GPIO_CDC_RST_N, "CDC_RST_N"); if (rc) { pr_err("%s: GPIO Request %d failed\n", __func__, GPIO_CDC_RST_N); regulator_disable(vreg_timpani_1); regulator_disable(vreg_timpani_2); goto fail; } else { gpio_direction_output(GPIO_CDC_RST_N, 1); usleep_range(1000, 1050); gpio_direction_output(GPIO_CDC_RST_N, 0); usleep_range(1000, 1050); gpio_direction_output(GPIO_CDC_RST_N, 1); gpio_free(GPIO_CDC_RST_N); } return rc; fail: regulator_put(vreg_timpani_1); regulator_put(vreg_timpani_2); return rc; } static void msm_timpani_shutdown_power(void) { int rc; rc = regulator_disable(vreg_timpani_1); if (rc) pr_err("%s: Disable regulator 8058_l0 failed\n", __func__); regulator_put(vreg_timpani_1); rc = regulator_disable(vreg_timpani_2); if (rc) pr_err("%s: Disable regulator 8058_s3 failed\n", __func__); regulator_put(vreg_timpani_2); } /* Power analog function of codec */ static struct regulator *vreg_timpani_cdc_apwr; static int msm_timpani_codec_power(int vreg_on) { int rc = 0; if (!vreg_timpani_cdc_apwr) { vreg_timpani_cdc_apwr = regulator_get(NULL, "8058_s4"); if (IS_ERR(vreg_timpani_cdc_apwr)) { pr_err("%s: vreg_get failed (%ld)\n", __func__, PTR_ERR(vreg_timpani_cdc_apwr)); rc = PTR_ERR(vreg_timpani_cdc_apwr); return rc; } } if (vreg_on) { rc = regulator_set_voltage(vreg_timpani_cdc_apwr, 2200000, 2200000); if (rc) { pr_err("%s: unable to set 8058_s4 voltage to 2.2 V\n", __func__); goto vreg_fail; } rc = regulator_enable(vreg_timpani_cdc_apwr); if (rc) { pr_err("%s: vreg_enable failed %d\n", __func__, rc); goto vreg_fail; } } else { rc = regulator_disable(vreg_timpani_cdc_apwr); if (rc) { pr_err("%s: vreg_disable failed %d\n", __func__, rc); goto vreg_fail; } } return 0; vreg_fail: regulator_put(vreg_timpani_cdc_apwr); vreg_timpani_cdc_apwr = NULL; return rc; } static struct marimba_codec_platform_data timpani_codec_pdata = { .marimba_codec_power = msm_timpani_codec_power, }; #define TIMPANI_SLAVE_ID_CDC_ADDR 0X77 #define TIMPANI_SLAVE_ID_QMEMBIST_ADDR 0X66 static struct marimba_platform_data timpani_pdata = { .slave_id[MARIMBA_SLAVE_ID_CDC] = TIMPANI_SLAVE_ID_CDC_ADDR, .slave_id[MARIMBA_SLAVE_ID_QMEMBIST] = TIMPANI_SLAVE_ID_QMEMBIST_ADDR, .marimba_setup = msm_timpani_setup_power, .marimba_shutdown = msm_timpani_shutdown_power, .codec = &timpani_codec_pdata, }; #define TIMPANI_I2C_SLAVE_ADDR 0xD static struct i2c_board_info msm_i2c_gsbi7_timpani_info[] = { { I2C_BOARD_INFO("timpani", TIMPANI_I2C_SLAVE_ADDR), .platform_data = &timpani_pdata, }, }; #ifdef CONFIG_PMIC8901 #define PM8901_GPIO_INT 91 static struct pm8901_gpio_platform_data pm8901_mpp_data = { .gpio_base = PM8901_GPIO_PM_TO_SYS(0), .irq_base = PM8901_MPP_IRQ(PM8901_IRQ_BASE, 0), }; static struct resource pm8901_temp_alarm[] = { { .start = PM8901_TEMP_ALARM_IRQ(PM8901_IRQ_BASE), .end = PM8901_TEMP_ALARM_IRQ(PM8901_IRQ_BASE), .flags = IORESOURCE_IRQ, }, { .start = PM8901_TEMP_HI_ALARM_IRQ(PM8901_IRQ_BASE), .end = PM8901_TEMP_HI_ALARM_IRQ(PM8901_IRQ_BASE), .flags = IORESOURCE_IRQ, }, }; static struct regulator_consumer_supply pm8901_vreg_supply[PM8901_VREG_MAX] = { [PM8901_VREG_ID_MPP0] = REGULATOR_SUPPLY("8901_mpp0", NULL), [PM8901_VREG_ID_USB_OTG] = REGULATOR_SUPPLY("8901_usb_otg", NULL), [PM8901_VREG_ID_HDMI_MVS] = REGULATOR_SUPPLY("8901_hdmi_mvs", NULL), }; #define PM8901_VREG_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, \ _always_on, _active_high) \ [_id] = { \ .init_data = { \ .constraints = { \ .valid_modes_mask = _modes, \ .valid_ops_mask = _ops, \ .min_uV = _min_uV, \ .max_uV = _max_uV, \ .input_uV = _min_uV, \ .apply_uV = _apply_uV, \ .always_on = _always_on, \ }, \ .num_consumer_supplies = 1, \ .consumer_supplies = &pm8901_vreg_supply[_id], \ }, \ .active_high = _active_high, \ } #define PM8901_VREG_INIT_MPP(_id, _active_high) \ PM8901_VREG_INIT(_id, 0, 0, REGULATOR_MODE_NORMAL, \ REGULATOR_CHANGE_STATUS, 0, 0, _active_high) #define PM8901_VREG_INIT_VS(_id) \ PM8901_VREG_INIT(_id, 0, 0, REGULATOR_MODE_NORMAL, \ REGULATOR_CHANGE_STATUS, 0, 0, 0) static struct pm8901_vreg_pdata pm8901_vreg_init_pdata[PM8901_VREG_MAX] = { PM8901_VREG_INIT_MPP(PM8901_VREG_ID_MPP0, 1), PM8901_VREG_INIT_VS(PM8901_VREG_ID_USB_OTG), PM8901_VREG_INIT_VS(PM8901_VREG_ID_HDMI_MVS), }; #define PM8901_VREG(_id) { \ .name = "pm8901-regulator", \ .id = _id, \ .platform_data = &pm8901_vreg_init_pdata[_id], \ .data_size = sizeof(pm8901_vreg_init_pdata[_id]), \ } static struct mfd_cell pm8901_subdevs[] = { { .name = "pm8901-mpp", .id = -1, .platform_data = &pm8901_mpp_data, .data_size = sizeof(pm8901_mpp_data), }, { .name = "pm8901-tm", .id = -1, .num_resources = ARRAY_SIZE(pm8901_temp_alarm), .resources = pm8901_temp_alarm, }, PM8901_VREG(PM8901_VREG_ID_MPP0), PM8901_VREG(PM8901_VREG_ID_USB_OTG), PM8901_VREG(PM8901_VREG_ID_HDMI_MVS), }; static struct pm8901_platform_data pm8901_platform_data = { .irq_base = PM8901_IRQ_BASE, .num_subdevs = ARRAY_SIZE(pm8901_subdevs), .sub_devices = pm8901_subdevs, .irq_trigger_flags = IRQF_TRIGGER_LOW, }; static struct i2c_board_info pm8901_boardinfo[] __initdata = { { I2C_BOARD_INFO("pm8901-core", 0x55), .irq = MSM_GPIO_TO_INT(PM8901_GPIO_INT), .platform_data = &pm8901_platform_data, }, }; #endif /* CONFIG_PMIC8901 */ #if defined(CONFIG_MARIMBA_CORE) static struct regulator *vreg_bahama; static unsigned int msm_bahama_setup_power(void) { int rc = 0; const char *msm_bahama_regulator = "8058_s3"; vreg_bahama = regulator_get(NULL, msm_bahama_regulator); if (IS_ERR(vreg_bahama)) { rc = PTR_ERR(vreg_bahama); pr_err("%s: regulator_get %s = %d\n", __func__, msm_bahama_regulator, rc); goto unget; } rc = regulator_set_voltage(vreg_bahama, 1800000, 1800000); if (rc) { pr_err("%s: regulator_set_voltage %s = %d\n", __func__, msm_bahama_regulator, rc); goto unget; } rc = regulator_enable(vreg_bahama); if (rc) { pr_err("%s: regulator_enable %s = %d\n", __func__, msm_bahama_regulator, rc); goto unget; } rc = gpio_request(GPIO_MS_SYS_RESET_N, "bahama sys_rst_n"); if (rc) { pr_err("%s: gpio_request %d = %d\n", __func__, GPIO_MS_SYS_RESET_N, rc); goto unenable; } rc = gpio_direction_output(GPIO_MS_SYS_RESET_N, 1); if (rc) { pr_err("%s: gpio_direction_output %d = %d\n", __func__, GPIO_MS_SYS_RESET_N, rc); goto unrequest; } return rc; unrequest: gpio_free(GPIO_MS_SYS_RESET_N); unenable: regulator_disable(vreg_bahama); unget: regulator_put(vreg_bahama); vreg_bahama = NULL; return rc; }; static unsigned int msm_bahama_shutdown_power(int value) { if (vreg_bahama) { gpio_set_value(GPIO_MS_SYS_RESET_N, 0); gpio_free(GPIO_MS_SYS_RESET_N); regulator_disable(vreg_bahama); regulator_put(vreg_bahama); } return 0; }; static struct regulator *fm_regulator_s3; static struct msm_xo_voter *fm_clock; static int fm_radio_setup(struct marimba_fm_platform_data *pdata) { int rc = 0; struct pm8058_gpio cfg = { .direction = PM_GPIO_DIR_IN, .pull = PM_GPIO_PULL_NO, .vin_sel = PM_GPIO_VIN_S3, .function = PM_GPIO_FUNC_NORMAL, .inv_int_pol = 0, }; if (!fm_regulator_s3) { fm_regulator_s3 = regulator_get(NULL, "8058_s3"); if (IS_ERR(fm_regulator_s3)) { rc = PTR_ERR(fm_regulator_s3); printk(KERN_ERR "%s: regulator get s3 (%d)\n", __func__, rc); goto out; } } rc = regulator_set_voltage(fm_regulator_s3, 1800000, 1800000); if (rc < 0) { printk(KERN_ERR "%s: regulator set voltage failed (%d)\n", __func__, rc); goto fm_fail_put; } rc = regulator_enable(fm_regulator_s3); if (rc < 0) { printk(KERN_ERR "%s: regulator s3 enable failed (%d)\n", __func__, rc); goto fm_fail_put; } /*Vote for XO clock*/ fm_clock = msm_xo_get(MSM_XO_TCXO_D0, "fm_power"); if (IS_ERR(fm_clock)) { rc = PTR_ERR(fm_clock); printk(KERN_ERR "%s: Couldn't get TCXO_D0 vote for FM (%d)\n", __func__, rc); goto fm_fail_switch; } rc = msm_xo_mode_vote(fm_clock, MSM_XO_MODE_ON); if (rc < 0) { printk(KERN_ERR "%s: Failed to vote for TCX0_D0 ON (%d)\n", __func__, rc); goto fm_fail_vote; } /*GPIO 18 on PMIC is FM_IRQ*/ rc = pm8058_gpio_config(FM_GPIO, &cfg); if (rc) { printk(KERN_ERR "%s: return val of pm8058_gpio_config: %d\n", __func__, rc); goto fm_fail_clock; } goto out; fm_fail_clock: msm_xo_mode_vote(fm_clock, MSM_XO_MODE_OFF); fm_fail_vote: msm_xo_put(fm_clock); fm_fail_switch: regulator_disable(fm_regulator_s3); fm_fail_put: regulator_put(fm_regulator_s3); out: return rc; }; static void fm_radio_shutdown(struct marimba_fm_platform_data *pdata) { int rc = 0; if (fm_regulator_s3 != NULL) { rc = regulator_disable(fm_regulator_s3); if (rc < 0) { printk(KERN_ERR "%s: regulator s3 disable (%d)\n", __func__, rc); } regulator_put(fm_regulator_s3); fm_regulator_s3 = NULL; } printk(KERN_ERR "%s: Voting off for XO", __func__); if (fm_clock != NULL) { rc = msm_xo_mode_vote(fm_clock, MSM_XO_MODE_OFF); if (rc < 0) { printk(KERN_ERR "%s: Voting off XO clock (%d)\n", __func__, rc); } msm_xo_put(fm_clock); } printk(KERN_ERR "%s: coming out of fm_radio_shutdown", __func__); } /* Slave id address for FM/CDC/QMEMBIST * Values can be programmed using Marimba slave id 0 * should there be a conflict with other I2C devices * */ #define BAHAMA_SLAVE_ID_FM_ADDR 0x2A #define BAHAMA_SLAVE_ID_QMEMBIST_ADDR 0x7B static struct marimba_fm_platform_data marimba_fm_pdata = { .fm_setup = fm_radio_setup, .fm_shutdown = fm_radio_shutdown, .irq = PM8058_GPIO_IRQ(PM8058_IRQ_BASE, FM_GPIO), }; /* Just initializing the BAHAMA related slave */ static struct marimba_platform_data marimba_pdata = { .slave_id[SLAVE_ID_BAHAMA_FM] = BAHAMA_SLAVE_ID_FM_ADDR, .slave_id[SLAVE_ID_BAHAMA_QMEMBIST] = BAHAMA_SLAVE_ID_QMEMBIST_ADDR, .bahama_setup = msm_bahama_setup_power, .bahama_shutdown = msm_bahama_shutdown_power, .fm = &marimba_fm_pdata, }; static struct i2c_board_info msm_marimba_board_info[] = { { I2C_BOARD_INFO("marimba", 0xc), .platform_data = &marimba_pdata, } }; #endif /* CONFIG_MAIMBA_CORE */ #define EXT_CHG_VALID_MPP 10 #define EXT_CHG_VALID_MPP_2 11 #ifdef CONFIG_ISL9519_CHARGER static int isl_detection_setup(void) { int ret = 0; ret = pm8058_mpp_config_digital_in(EXT_CHG_VALID_MPP, PM8058_MPP_DIG_LEVEL_S3, PM_MPP_DIN_TO_INT); ret |= pm8058_mpp_config_bi_dir(EXT_CHG_VALID_MPP_2, PM8058_MPP_DIG_LEVEL_S3, PM_MPP_BI_PULLUP_10KOHM ); return ret; } static struct isl_platform_data isl_data __initdata = { .chgcurrent = 1900, .valid_n_gpio = PM8058_MPP_PM_TO_SYS(10), .chg_detection_config = isl_detection_setup, .max_system_voltage = 4200, .min_system_voltage = 3200, .term_current = 500, .input_current = 2048, }; static struct i2c_board_info isl_charger_i2c_info[] __initdata = { { I2C_BOARD_INFO("isl9519q", 0x9), .irq = PM8058_CBLPWR_IRQ(PM8058_IRQ_BASE), .platform_data = &isl_data, }, }; #endif #if defined(CONFIG_BATTERY_BQ27541) || \ defined(CONFIG_BATTERY_BQ27541_MODULE) static struct i2c_board_info msm_bq27541_board_info[] = { { I2C_BOARD_INFO("bq27541", 0xaa>>1), }, }; #endif #ifdef CONFIG_I2C struct i2c_registry { int bus; struct i2c_board_info *info; int len; }; static struct i2c_registry msm8x60_i2c_devices[] __initdata = { #ifdef CONFIG_PMIC8058 { MSM_SSBI1_I2C_BUS_ID, pm8058_boardinfo, ARRAY_SIZE(pm8058_boardinfo), }, #endif #ifdef CONFIG_PMIC8901 { MSM_SSBI2_I2C_BUS_ID, pm8901_boardinfo, ARRAY_SIZE(pm8901_boardinfo), }, #endif #ifdef CONFIG_MSM_CAMERA { MSM_GSBI4_QUP_I2C_BUS_ID, msm_camera_boardinfo, ARRAY_SIZE(msm_camera_boardinfo), }, #endif { MSM_GSBI7_QUP_I2C_BUS_ID, msm_i2c_gsbi7_timpani_info, ARRAY_SIZE(msm_i2c_gsbi7_timpani_info), }, { MSM_GSBI3_QUP_I2C_BUS_ID, atmel_i2c_info, ARRAY_SIZE(atmel_i2c_info), }, #if defined(CONFIG_MARIMBA_CORE) { MSM_GSBI7_QUP_I2C_BUS_ID, msm_marimba_board_info, ARRAY_SIZE(msm_marimba_board_info), }, #endif /* CONFIG_MARIMBA_CORE */ #ifdef CONFIG_ISL9519_CHARGER { MSM_GSBI8_QUP_I2C_BUS_ID, isl_charger_i2c_info, ARRAY_SIZE(isl_charger_i2c_info), }, #endif #if defined(CONFIG_BATTERY_BQ27541) || \ defined(CONFIG_BATTERY_BQ27541_MODULE) { MSM_GSBI8_QUP_I2C_BUS_ID, msm_bq27541_board_info, ARRAY_SIZE(msm_bq27541_board_info), }, #endif }; #endif /* CONFIG_I2C */ static void fixup_i2c_configs(void) { #ifdef CONFIG_I2C /* * Set PMIC 8901 MPP0 active_high to 0 for surf and charm_surf. This * implies that the regulator connected to MPP0 is enabled when * MPP0 is low. */ pm8901_vreg_init_pdata[PM8901_VREG_ID_MPP0].active_high = 1; #endif } static void register_i2c_devices(void) { #ifdef CONFIG_I2C int i; /* Run the array and install devices as appropriate */ for (i = 0; i < ARRAY_SIZE(msm8x60_i2c_devices); ++i) { i2c_register_board_info(msm8x60_i2c_devices[i].bus, msm8x60_i2c_devices[i].info, msm8x60_i2c_devices[i].len); } #endif } static void __init msm8x60_init_buses(void) { #ifdef CONFIG_I2C_QUP void *gsbi_mem = ioremap_nocache(0x19C00000, 4); /* Setting protocol code to 0x60 for dual UART/I2C in GSBI12 */ writel(0x6 << 4, gsbi_mem); iounmap(gsbi_mem); msm_gsbi3_qup_i2c_device.dev.platform_data = &msm_gsbi3_qup_i2c_pdata; msm_gsbi4_qup_i2c_device.dev.platform_data = &msm_gsbi4_qup_i2c_pdata; msm_gsbi7_qup_i2c_device.dev.platform_data = &msm_gsbi7_qup_i2c_pdata; msm_gsbi8_qup_i2c_device.dev.platform_data = &msm_gsbi8_qup_i2c_pdata; msm_gsbi9_qup_i2c_device.dev.platform_data = &msm_gsbi9_qup_i2c_pdata; msm_gsbi12_qup_i2c_device.dev.platform_data = &msm_gsbi12_qup_i2c_pdata; #endif #if defined(CONFIG_SPI_QUP) || defined(CONFIG_SPI_QUP_MODULE) msm_gsbi1_qup_spi_device.dev.platform_data = &msm_gsbi1_qup_spi_pdata; #endif #ifdef CONFIG_I2C_SSBI msm_device_ssbi1.dev.platform_data = &msm_ssbi1_pdata; msm_device_ssbi2.dev.platform_data = &msm_ssbi2_pdata; msm_device_ssbi3.dev.platform_data = &msm_ssbi3_pdata; #endif #if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_HCD) msm_otg_pdata.phy_can_powercollapse = 0; msm_device_otg.dev.platform_data = &msm_otg_pdata; #endif #ifdef CONFIG_SERIAL_MSM_HS msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(54); /* GSBI6(2) */ msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata; #endif #ifdef CONFIG_MSM_BUS_SCALING /* RPM calls are only enabled on V2 */ if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 2) { msm_bus_apps_fabric_pdata.rpm_enabled = 1; msm_bus_sys_fabric_pdata.rpm_enabled = 1; msm_bus_mm_fabric_pdata.rpm_enabled = 1; msm_bus_sys_fpb_pdata.rpm_enabled = 1; msm_bus_cpss_fpb_pdata.rpm_enabled = 1; } msm_bus_apps_fabric.dev.platform_data = &msm_bus_apps_fabric_pdata; msm_bus_sys_fabric.dev.platform_data = &msm_bus_sys_fabric_pdata; msm_bus_mm_fabric.dev.platform_data = &msm_bus_mm_fabric_pdata; msm_bus_sys_fpb.dev.platform_data = &msm_bus_sys_fpb_pdata; msm_bus_cpss_fpb.dev.platform_data = &msm_bus_cpss_fpb_pdata; #endif } static void __init msm8x60_map_io(void) { msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; msm_map_msm8x60_io(); msm8x60_allocate_memory_regions(); } static void __init msm8x60_init_tlmm(void) { } #if (defined(CONFIG_MMC_MSM_SDC1_SUPPORT)\ || defined(CONFIG_MMC_MSM_SDC2_SUPPORT)\ || defined(CONFIG_MMC_MSM_SDC3_SUPPORT)\ || defined(CONFIG_MMC_MSM_SDC4_SUPPORT)\ || defined(CONFIG_MMC_MSM_SDC5_SUPPORT)) /* 8x60 is having 5 SDCC controllers */ #define MAX_SDCC_CONTROLLER 5 struct msm_sdcc_gpio { /* maximum 10 GPIOs per SDCC controller */ s16 no; /* name of this GPIO */ const char *name; }; #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT static struct msm_sdcc_gpio sdc1_gpio_cfg[] = { {159, "sdc1_dat_0"}, {160, "sdc1_dat_1"}, {161, "sdc1_dat_2"}, {162, "sdc1_dat_3"}, #ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT {163, "sdc1_dat_4"}, {164, "sdc1_dat_5"}, {165, "sdc1_dat_6"}, {166, "sdc1_dat_7"}, #endif {167, "sdc1_clk"}, {168, "sdc1_cmd"} }; #endif #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT static struct msm_sdcc_gpio sdc2_gpio_cfg[] = { {143, "sdc2_dat_0"}, {144, "sdc2_dat_1"}, {145, "sdc2_dat_2"}, {146, "sdc2_dat_3"}, #ifdef CONFIG_MMC_MSM_SDC2_8_BIT_SUPPORT {147, "sdc2_dat_4"}, {148, "sdc2_dat_5"}, {149, "sdc2_dat_6"}, {150, "sdc2_dat_7"}, #endif {151, "sdc2_cmd"}, {152, "sdc2_clk"} }; #endif #ifdef CONFIG_MMC_MSM_SDC5_SUPPORT static struct msm_sdcc_gpio sdc5_gpio_cfg[] = { {95, "sdc5_cmd"}, {96, "sdc5_dat_3"}, {97, "sdc5_clk"}, {98, "sdc5_dat_2"}, {99, "sdc5_dat_1"}, {100, "sdc5_dat_0"} }; #endif struct msm_sdcc_pad_pull_cfg { enum msm_tlmm_pull_tgt pull; u32 pull_val; }; struct msm_sdcc_pad_drv_cfg { enum msm_tlmm_hdrive_tgt drv; u32 drv_val; }; #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT static struct msm_sdcc_pad_drv_cfg sdc3_pad_on_drv_cfg[] = { {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA}, {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA}, {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA} }; static struct msm_sdcc_pad_pull_cfg sdc3_pad_on_pull_cfg[] = { {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP}, {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP} }; static struct msm_sdcc_pad_drv_cfg sdc3_pad_off_drv_cfg[] = { {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA}, {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA}, {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA} }; static struct msm_sdcc_pad_pull_cfg sdc3_pad_off_pull_cfg[] = { {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_DOWN}, {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_DOWN} }; #endif #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT static struct msm_sdcc_pad_drv_cfg sdc4_pad_on_drv_cfg[] = { {TLMM_HDRV_SDC4_CLK, GPIO_CFG_8MA}, {TLMM_HDRV_SDC4_CMD, GPIO_CFG_8MA}, {TLMM_HDRV_SDC4_DATA, GPIO_CFG_8MA} }; static struct msm_sdcc_pad_pull_cfg sdc4_pad_on_pull_cfg[] = { {TLMM_PULL_SDC4_CMD, GPIO_CFG_PULL_UP}, {TLMM_PULL_SDC4_DATA, GPIO_CFG_PULL_UP} }; static struct msm_sdcc_pad_drv_cfg sdc4_pad_off_drv_cfg[] = { {TLMM_HDRV_SDC4_CLK, GPIO_CFG_2MA}, {TLMM_HDRV_SDC4_CMD, GPIO_CFG_2MA}, {TLMM_HDRV_SDC4_DATA, GPIO_CFG_2MA} }; static struct msm_sdcc_pad_pull_cfg sdc4_pad_off_pull_cfg[] = { {TLMM_PULL_SDC4_CMD, GPIO_CFG_PULL_DOWN}, {TLMM_PULL_SDC4_DATA, GPIO_CFG_PULL_DOWN} }; #endif struct msm_sdcc_pin_cfg { /* * = 1 if controller pins are using gpios * = 0 if controller has dedicated MSM pins */ u8 is_gpio; u8 cfg_sts; u8 gpio_data_size; struct msm_sdcc_gpio *gpio_data; struct msm_sdcc_pad_drv_cfg *pad_drv_on_data; struct msm_sdcc_pad_drv_cfg *pad_drv_off_data; struct msm_sdcc_pad_pull_cfg *pad_pull_on_data; struct msm_sdcc_pad_pull_cfg *pad_pull_off_data; u8 pad_drv_data_size; u8 pad_pull_data_size; }; static struct msm_sdcc_pin_cfg sdcc_pin_cfg_data[MAX_SDCC_CONTROLLER] = { #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT [0] = { .is_gpio = 1, .gpio_data_size = ARRAY_SIZE(sdc1_gpio_cfg), .gpio_data = sdc1_gpio_cfg }, #endif #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT [1] = { .is_gpio = 1, .gpio_data_size = ARRAY_SIZE(sdc2_gpio_cfg), .gpio_data = sdc2_gpio_cfg }, #endif #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT [2] = { .is_gpio = 0, .pad_drv_on_data = sdc3_pad_on_drv_cfg, .pad_drv_off_data = sdc3_pad_off_drv_cfg, .pad_pull_on_data = sdc3_pad_on_pull_cfg, .pad_pull_off_data = sdc3_pad_off_pull_cfg, .pad_drv_data_size = ARRAY_SIZE(sdc3_pad_on_drv_cfg), .pad_pull_data_size = ARRAY_SIZE(sdc3_pad_on_pull_cfg) }, #endif #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT [3] = { .is_gpio = 0, .pad_drv_on_data = sdc4_pad_on_drv_cfg, .pad_drv_off_data = sdc4_pad_off_drv_cfg, .pad_pull_on_data = sdc4_pad_on_pull_cfg, .pad_pull_off_data = sdc4_pad_off_pull_cfg, .pad_drv_data_size = ARRAY_SIZE(sdc4_pad_on_drv_cfg), .pad_pull_data_size = ARRAY_SIZE(sdc4_pad_on_pull_cfg) }, #endif #ifdef CONFIG_MMC_MSM_SDC5_SUPPORT [4] = { .is_gpio = 1, .gpio_data_size = ARRAY_SIZE(sdc5_gpio_cfg), .gpio_data = sdc5_gpio_cfg } #endif }; static int msm_sdcc_setup_gpio(int dev_id, unsigned int enable) { int rc = 0; struct msm_sdcc_pin_cfg *curr; int n; curr = &sdcc_pin_cfg_data[dev_id - 1]; if (!curr->gpio_data) goto out; for (n = 0; n < curr->gpio_data_size; n++) { if (enable) { rc = gpio_request(curr->gpio_data[n].no, curr->gpio_data[n].name); if (rc) { pr_err("%s: gpio_request(%d, %s)" "failed", __func__, curr->gpio_data[n].no, curr->gpio_data[n].name); goto free_gpios; } /* set direction as output for all GPIOs */ rc = gpio_direction_output( curr->gpio_data[n].no, 1); if (rc) { pr_err("%s: gpio_direction_output" "(%d, 1) failed\n", __func__, curr->gpio_data[n].no); goto free_gpios; } } else { /* * now free this GPIO which will put GPIO * in low power mode and will also put GPIO * in input mode */ gpio_free(curr->gpio_data[n].no); } } curr->cfg_sts = enable; goto out; free_gpios: for (; n >= 0; n--) gpio_free(curr->gpio_data[n].no); out: return rc; } static int msm_sdcc_setup_pad(int dev_id, unsigned int enable) { int rc = 0; struct msm_sdcc_pin_cfg *curr; int n; curr = &sdcc_pin_cfg_data[dev_id - 1]; if (!curr->pad_drv_on_data || !curr->pad_pull_on_data) goto out; if (enable) { /* * set up the normal driver strength and * pull config for pads */ for (n = 0; n < curr->pad_drv_data_size; n++) msm_tlmm_set_hdrive(curr->pad_drv_on_data[n].drv, curr->pad_drv_on_data[n].drv_val); for (n = 0; n < curr->pad_pull_data_size; n++) msm_tlmm_set_pull(curr->pad_pull_on_data[n].pull, curr->pad_pull_on_data[n].pull_val); } else { /* set the low power config for pads */ for (n = 0; n < curr->pad_drv_data_size; n++) msm_tlmm_set_hdrive( curr->pad_drv_off_data[n].drv, curr->pad_drv_off_data[n].drv_val); for (n = 0; n < curr->pad_pull_data_size; n++) msm_tlmm_set_pull( curr->pad_pull_off_data[n].pull, curr->pad_pull_off_data[n].pull_val); } curr->cfg_sts = enable; out: return rc; } struct sdcc_reg { /* VDD/VCC/VCCQ regulator name on PMIC8058/PMIC8089*/ const char *reg_name; /* * is set voltage supported for this regulator? * 0 = not supported, 1 = supported */ unsigned char set_voltage_sup; /* voltage level to be set */ unsigned int level; /* VDD/VCC/VCCQ voltage regulator handle */ struct regulator *reg; /* is this regulator enabled? */ bool enabled; /* is this regulator needs to be always on? */ bool always_on; /* is operating power mode setting required for this regulator? */ bool op_pwr_mode_sup; /* Load values for low power and high power mode */ unsigned int lpm_uA; unsigned int hpm_uA; }; /* all SDCC controllers requires VDD/VCC voltage */ static struct sdcc_reg sdcc_vdd_reg_data[MAX_SDCC_CONTROLLER]; /* only SDCC1 requires VCCQ voltage */ static struct sdcc_reg sdcc_vccq_reg_data[1]; /* all SDCC controllers may require voting for VDD PAD voltage */ static struct sdcc_reg sdcc_vddp_reg_data[MAX_SDCC_CONTROLLER]; struct sdcc_reg_data { struct sdcc_reg *vdd_data; /* keeps VDD/VCC regulator info */ struct sdcc_reg *vccq_data; /* keeps VCCQ regulator info */ struct sdcc_reg *vddp_data; /* keeps VDD Pad regulator info */ unsigned char sts; /* regulator enable/disable status */ }; /* msm8x60 have 5 SDCC controllers */ static struct sdcc_reg_data sdcc_vreg_data[MAX_SDCC_CONTROLLER]; static int msm_sdcc_vreg_init_reg(struct sdcc_reg *vreg) { int rc = 0; /* Get the regulator handle */ vreg->reg = regulator_get(NULL, vreg->reg_name); if (IS_ERR(vreg->reg)) { rc = PTR_ERR(vreg->reg); pr_err("%s: regulator_get(%s) failed. rc=%d\n", __func__, vreg->reg_name, rc); goto out; } /* Set the voltage level if required */ if (vreg->set_voltage_sup) { rc = regulator_set_voltage(vreg->reg, vreg->level, vreg->level); if (rc) { pr_err("%s: regulator_set_voltage(%s) failed rc=%d\n", __func__, vreg->reg_name, rc); goto vreg_put; } } goto out; vreg_put: regulator_put(vreg->reg); out: return rc; } static inline void msm_sdcc_vreg_deinit_reg(struct sdcc_reg *vreg) { regulator_put(vreg->reg); } /* this init function should be called only once for each SDCC */ static int msm_sdcc_vreg_init(int dev_id, unsigned char init) { int rc = 0; struct sdcc_reg *curr_vdd_reg, *curr_vccq_reg, *curr_vddp_reg; struct sdcc_reg_data *curr; curr = &sdcc_vreg_data[dev_id - 1]; curr_vdd_reg = curr->vdd_data; curr_vccq_reg = curr->vccq_data; curr_vddp_reg = curr->vddp_data; if (init) { /* * get the regulator handle from voltage regulator framework * and then try to set the voltage level for the regulator */ if (curr_vdd_reg) { rc = msm_sdcc_vreg_init_reg(curr_vdd_reg); if (rc) goto out; } if (curr_vccq_reg) { rc = msm_sdcc_vreg_init_reg(curr_vccq_reg); if (rc) goto vdd_reg_deinit; } if (curr_vddp_reg) { rc = msm_sdcc_vreg_init_reg(curr_vddp_reg); if (rc) goto vccq_reg_deinit; } goto out; } else /* deregister with all regulators from regulator framework */ goto vddp_reg_deinit; vddp_reg_deinit: if (curr_vddp_reg) msm_sdcc_vreg_deinit_reg(curr_vddp_reg); vccq_reg_deinit: if (curr_vccq_reg) msm_sdcc_vreg_deinit_reg(curr_vccq_reg); vdd_reg_deinit: if (curr_vdd_reg) msm_sdcc_vreg_deinit_reg(curr_vdd_reg); out: return rc; } static int msm_sdcc_vreg_enable(struct sdcc_reg *vreg) { int rc; if (!vreg->enabled) { rc = regulator_enable(vreg->reg); if (rc) { pr_err("%s: regulator_enable(%s) failed. rc=%d\n", __func__, vreg->reg_name, rc); goto out; } vreg->enabled = 1; } /* Put always_on regulator in HPM (high power mode) */ if (vreg->always_on && vreg->op_pwr_mode_sup) { rc = regulator_set_optimum_mode(vreg->reg, vreg->hpm_uA); if (rc < 0) { pr_err("%s: reg=%s: HPM setting failed" " hpm_uA=%d, rc=%d\n", __func__, vreg->reg_name, vreg->hpm_uA, rc); goto vreg_disable; } rc = 0; } goto out; vreg_disable: regulator_disable(vreg->reg); vreg->enabled = 0; out: return rc; } static int msm_sdcc_vreg_disable(struct sdcc_reg *vreg) { int rc; /* Never disable always_on regulator */ if (!vreg->always_on) { rc = regulator_disable(vreg->reg); if (rc) { pr_err("%s: regulator_disable(%s) failed. rc=%d\n", __func__, vreg->reg_name, rc); goto out; } vreg->enabled = 0; } /* Put always_on regulator in LPM (low power mode) */ if (vreg->always_on && vreg->op_pwr_mode_sup) { rc = regulator_set_optimum_mode(vreg->reg, vreg->lpm_uA); if (rc < 0) { pr_err("%s: reg=%s: LPM setting failed" " lpm_uA=%d, rc=%d\n", __func__, vreg->reg_name, vreg->lpm_uA, rc); goto out; } rc = 0; } out: return rc; } static int msm_sdcc_setup_vreg(int dev_id, unsigned char enable) { int rc = 0; struct sdcc_reg *curr_vdd_reg, *curr_vccq_reg, *curr_vddp_reg; struct sdcc_reg_data *curr; curr = &sdcc_vreg_data[dev_id - 1]; curr_vdd_reg = curr->vdd_data; curr_vccq_reg = curr->vccq_data; curr_vddp_reg = curr->vddp_data; /* check if regulators are initialized or not? */ if ((curr_vdd_reg && !curr_vdd_reg->reg) || (curr_vccq_reg && !curr_vccq_reg->reg) || (curr_vddp_reg && !curr_vddp_reg->reg)) { /* initialize voltage regulators required for this SDCC */ rc = msm_sdcc_vreg_init(dev_id, 1); if (rc) { pr_err("%s: regulator init failed = %d\n", __func__, rc); goto out; } } if (curr->sts == enable) goto out; if (curr_vdd_reg) { if (enable) rc = msm_sdcc_vreg_enable(curr_vdd_reg); else rc = msm_sdcc_vreg_disable(curr_vdd_reg); if (rc) goto out; } if (curr_vccq_reg) { if (enable) rc = msm_sdcc_vreg_enable(curr_vccq_reg); else rc = msm_sdcc_vreg_disable(curr_vccq_reg); if (rc) goto out; } if (curr_vddp_reg) { if (enable) rc = msm_sdcc_vreg_enable(curr_vddp_reg); else rc = msm_sdcc_vreg_disable(curr_vddp_reg); if (rc) goto out; } curr->sts = enable; out: return rc; } static u32 msm_sdcc_setup_power(struct device *dv, unsigned int vdd) { u32 rc_pin_cfg = 0; u32 rc_vreg_cfg = 0; u32 rc = 0; struct platform_device *pdev; struct msm_sdcc_pin_cfg *curr_pin_cfg; pdev = container_of(dv, struct platform_device, dev); /* setup gpio/pad */ curr_pin_cfg = &sdcc_pin_cfg_data[pdev->id - 1]; if (curr_pin_cfg->cfg_sts == !!vdd) goto setup_vreg; if (curr_pin_cfg->is_gpio) rc_pin_cfg = msm_sdcc_setup_gpio(pdev->id, !!vdd); else rc_pin_cfg = msm_sdcc_setup_pad(pdev->id, !!vdd); setup_vreg: /* setup voltage regulators */ rc_vreg_cfg = msm_sdcc_setup_vreg(pdev->id, !!vdd); if (rc_pin_cfg || rc_vreg_cfg) rc = rc_pin_cfg ? rc_pin_cfg : rc_vreg_cfg; return rc; } #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT #ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION static unsigned int msm8x60_sdcc_slot_status(struct device *dev) { int status; status = gpio_request(PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_SDC3_DET - 1) , "SD_HW_Detect"); if (status) { pr_err("%s:Failed to request GPIO %d\n", __func__, PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_SDC3_DET - 1)); } else { status = gpio_direction_input( PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_SDC3_DET - 1)); if (!status) status = !(gpio_get_value_cansleep( PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_SDC3_DET - 1))); gpio_free(PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_SDC3_DET - 1)); } return (unsigned int) status; } #endif #endif #endif #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT static struct mmc_platform_data msm8x60_sdc1_data = { .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, .translate_vdd = msm_sdcc_setup_power, #ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT .mmc_bus_width = MMC_CAP_8_BIT_DATA, #else .mmc_bus_width = MMC_CAP_4_BIT_DATA, #endif .msmsdcc_fmin = 400000, .msmsdcc_fmid = 24000000, .msmsdcc_fmax = 48000000, .nonremovable = 1, .pclk_src_dfab = 1, }; #endif #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT static struct mmc_platform_data msm8x60_sdc3_data = { .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, .translate_vdd = msm_sdcc_setup_power, .mmc_bus_width = MMC_CAP_4_BIT_DATA, #ifdef CONFIG_MMC_MSM_CARD_HW_DETECTION .status = msm8x60_sdcc_slot_status, .status_irq = PM8058_GPIO_IRQ(PM8058_IRQ_BASE, PMIC_GPIO_SDC3_DET - 1), .irq_flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, #endif .msmsdcc_fmin = 400000, .msmsdcc_fmid = 24000000, .msmsdcc_fmax = 48000000, .nonremovable = 0, .pclk_src_dfab = 1, }; #endif #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT static struct mmc_platform_data msm8x60_sdc4_data = { .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, .translate_vdd = msm_sdcc_setup_power, .mmc_bus_width = MMC_CAP_4_BIT_DATA, .msmsdcc_fmin = 400000, .msmsdcc_fmid = 24000000, .msmsdcc_fmax = 48000000, .nonremovable = 1, .pclk_src_dfab = 1, }; #endif static void __init msm8x60_init_mmc(void) { #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT /* SDCC1 : eMMC card connected */ sdcc_vreg_data[0].vdd_data = &sdcc_vdd_reg_data[0]; sdcc_vreg_data[0].vdd_data->reg_name = "8901_l5"; sdcc_vreg_data[0].vdd_data->set_voltage_sup = 1; sdcc_vreg_data[0].vdd_data->level = 2850000; sdcc_vreg_data[0].vdd_data->always_on = 1; sdcc_vreg_data[0].vdd_data->op_pwr_mode_sup = 1; sdcc_vreg_data[0].vdd_data->lpm_uA = 9000; sdcc_vreg_data[0].vdd_data->hpm_uA = 200000; sdcc_vreg_data[0].vccq_data = &sdcc_vccq_reg_data[0]; sdcc_vreg_data[0].vccq_data->reg_name = "8901_lvs0"; sdcc_vreg_data[0].vccq_data->set_voltage_sup = 0; msm_add_sdcc(1, &msm8x60_sdc1_data); #endif #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT /* * MDM SDIO client is connected to SDC2 on charm SURF/FFA * and no card is connected on 8660 SURF/FFA/FLUID. */ sdcc_vreg_data[1].vdd_data = &sdcc_vdd_reg_data[1]; sdcc_vreg_data[1].vdd_data->reg_name = "8058_s3"; sdcc_vreg_data[1].vdd_data->set_voltage_sup = 1; sdcc_vreg_data[1].vdd_data->level = 1800000; sdcc_vreg_data[1].vccq_data = NULL; #endif #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT /* SDCC3 : External card slot connected */ sdcc_vreg_data[2].vdd_data = &sdcc_vdd_reg_data[2]; sdcc_vreg_data[2].vdd_data->reg_name = "8058_l14"; sdcc_vreg_data[2].vdd_data->set_voltage_sup = 1; sdcc_vreg_data[2].vdd_data->level = 2850000; sdcc_vreg_data[2].vdd_data->always_on = 1; sdcc_vreg_data[2].vdd_data->op_pwr_mode_sup = 1; sdcc_vreg_data[2].vdd_data->lpm_uA = 9000; sdcc_vreg_data[2].vdd_data->hpm_uA = 200000; sdcc_vreg_data[2].vccq_data = NULL; sdcc_vreg_data[2].vddp_data = &sdcc_vddp_reg_data[2]; sdcc_vreg_data[2].vddp_data->reg_name = "8058_l5"; sdcc_vreg_data[2].vddp_data->set_voltage_sup = 1; sdcc_vreg_data[2].vddp_data->level = 2850000; sdcc_vreg_data[2].vddp_data->always_on = 1; sdcc_vreg_data[2].vddp_data->op_pwr_mode_sup = 1; /* Sleep current required is ~300 uA. But min. RPM * vote can be in terms of mA (min. 1 mA). * So let's vote for 2 mA during sleep. */ sdcc_vreg_data[2].vddp_data->lpm_uA = 2000; /* Max. Active current required is 16 mA */ sdcc_vreg_data[2].vddp_data->hpm_uA = 16000; msm_add_sdcc(3, &msm8x60_sdc3_data); #endif #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT /* SDCC4 : WLAN WCN1314 chip is connected */ sdcc_vreg_data[3].vdd_data = &sdcc_vdd_reg_data[3]; sdcc_vreg_data[3].vdd_data->reg_name = "8058_s3"; sdcc_vreg_data[3].vdd_data->set_voltage_sup = 1; sdcc_vreg_data[3].vdd_data->level = 1800000; sdcc_vreg_data[3].vccq_data = NULL; msm_add_sdcc(4, &msm8x60_sdc4_data); #endif #ifdef CONFIG_MMC_MSM_SDC5_SUPPORT /* * MDM SDIO client is connected to SDC5 on charm SURF/FFA * and no card is connected on 8660 SURF/FFA/FLUID. */ sdcc_vreg_data[4].vdd_data = &sdcc_vdd_reg_data[4]; sdcc_vreg_data[4].vdd_data->reg_name = "8058_s3"; sdcc_vreg_data[4].vdd_data->set_voltage_sup = 1; sdcc_vreg_data[4].vdd_data->level = 1800000; sdcc_vreg_data[4].vccq_data = NULL; #endif } #define LCDC_NUM_GPIO 28 #define LCDC_GPIO_START 0 static void lcdc_chimei_panel_power(int on) { int n, ret = 0; #ifdef USE_VREG_L2B static struct regulator *vreg_l2b; /* * chimei panle power always on. * no power control necessary. */ if (vreg_l2b == NULL) { vreg_l2b = regulator_get(NULL, "8901_l2"); if (IS_ERR(vreg_l2b)) { pr_debug("%s: vreg_l2b failed\n", __func__); ret = PTR_ERR(vreg_l2b); return ret; } } if (on) { ret = regulator_set_voltage(vreg_l2b, 3300000, 3300000); if (ret) goto out; ret = regulator_enable(vreg_l2b); if (ret) goto out; } else { regulator_disable(display_reg); } #endif /* configure gpio pins */ for (n = 0; n < LCDC_NUM_GPIO; n++) { if (on) { ret = gpio_request(LCDC_GPIO_START + n, "LCDC_GPIO"); if (unlikely(ret)) { pr_err("%s not able to get gpio\n", __func__); break; } } else gpio_free(LCDC_GPIO_START + n); } if (ret) { for (n--; n >= 0; n--) gpio_free(LCDC_GPIO_START + n); } #ifdef USE_VREG_L2B out: regulator_disable(vreg_l2b); regulator_put(vreg_l2b); vreg_l2b = NULL; #endif } #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL #define _GET_REGULATOR(var, name) do { \ var = regulator_get(NULL, name); \ if (IS_ERR(var)) { \ pr_err("'%s' regulator not found, rc=%ld\n", \ name, IS_ERR(var)); \ var = NULL; \ return -ENODEV; \ } \ } while (0) static int hdmi_enable_5v(int on) { static struct regulator *reg_8901_hdmi_mvs; /* HDMI_5V */ static struct regulator *reg_8901_mpp0; /* External 5V */ static int prev_on; int rc; if (on == prev_on) return 0; if (!reg_8901_hdmi_mvs) _GET_REGULATOR(reg_8901_hdmi_mvs, "8901_hdmi_mvs"); if (!reg_8901_mpp0) _GET_REGULATOR(reg_8901_mpp0, "8901_mpp0"); if (on) { rc = regulator_enable(reg_8901_mpp0); if (rc) { pr_err("'%s' regulator enable failed, rc=%d\n", "reg_8901_mpp0", rc); return rc; } rc = regulator_enable(reg_8901_hdmi_mvs); if (rc) { pr_err("'%s' regulator enable failed, rc=%d\n", "8901_hdmi_mvs", rc); return rc; } pr_info("%s(on): success\n", __func__); } else { rc = regulator_disable(reg_8901_hdmi_mvs); if (rc) pr_warning("'%s' regulator disable failed, rc=%d\n", "8901_hdmi_mvs", rc); rc = regulator_disable(reg_8901_mpp0); if (rc) pr_warning("'%s' regulator disable failed, rc=%d\n", "reg_8901_mpp0", rc); pr_info("%s(off): success\n", __func__); } prev_on = on; return 0; } static int hdmi_core_power(int on, int show) { static struct regulator *reg_8058_l16; /* VDD_HDMI */ static int prev_on; int rc; if (on == prev_on) return 0; if (!reg_8058_l16) _GET_REGULATOR(reg_8058_l16, "8058_l16"); if (on) { rc = regulator_set_voltage(reg_8058_l16, 1800000, 1800000); if (!rc) rc = regulator_enable(reg_8058_l16); if (rc) { pr_err("'%s' regulator enable failed, rc=%d\n", "8058_l16", rc); return rc; } rc = gpio_request(170, "HDMI_DDC_CLK"); if (rc) { pr_err("'%s'(%d) gpio_request failed, rc=%d\n", "HDMI_DDC_CLK", 170, rc); goto error1; } rc = gpio_request(171, "HDMI_DDC_DATA"); if (rc) { pr_err("'%s'(%d) gpio_request failed, rc=%d\n", "HDMI_DDC_DATA", 171, rc); goto error2; } rc = gpio_request(172, "HDMI_HPD"); if (rc) { pr_err("'%s'(%d) gpio_request failed, rc=%d\n", "HDMI_HPD", 172, rc); goto error3; } pr_info("%s(on): success\n", __func__); } else { gpio_free(170); gpio_free(171); gpio_free(172); rc = regulator_disable(reg_8058_l16); if (rc) pr_warning("'%s' regulator disable failed, rc=%d\n", "8058_l16", rc); pr_info("%s(off): success\n", __func__); } prev_on = on; return 0; error3: gpio_free(171); error2: gpio_free(170); error1: regulator_disable(reg_8058_l16); return rc; } static int hdmi_cec_power(int on) { static struct regulator *reg_8901_l3; /* HDMI_CEC */ static int prev_on; int rc; if (on == prev_on) return 0; if (!reg_8901_l3) _GET_REGULATOR(reg_8901_l3, "8901_l3"); if (on) { rc = regulator_set_voltage(reg_8901_l3, 3300000, 3300000); if (!rc) rc = regulator_enable(reg_8901_l3); if (rc) { pr_err("'%s' regulator enable failed, rc=%d\n", "8901_l3", rc); return rc; } rc = gpio_request(169, "HDMI_CEC_VAR"); if (rc) { pr_err("'%s'(%d) gpio_request failed, rc=%d\n", "HDMI_CEC_VAR", 169, rc); goto error; } pr_info("%s(on): success\n", __func__); } else { gpio_free(169); rc = regulator_disable(reg_8901_l3); if (rc) pr_warning("'%s' regulator disable failed, rc=%d\n", "8901_l3", rc); pr_info("%s(off): success\n", __func__); } prev_on = on; return 0; error: regulator_disable(reg_8901_l3); return rc; } #undef _GET_REGULATOR #endif /* CONFIG_FB_MSM_HDMI_MSM_PANEL */ static int lcdc_panel_power(int on) { int flag_on = !!on; static int lcdc_power_save_on; if (lcdc_power_save_on == flag_on) return 0; lcdc_power_save_on = flag_on; lcdc_chimei_panel_power(on); return 0; } #ifdef CONFIG_MSM_BUS_SCALING static struct msm_bus_vectors mdp_init_vectors[] = { /* For now, 0th array entry is reserved. * Please leave 0 as is and don't use it */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 0, .ib = 0, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors mdp_sd_smi_vectors[] = { /* Default case static display/UI/2d/3d if FB SMI */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 147460000, .ib = 184325000, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors mdp_sd_ebi_vectors[] = { /* Default case static display/UI/2d/3d if FB SMI */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 0, .ib = 0, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 334080000, .ib = 417600000, }, }; static struct msm_bus_vectors mdp_vga_vectors[] = { /* VGA and less video */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 175110000, .ib = 218887500, }, { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 175110000, .ib = 218887500, }, }; static struct msm_bus_vectors mdp_720p_vectors[] = { /* 720p and less video */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 230400000, .ib = 288000000, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 230400000, .ib = 288000000, }, }; static struct msm_bus_vectors mdp_1080p_vectors[] = { /* 1080p and less video */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 334080000, .ib = 417600000, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 334080000, .ib = 417600000, }, }; static struct msm_bus_vectors mdp_rgb_vectors[] = { /* RGB playing on VG or RGB pipe, might be on SMI */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 334080000, .ib = 417600000, }, /* FB on EBI, request for EBI too*/ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 334080000, .ib = 417600000, }, }; static struct msm_bus_paths mdp_bus_scale_usecases[] = { { ARRAY_SIZE(mdp_init_vectors), mdp_init_vectors, }, { ARRAY_SIZE(mdp_sd_smi_vectors), mdp_sd_smi_vectors, }, { ARRAY_SIZE(mdp_sd_ebi_vectors), mdp_sd_ebi_vectors, }, { ARRAY_SIZE(mdp_vga_vectors), mdp_vga_vectors, }, { ARRAY_SIZE(mdp_720p_vectors), mdp_720p_vectors, }, { ARRAY_SIZE(mdp_1080p_vectors), mdp_1080p_vectors, }, { ARRAY_SIZE(mdp_rgb_vectors), mdp_rgb_vectors, }, }; static struct msm_bus_scale_pdata mdp_bus_scale_pdata = { mdp_bus_scale_usecases, ARRAY_SIZE(mdp_bus_scale_usecases), .name = "mdp", }; #endif #ifdef CONFIG_MSM_BUS_SCALING static struct msm_bus_vectors dtv_bus_init_vectors[] = { /* For now, 0th array entry is reserved. * Please leave 0 as is and don't use it */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 0, .ib = 0, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 0, .ib = 0, }, }; static struct msm_bus_vectors dtv_bus_def_vectors[] = { /* For now, 0th array entry is reserved. * Please leave 0 as is and don't use it */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_SMI, .ab = 566092800, .ib = 707616000, }, /* Master and slaves can be from different fabrics */ { .src = MSM_BUS_MASTER_MDP_PORT0, .dst = MSM_BUS_SLAVE_EBI_CH0, .ab = 566092800, .ib = 707616000, }, }; static struct msm_bus_paths dtv_bus_scale_usecases[] = { { ARRAY_SIZE(dtv_bus_init_vectors), dtv_bus_init_vectors, }, { ARRAY_SIZE(dtv_bus_def_vectors), dtv_bus_def_vectors, }, }; static struct msm_bus_scale_pdata dtv_bus_scale_pdata = { dtv_bus_scale_usecases, ARRAY_SIZE(dtv_bus_scale_usecases), .name = "dtv", }; static struct lcdc_platform_data dtv_pdata = { .bus_scale_table = &dtv_bus_scale_pdata, }; #endif static struct lcdc_platform_data lcdc_pdata = { .lcdc_power_save = lcdc_panel_power, }; #define MDP_VSYNC_GPIO 28 static int mdp_core_clk_rate_table[] = { 59080000, 128000000, 160000000, 200000000, 200000000, }; static struct msm_panel_common_pdata mdp_pdata = { .gpio = MDP_VSYNC_GPIO, .mdp_core_clk_rate = 160000000, .mdp_core_clk_table = mdp_core_clk_rate_table, .num_mdp_clk = ARRAY_SIZE(mdp_core_clk_rate_table), #ifdef CONFIG_MSM_BUS_SCALING .mdp_bus_scale_table = &mdp_bus_scale_pdata, #endif }; static void __init msm_fb_add_devices(void) { msm_fb_register_device("mdp", &mdp_pdata); msm_fb_register_device("lcdc", &lcdc_pdata); #ifdef CONFIG_MSM_BUS_SCALING msm_fb_register_device("dtv", &dtv_pdata); #endif } #if (defined(CONFIG_MARIMBA_CORE)) && \ (defined(CONFIG_MSM_BT_POWER) || defined(CONFIG_MSM_BT_POWER_MODULE)) static const struct { char *name; int vmin; int vmax; } bt_regs_info[] = { { "8058_s3", 1800000, 1800000 }, { "8058_s2", 1300000, 1300000 }, { "8058_l2", 1800000, 1800000 }, { "8058_l8", 2900000, 3050000 }, }; static struct { bool enabled; } bt_regs_status[] = { { false }, { false }, { false }, { false }, }; static struct regulator *bt_regs[ARRAY_SIZE(bt_regs_info)]; static int bahama_bt(int on) { int rc; int i; struct marimba config = { .mod_id = SLAVE_ID_BAHAMA}; struct bahama_config_register { u8 reg; u8 value; u8 mask; }; struct bahama_variant_register { const size_t size; const struct bahama_config_register *set; }; const struct bahama_config_register *p; u8 version; const struct bahama_config_register v10_bt_on[] = { { 0xE9, 0x00, 0xFF }, { 0xF4, 0x80, 0xFF }, { 0xE4, 0x00, 0xFF }, { 0xE5, 0x00, 0x0F }, #ifdef CONFIG_WLAN { 0xE6, 0x38, 0x7F }, { 0xE7, 0x06, 0xFF }, #endif { 0xE9, 0x21, 0xFF }, { 0x01, 0x0C, 0x1F }, { 0x01, 0x08, 0x1F }, }; const struct bahama_config_register v20_bt_on_fm_off[] = { { 0x11, 0x0C, 0xFF }, { 0x13, 0x01, 0xFF }, { 0xF4, 0x80, 0xFF }, { 0xF0, 0x00, 0xFF }, { 0xE9, 0x00, 0xFF }, #ifdef CONFIG_WLAN { 0x81, 0x00, 0x7F }, { 0x82, 0x00, 0xFF }, { 0xE6, 0x38, 0x7F }, { 0xE7, 0x06, 0xFF }, #endif { 0xE9, 0x21, 0xFF }, }; const struct bahama_config_register v20_bt_on_fm_on[] = { { 0x11, 0x0C, 0xFF }, { 0x13, 0x01, 0xFF }, { 0xF4, 0x86, 0xFF }, { 0xF0, 0x06, 0xFF }, { 0xE9, 0x00, 0xFF }, #ifdef CONFIG_WLAN { 0x81, 0x00, 0x7F }, { 0x82, 0x00, 0xFF }, { 0xE6, 0x38, 0x7F }, { 0xE7, 0x06, 0xFF }, #endif { 0xE9, 0x21, 0xFF }, }; const struct bahama_config_register v10_bt_off[] = { { 0xE9, 0x00, 0xFF }, }; const struct bahama_config_register v20_bt_off_fm_off[] = { { 0xF4, 0x84, 0xFF }, { 0xF0, 0x04, 0xFF }, { 0xE9, 0x00, 0xFF } }; const struct bahama_config_register v20_bt_off_fm_on[] = { { 0xF4, 0x86, 0xFF }, { 0xF0, 0x06, 0xFF }, { 0xE9, 0x00, 0xFF } }; const struct bahama_variant_register bt_bahama[2][3] = { { { ARRAY_SIZE(v10_bt_off), v10_bt_off }, { ARRAY_SIZE(v20_bt_off_fm_off), v20_bt_off_fm_off }, { ARRAY_SIZE(v20_bt_off_fm_on), v20_bt_off_fm_on } }, { { ARRAY_SIZE(v10_bt_on), v10_bt_on }, { ARRAY_SIZE(v20_bt_on_fm_off), v20_bt_on_fm_off }, { ARRAY_SIZE(v20_bt_on_fm_on), v20_bt_on_fm_on } } }; /* Init mutex to get/set FM/BT status respectively */ mutex_init(&config.xfer_lock); on = on ? 1 : 0; rc = marimba_read_bit_mask(&config, 0x00, &version, 1, 0x1F); if (rc < 0) { dev_err(&msm_bt_power_device.dev, "%s: version read failed: %d\n", __func__, rc); return rc; } switch (version) { case 0x00: /* varients of bahama v1 */ case 0x08: case 0X10: version = 0x00; break; case 0x09: /* variant of bahama v2 */ version = marimba_get_fm_status(&config) ? 0x02 : 0x01; break; default: version = 0xFF; dev_err(&msm_bt_power_device.dev, "%s: unsupported version\n", __func__); break; } /* Voting off 1.3V S2 Regulator,BahamaV2 used in Normal mode */ if (on && ((version == 0x02) || (version == 0x01))) { for (i = 0; i < ARRAY_SIZE(bt_regs_info); i++) { if ((!strcmp(bt_regs_info[i].name, "8058_s2")) && (bt_regs_status[i].enabled == true)) { if (regulator_disable(bt_regs[i])) { dev_err(&msm_bt_power_device.dev, "%s: regulator disable failed", __func__); } bt_regs_status[i].enabled = false; break; } } } if ((version >= ARRAY_SIZE(bt_bahama[on])) || (bt_bahama[on][version].size == 0)) { dev_err(&msm_bt_power_device.dev, "%s: unsupported version\n", __func__); return -EIO; } p = bt_bahama[on][version].set; dev_info(&msm_bt_power_device.dev, "%s: found version %d\n", __func__, version); for (i = 0; i < bt_bahama[on][version].size; i++) { u8 value = (p+i)->value; rc = marimba_write_bit_mask(&config, (p+i)->reg, &value, sizeof((p+i)->value), (p+i)->mask); if (rc < 0) { dev_err(&msm_bt_power_device.dev, "%s: reg %d write failed: %d\n", __func__, (p+i)->reg, rc); return rc; } dev_dbg(&msm_bt_power_device.dev, "%s: reg 0x%02x write value 0x%02x mask 0x%02x\n", __func__, (p+i)->reg, value, (p+i)->mask); } /* Update BT Status */ if (on) marimba_set_bt_status(&config, true); else marimba_set_bt_status(&config, false); /* Destroy mutex */ mutex_destroy(&config.xfer_lock); return 0; } static int bluetooth_use_regulators(int on) { int i, recover = -1, rc = 0; for (i = 0; i < ARRAY_SIZE(bt_regs_info); i++) { bt_regs[i] = on ? regulator_get(&msm_bt_power_device.dev, bt_regs_info[i].name) : (regulator_put(bt_regs[i]), NULL); if (IS_ERR(bt_regs[i])) { rc = PTR_ERR(bt_regs[i]); dev_err(&msm_bt_power_device.dev, "regulator %s get failed (%d)\n", bt_regs_info[i].name, rc); recover = i - 1; bt_regs[i] = NULL; break; } if (!on) continue; rc = regulator_set_voltage(bt_regs[i], bt_regs_info[i].vmin, bt_regs_info[i].vmax); if (rc < 0) { dev_err(&msm_bt_power_device.dev, "regulator %s voltage set (%d)\n", bt_regs_info[i].name, rc); recover = i; break; } } if (on && (recover > -1)) for (i = recover; i >= 0; i--) { regulator_put(bt_regs[i]); bt_regs[i] = NULL; } return rc; } static int bluetooth_switch_regulators(int on) { int i, rc = 0; for (i = 0; i < ARRAY_SIZE(bt_regs_info); i++) { if (on && (bt_regs_status[i].enabled == false)) { rc = regulator_enable(bt_regs[i]); if (rc < 0) { dev_err(&msm_bt_power_device.dev, "regulator %s %s failed (%d)\n", bt_regs_info[i].name, "enable", rc); if (i > 0) { while (--i) { regulator_disable(bt_regs[i]); bt_regs_status[i].enabled = false; } break; } } bt_regs_status[i].enabled = true; } else if (!on && (bt_regs_status[i].enabled == true)) { rc = regulator_disable(bt_regs[i]); if (rc < 0) { dev_err(&msm_bt_power_device.dev, "regulator %s %s failed (%d)\n", bt_regs_info[i].name, "disable", rc); break; } bt_regs_status[i].enabled = false; } } return rc; } static struct msm_xo_voter *bt_clock; static int bluetooth_power(int on) { int rc = 0; if (on) { rc = bluetooth_use_regulators(1); if (rc < 0) goto out; rc = bluetooth_switch_regulators(1); if (rc < 0) goto fail_put; bt_clock = msm_xo_get(MSM_XO_TCXO_D0, "bt_power"); if (IS_ERR(bt_clock)) { pr_err("Couldn't get TCXO_D0 voter\n"); goto fail_switch; } rc = msm_xo_mode_vote(bt_clock, MSM_XO_MODE_ON); if (rc < 0) { pr_err("Failed to vote for TCXO_DO ON\n"); goto fail_vote; } rc = bahama_bt(1); if (rc < 0) goto fail_clock; msleep(10); rc = msm_xo_mode_vote(bt_clock, MSM_XO_MODE_PIN_CTRL); if (rc < 0) { pr_err("Failed to vote for TCXO_DO pin control\n"); goto fail_vote; } } else { /* check for initial RFKILL block (power off) */ /* some RFKILL versions/configurations rfkill_register */ /* calls here for an initial set_block */ /* avoid calling i2c and regulator before unblock (on) */ if (platform_get_drvdata(&msm_bt_power_device) == NULL) { dev_info(&msm_bt_power_device.dev, "%s: initialized OFF/blocked\n", __func__); goto out; } bahama_bt(0); fail_clock: msm_xo_mode_vote(bt_clock, MSM_XO_MODE_OFF); fail_vote: msm_xo_put(bt_clock); fail_switch: bluetooth_switch_regulators(0); fail_put: bluetooth_use_regulators(0); } out: if (rc < 0) on = 0; dev_info(&msm_bt_power_device.dev, "Bluetooth power switch: state %d result %d\n", on, rc); return rc; } #endif /*CONFIG_MARIMBA_CORE, CONFIG_MSM_BT_POWER, CONFIG_MSM_BT_POWER_MODULE*/ #ifdef CONFIG_MSM_RPM static struct msm_rpm_platform_data msm_rpm_data = { .reg_base_addrs = { [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE, [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400, [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600, [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00, }, .irq_ack = RPM_SCSS_CPU0_GP_HIGH_IRQ, .irq_err = RPM_SCSS_CPU0_GP_LOW_IRQ, .irq_vmpm = RPM_SCSS_CPU0_GP_MEDIUM_IRQ, .msm_apps_ipc_rpm_reg = MSM_GCC_BASE + 0x008, .msm_apps_ipc_rpm_val = 4, }; #endif struct msm_board_data { struct msm_gpiomux_configs *gpiomux_cfgs; }; static struct msm_board_data msm8x60_qt_board_data __initdata = { .gpiomux_cfgs = msm8x60_qt_gpiomux_cfgs, }; static void __init msm8x60_init(struct msm_board_data *board_data) { uint32_t soc_platform_version; /* * Initialize RPM first as other drivers and devices may need * it for their initialization. */ #ifdef CONFIG_MSM_RPM BUG_ON(msm_rpm_init(&msm_rpm_data)); #endif if (msm_xo_init()) pr_err("Failed to initialize XO votes\n"); if (socinfo_init() < 0) printk(KERN_ERR "%s: socinfo_init() failed!\n", __func__); #ifdef CONFIG_MSM_KGSL_2D msm8x60_check_2d_hardware(); #endif /* Change SPM handling of core 1 if PMM 8160 is present. */ soc_platform_version = socinfo_get_platform_version(); if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1 && SOCINFO_VERSION_MINOR(soc_platform_version) >= 2) { struct msm_spm_platform_data *spm_data; spm_data = &msm_spm_data_v1[1]; spm_data->reg_init_values[MSM_SPM_REG_SAW_CFG] &= ~0x0F00UL; spm_data->reg_init_values[MSM_SPM_REG_SAW_CFG] |= 0x0100UL; spm_data = &msm_spm_data[1]; spm_data->reg_init_values[MSM_SPM_REG_SAW_CFG] &= ~0x0F00UL; spm_data->reg_init_values[MSM_SPM_REG_SAW_CFG] |= 0x0100UL; } /* * Initialize SPM before acpuclock as the latter calls into SPM * driver to set ACPU voltages. */ if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); else msm_spm_init(msm_spm_data_v1, ARRAY_SIZE(msm_spm_data_v1)); /* * Disable regulator info printing so that regulator registration * messages do not enter the kmsg log. */ regulator_suppress_info_printing(); /* Initialize regulators needed for clock_init. */ platform_add_devices(early_regulators, ARRAY_SIZE(early_regulators)); msm_clock_init(msm_clocks_8x60, msm_num_clocks_8x60); /* Buses need to be initialized before early-device registration * to get the platform data for fabrics. */ msm8x60_init_buses(); platform_add_devices(early_devices, ARRAY_SIZE(early_devices)); msm_acpu_clock_init(&msm8x60_acpu_clock_data); msm8x60_init_tlmm(); msm8x60_init_gpiomux(board_data->gpiomux_cfgs); msm8x60_init_mmc(); #if defined(CONFIG_PMIC8058_OTHC) || defined(CONFIG_PMIC8058_OTHC_MODULE) msm8x60_init_pm8058_othc(); #endif #ifdef CONFIG_BATTERY_MSM8X60 platform_device_register(&msm_charger_device); #endif if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) platform_add_devices(msm_footswitch_devices, msm_num_footswitch_devices); platform_add_devices(qt_devices, ARRAY_SIZE(qt_devices)); #ifdef CONFIG_USB_EHCI_MSM_72K msm_add_host(0, &msm_usb_host_pdata); #endif msm_fb_add_devices(); fixup_i2c_configs(); register_i2c_devices(); msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), msm_pm_data); #ifdef CONFIG_MSM8X60_AUDIO msm_snddev_init(); #endif } static void __init msm8x60_qt_init(void) { msm8x60_init(&msm8x60_qt_board_data); } MACHINE_START(MSM8X60_QT, "QCT MSM8X60 QT") #ifdef CONFIG_MSM_DEBUG_UART .phys_io = MSM_DEBUG_UART_PHYS, .io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc, #endif .map_io = msm8x60_map_io, .init_irq = msm8x60_init_irq, .init_machine = msm8x60_qt_init, .timer = &msm_timer, MACHINE_END
gpl-2.0
rhuitl/uClinux
user/snort/src/output-plugins/spo_alert_arubaaction.c
15256
/* ** Copyright (C) 2006 Joshua Wright <jwright@arubanetworks.com> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* $Id$ */ /* spo_alert_arubaaction * * Purpose: output plugin for dynamically changing station access status on * an Aruba switch. * * Arguments: switch secret_type secret action * switch IP address of the Aruba switch * secret_type How secret is represented, one of "sha1", "md5" or * "cleartext" * secret The shared secret configured on the Aruba switch * action The action the switch should take with the target user * * Effect: * * When an alert is passed to this output plugin, the plugin connects to the * specified switch using the secret for authentication and applies the * configured action for the source IP address of the alert. This allows the * administrator to establish rules that will dynamically blacklist a user, * allowing the administrator to define rules that take action based on the * power of the Snort rules language. */ /* output plugin header file */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "event.h" #include "decode.h" #include "debug.h" #include "plugbase.h" #include "spo_plugbase.h" #include "parser.h" #include "util.h" #include "log.h" #include "mstring.h" #include "snort.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #ifdef HAVE_STRINGS_H #include <strings.h> #endif #ifndef WIN32 #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #endif /* !WIN32 */ #include <sys/types.h> typedef struct _SpoAlertArubaActionData { char *secret; uint8_t secret_type; uint8_t action_type; char *role_name; struct in_addr aswitch; int fd; } SpoAlertArubaActionData; #define MAX_XML_PAYLOAD_LEN 512 #define MAX_POST_LEN 1024 #define MAX_RESPONSE_LEN MAX_POST_LEN typedef struct _ArubaSecretType { uint8_t type; char *name; } ArubaSecretType; #define ARUBA_SECRET_UNKNOWN 0 #define ARUBA_SECRET_SHA1 1 #define ARUBA_SECRET_MD5 2 #define ARUBA_SECRET_PLAIN 4 const ArubaSecretType secret_lookup[] = { { ARUBA_SECRET_SHA1, "sha1" }, { ARUBA_SECRET_MD5, "md5" }, { ARUBA_SECRET_PLAIN, "cleartext" }, { 0, NULL } }; #define ArubaActionType ArubaSecretType #define ARUBA_ACTION_UNKNOWN 0 #define ARUBA_ACTION_BLACKLIST 1 #define ARUBA_ACTION_SETROLE 2 const ArubaActionType action_lookup[] = { { ARUBA_ACTION_BLACKLIST, "blacklist" }, { ARUBA_ACTION_SETROLE, "setrole" }, { 0, NULL } }; #define ArubaResponseCode ArubaSecretType #define ARUBA_RESP_SUCCESS 0 #define ARUBA_RESP_UNKN_USER 1 #define ARUBA_RESP_UNKN_ROLE 2 #define ARUBA_RESP_UNKN_EXT_AGENT 3 #define ARUBA_RESP_AUTH_FAILED 4 #define ARUBA_RESP_INVAL_CMD 5 #define ARUBA_RESP_INVAL_AUTH_METHOD 6 #define ARUBA_RESP_INVAL_MSG_DGST 7 #define ARUBA_RESP_MSSNG_MSG_AUTH 8 const ArubaResponseCode response_lookup[] = { { ARUBA_RESP_SUCCESS, "success" }, { ARUBA_RESP_UNKN_USER, "unknown user" }, { ARUBA_RESP_UNKN_ROLE, "unknown role" }, { ARUBA_RESP_UNKN_EXT_AGENT, "unknown external agent" }, { ARUBA_RESP_AUTH_FAILED, "authentication failed" }, { ARUBA_RESP_INVAL_CMD, "invalid command" }, { ARUBA_RESP_INVAL_AUTH_METHOD, "invalid message authentication method" }, { ARUBA_RESP_INVAL_MSG_DGST, "invalid message digest" }, { ARUBA_RESP_MSSNG_MSG_AUTH, "missing message authentication" }, { 0, NULL } }; void AlertArubaActionInit(u_char *); SpoAlertArubaActionData *ParseAlertArubaActionArgs(char *); void AlertArubaActionCleanExitFunc(int, void *); void AlertArubaActionRestartFunc(int, void *); void AlertArubaAction(Packet *, char *, void *, Event *); int ArubaSwitchConnect(SpoAlertArubaActionData *data); int ArubaSwitchSend(SpoAlertArubaActionData *data, uint8_t *post, int len); int ArubaSwitchRecv(SpoAlertArubaActionData *data, uint8_t *recv, int maxlen); /* * Function: SetupAlertArubaAction() * * Purpose: Registers the output plugin keyword and initialization * function into the output plugin list. This is the function that * gets called from InitOutputPlugins() in plugbase.c. * * Arguments: None. * * Returns: void function * */ void AlertArubaActionSetup(void) { /* link the preprocessor keyword to the init function in the preproc list */ RegisterOutputPlugin("alert_aruba_action", NT_OUTPUT_ALERT, AlertArubaActionInit); DEBUG_WRAP(DebugMessage(DEBUG_INIT,"Output plugin: AlertArubaAction is " "setup...\n");); } /* * Function: AlertArubaActionInit(u_char *) * * Purpose: Calls the argument parsing function, performs final setup on data * structs, links the preproc function into the function list. * * Arguments: args => ptr to argument string * * Returns: void function * */ void AlertArubaActionInit(u_char *args) { SpoAlertArubaActionData *data; DEBUG_WRAP(DebugMessage(DEBUG_INIT,"Output: AlertArubaAction " "Initialized\n");); pv.alert_plugin_active = 1; /* parse the argument list from the rules file */ data = ParseAlertArubaActionArgs(args); DEBUG_WRAP(DebugMessage(DEBUG_INIT,"Linking AlertArubaAction functions " "to call lists...\n");); /* Set the preprocessor function into the function list */ AddFuncToOutputList(AlertArubaAction, NT_OUTPUT_ALERT, data); AddFuncToCleanExitList(AlertArubaActionCleanExitFunc, data); AddFuncToRestartList(AlertArubaActionRestartFunc, data); } void AlertArubaAction(Packet *p, char *msg, void *arg, Event *event) { char cmdbuf[MAX_XML_PAYLOAD_LEN], post[MAX_POST_LEN]; char response[MAX_RESPONSE_LEN]; char *cmdbufp, *responsecode, *responsemsg; int postlen, xmllenrem, i, responsecodei; SpoAlertArubaActionData *data = (SpoAlertArubaActionData *)arg; cmdbufp = cmdbuf; /* Establish a connection to the switch */ data->fd = ArubaSwitchConnect(data); if (data->fd < 0) { ErrorMessage("Unable to connect to Aruba switch at %s\n", inet_ntoa(data->aswitch)); return; } xmllenrem = MAX_XML_PAYLOAD_LEN; switch(data->action_type) { case ARUBA_ACTION_BLACKLIST: snprintf(cmdbufp, xmllenrem, "xml=<aruba " "command=user_blacklist>"); break; case ARUBA_ACTION_SETROLE: snprintf(cmdbufp, xmllenrem, "xml=<aruba command=user_add>" "<role>%s</role>", data->role_name); break; default: /* The parser prevents this from happening */ ErrorMessage("aruba_action: invalid action type specified"); return; break; } xmllenrem -= strlen(cmdbufp); cmdbufp += strlen(cmdbufp); if (xmllenrem < 1) { ErrorMessage("aruba_action: configuration parameters too " "long\n"); FatalError("Unable to parse configuration parameters for Aruba" "Action output plugin.\n"); return; } snprintf(cmdbufp, xmllenrem, "<ipaddr>%s</ipaddr>", inet_ntoa(p->iph->ip_src)); xmllenrem -= strlen(cmdbufp); cmdbufp += strlen(cmdbufp); if (xmllenrem < 1) { ErrorMessage("aruba_action: configuration parameters too " "long\n"); FatalError("Unable to parse configuration parameters for Aruba" "Action output plugin.\n"); return; } switch(data->secret_type) { case ARUBA_SECRET_SHA1: snprintf(cmdbufp, xmllenrem, "<authentication>sha-1" "</authentication>"); break; case ARUBA_SECRET_MD5: snprintf(cmdbufp, xmllenrem, "<authentication>md5" "</authentication>"); break; case ARUBA_SECRET_PLAIN: snprintf(cmdbufp, xmllenrem, "<authentication>cleartext" "</authentication>"); break; default: /* The parser prevents this from happening */ ErrorMessage("aruba_action: invalid secret type specified"); return; break; } xmllenrem -= strlen(cmdbufp); cmdbufp += strlen(cmdbufp); if (xmllenrem < 1) { ErrorMessage("aruba_action: configuration parameters too " "long\n"); FatalError("Unable to parse configuration parameters for Aruba" "Action output plugin.\n"); return; } snprintf(cmdbufp, xmllenrem, "<key>%s</key>", data->secret); xmllenrem -= strlen(cmdbufp); cmdbufp += strlen(cmdbufp); if (xmllenrem < 1) { ErrorMessage("aruba_action: configuration parameters too " "long\n"); FatalError("Unable to parse configuration parameters for Aruba" "Action output plugin.\n"); return; } snprintf(cmdbufp, xmllenrem, "<version>1.0</version>"); xmllenrem -= strlen(cmdbufp); cmdbufp += strlen(cmdbufp); if (xmllenrem < 1) { ErrorMessage("aruba_action: configuration parameters too " "long\n"); FatalError("Unable to parse configuration parameters for Aruba" "Action output plugin.\n"); return; } snprintf(cmdbufp, xmllenrem, "</aruba>"); xmllenrem -= strlen(cmdbufp); cmdbufp += strlen(cmdbufp); cmdbufp = NULL; postlen = snprintf(post, MAX_POST_LEN-1, "POST /auth/command.xml HTTP/1.0\r\n" "User-Agent: snort\r\n" "Host: %s\r\n" "Pragma: no-cache\r\n" "Content-Length: %zu\r\n" "Content-Type: application/xml\r\n" "\r\n" "%s", inet_ntoa(data->aswitch), strlen(cmdbuf), cmdbuf); /* Send the action command to the switch */ if (ArubaSwitchSend(data, post, postlen) != postlen) { ErrorMessage("aruba_action: Error sending data to Aruba " "switch.\n"); close(data->fd); return; } /* Read the response from the switch */ if (ArubaSwitchRecv(data, response, MAX_RESPONSE_LEN) < 0) { ErrorMessage("aruba_action: Error reading response from Aruba" " switch\n"); close(data->fd); return; } /* Extract the result code from the response */ responsecode = strstr(response, "<code>"); if (responsecode == NULL) { ErrorMessage("aruba_action: Error extracting response code " "from Aruba switch\n"); close(data->fd); return; } /* Advance beyond "<code>" */ responsecode += (strlen("<code>")); /* Lookup code message */ //responsecodei = 0; if (sscanf(responsecode, "%d", &responsecodei) != 1) { ErrorMessage("aruba_action: Invalid response code returned from" " the Aruba switch.\n"); return; } if (responsecodei != 0) { responsemsg = NULL; for (i=0; response_lookup[i].name != NULL; i++) { if (response_lookup[i].type == responsecodei) { responsemsg = response_lookup[i].name; break; } } if (responsemsg == NULL) { ErrorMessage("aruba_action: Switch returned error " "status of %d \"unknown\"\n", responsecodei); } else { ErrorMessage("aruba_action: Switch returned error " "status of %d \"%s\"\n", responsecodei, responsemsg); } close(data->fd); return; } close(data->fd); return; } int ArubaSwitchSend(SpoAlertArubaActionData *data, uint8_t *post, int len) { return(write(data->fd, post, len)); } int ArubaSwitchRecv(SpoAlertArubaActionData *data, uint8_t *recv, int maxlen) { return(read(data->fd, recv, maxlen)); } int ArubaSwitchConnect(SpoAlertArubaActionData *data) { struct sockaddr_in sa; sa.sin_addr.s_addr = data->aswitch.s_addr; sa.sin_family = AF_INET; sa.sin_port = htons(80); data->fd = socket(AF_INET, SOCK_STREAM, 0); if (data->fd < 0) { ErrorMessage("aruba_action: socket error\n"); return -1; } if (connect(data->fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) { perror("connect"); ErrorMessage("aruba_action: Unable to connect to switch\n"); close(data->fd); return -1; } return data->fd; } /* * Function: ParseAlertArubaActionArgs(char *) * * Purpose: Process the preprocessor arguments from the rules file and * initialize the preprocessor's data struct. This function doesn't * have to exist if it makes sense to parse the args in the init * function. * * Arguments: args => argument list * * Returns: void function * */ SpoAlertArubaActionData *ParseAlertArubaActionArgs(char *args) { char **toks, **action_toks; int num_toks, num_action_toks, i; SpoAlertArubaActionData *data; data = (SpoAlertArubaActionData *)SnortAlloc(sizeof(SpoAlertArubaActionData)); if(args == NULL) { ErrorMessage("aruba_action: you must specify arguments for the " "Aruba Action plugin\n"); FatalError("No output plugin arguments specified\n"); return NULL; } DEBUG_WRAP(DebugMessage(DEBUG_LOG, "ParseAlertArubaActionArgs: %s\n", args);); toks = mSplit(args, " ", 4, &num_toks, 0); if (num_toks != 4) { ErrorMessage("aruba_action: incorrect number of arguments " "specified (%d)\n", num_toks); FatalError("Invalid argument count\n"); return NULL; } if (inet_aton(toks[0], &data->aswitch) == 0) { ErrorMessage("aruba_action: invalid Aruba switch address " "specified (%s)\n", toks[0]); FatalError("Invalid Aruba switch address.\n"); return NULL; } for (i=0; secret_lookup[i].name != NULL; i++) { if (strncmp(toks[1], secret_lookup[i].name, strlen(secret_lookup[i].name)) == 0) { data->secret_type = secret_lookup[i].type; break; } } if (data->secret_type == ARUBA_SECRET_UNKNOWN) { ErrorMessage("aruba_action: unknown secret type \"%s\"\n", toks[1]); FatalError("Unsupported secret type specified\n"); return NULL; } data->secret = (char *)SnortAlloc(strlen(toks[2])+1); strncpy(data->secret, toks[2], strlen(toks[2])); /* action can be "blacklist" or "setrole:rolename", parse */ for (i=0; action_lookup[i].name != NULL; i++) { if (strncmp(action_lookup[i].name, toks[3], strlen(action_lookup[i].name)) == 0) { data->action_type = action_lookup[i].type; break; } } if (data->action_type == ARUBA_ACTION_UNKNOWN) { ErrorMessage("aruba_action: unknown action type \"%s\"\n", toks[3]); FatalError("Unsupported action type specified\n"); return NULL; } /* Break out role name for setrole action */ if (data->action_type == ARUBA_ACTION_SETROLE) { action_toks = mSplit(toks[3], ":", 2, &num_action_toks, 0); if (num_action_toks != 2) { ErrorMessage("aruba_action: malformed setrole action " "specification \"%s\"\n", toks[3]); FatalError("Improperly formatted action\n"); return NULL; } data->role_name = (char *)SnortAlloc(strlen(action_toks[1])+1); strncpy(data->role_name, action_toks[1], strlen(action_toks[1])); } /* free toks */ mSplitFree(&toks, num_toks); return data; } void AlertArubaActionCleanExitFunc(int signal, void *arg) { SpoAlertArubaActionData *data = (SpoAlertArubaActionData *)arg; DEBUG_WRAP(DebugMessage(DEBUG_LOG,"AlertArubaActionCleanExitFunc\n");); free(data->secret); free(data->role_name); free(data); } void AlertArubaActionRestartFunc(int signal, void *arg) { SpoAlertArubaActionData *data = (SpoAlertArubaActionData *)arg; DEBUG_WRAP(DebugMessage(DEBUG_LOG,"AlertArubaActionRestartFunc\n");); free(data->secret); free(data->role_name); free(data); }
gpl-2.0
akw28888/caf2
drivers/usb/gadget/f_serial.c
27576
/* * f_serial.c - generic USB serial function driver * * Copyright (C) 2003 Al Borchers (alborchers@steinerpoint.com) * Copyright (C) 2008 by David Brownell * Copyright (C) 2008 by Nokia Corporation * * This software is distributed under the terms of the GNU General * Public License ("GPL") as published by the Free Software Foundation, * either version 2 of that License or (at your option) any later version. */ #include <linux/slab.h> #include <linux/kernel.h> #include <linux/device.h> #include <mach/usb_gadget_xport.h> #include "u_serial.h" #include "gadget_chips.h" /* * This function packages a simple "generic serial" port with no real * control mechanisms, just raw data transfer over two bulk endpoints. * * Because it's not standardized, this isn't as interoperable as the * CDC ACM driver. However, for many purposes it's just as functional * if you can arrange appropriate host side drivers. */ #define GSERIAL_NO_PORTS 3 struct f_gser { struct gserial port; u8 data_id; u8 port_num; u8 online; enum transport_type transport; #ifdef CONFIG_MODEM_SUPPORT u8 pending; spinlock_t lock; struct usb_ep *notify; struct usb_request *notify_req; struct usb_cdc_line_coding port_line_coding; /* SetControlLineState request */ u16 port_handshake_bits; #define ACM_CTRL_RTS (1 << 1) /* unused with full duplex */ #define ACM_CTRL_DTR (1 << 0) /* host is ready for data r/w */ /* SerialState notification */ u16 serial_state; #define ACM_CTRL_OVERRUN (1 << 6) #define ACM_CTRL_PARITY (1 << 5) #define ACM_CTRL_FRAMING (1 << 4) #define ACM_CTRL_RI (1 << 3) #define ACM_CTRL_BRK (1 << 2) #define ACM_CTRL_DSR (1 << 1) #define ACM_CTRL_DCD (1 << 0) #endif }; static unsigned int no_tty_ports; static unsigned int no_sdio_ports; static unsigned int no_smd_ports; static unsigned int no_hsic_sports; static unsigned int no_hsuart_sports; static unsigned int nr_ports; static struct port_info { enum transport_type transport; unsigned port_num; unsigned client_port_num; #if defined(CONFIG_USB_AT) int enable; #endif } gserial_ports[GSERIAL_NO_PORTS]; static inline bool is_transport_sdio(enum transport_type t) { if (t == USB_GADGET_XPORT_SDIO) return 1; return 0; } static inline struct f_gser *func_to_gser(struct usb_function *f) { return container_of(f, struct f_gser, port.func); } #ifdef CONFIG_MODEM_SUPPORT static inline struct f_gser *port_to_gser(struct gserial *p) { return container_of(p, struct f_gser, port); } #define GS_LOG2_NOTIFY_INTERVAL 5 /* 1 << 5 == 32 msec */ #define GS_NOTIFY_MAXPACKET 10 /* notification + 2 bytes */ #endif /*-------------------------------------------------------------------------*/ /* interface descriptor: */ static struct usb_interface_descriptor gser_interface_desc = { .bLength = USB_DT_INTERFACE_SIZE, .bDescriptorType = USB_DT_INTERFACE, /* .bInterfaceNumber = DYNAMIC */ #ifdef CONFIG_MODEM_SUPPORT .bNumEndpoints = 3, #else .bNumEndpoints = 2, #endif .bInterfaceClass = USB_CLASS_VENDOR_SPEC, .bInterfaceSubClass = 0, .bInterfaceProtocol = 0, /* .iInterface = DYNAMIC */ }; #ifdef CONFIG_MODEM_SUPPORT static struct usb_cdc_header_desc gser_header_desc = { .bLength = sizeof(gser_header_desc), .bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorSubType = USB_CDC_HEADER_TYPE, .bcdCDC = __constant_cpu_to_le16(0x0110), }; static struct usb_cdc_call_mgmt_descriptor gser_call_mgmt_descriptor = { .bLength = sizeof(gser_call_mgmt_descriptor), .bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE, .bmCapabilities = 0, /* .bDataInterface = DYNAMIC */ }; static struct usb_cdc_acm_descriptor gser_descriptor = { .bLength = sizeof(gser_descriptor), .bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorSubType = USB_CDC_ACM_TYPE, .bmCapabilities = USB_CDC_CAP_LINE, }; static struct usb_cdc_union_desc gser_union_desc = { .bLength = sizeof(gser_union_desc), .bDescriptorType = USB_DT_CS_INTERFACE, .bDescriptorSubType = USB_CDC_UNION_TYPE, /* .bMasterInterface0 = DYNAMIC */ /* .bSlaveInterface0 = DYNAMIC */ }; #endif /* full speed support: */ #ifdef CONFIG_MODEM_SUPPORT static struct usb_endpoint_descriptor gser_fs_notify_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = USB_DIR_IN, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = __constant_cpu_to_le16(GS_NOTIFY_MAXPACKET), .bInterval = 1 << GS_LOG2_NOTIFY_INTERVAL, }; #endif static struct usb_endpoint_descriptor gser_fs_in_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = USB_DIR_IN, .bmAttributes = USB_ENDPOINT_XFER_BULK, }; static struct usb_endpoint_descriptor gser_fs_out_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = USB_DIR_OUT, .bmAttributes = USB_ENDPOINT_XFER_BULK, }; static struct usb_descriptor_header *gser_fs_function[] = { (struct usb_descriptor_header *) &gser_interface_desc, #ifdef CONFIG_MODEM_SUPPORT (struct usb_descriptor_header *) &gser_header_desc, (struct usb_descriptor_header *) &gser_call_mgmt_descriptor, (struct usb_descriptor_header *) &gser_descriptor, (struct usb_descriptor_header *) &gser_union_desc, (struct usb_descriptor_header *) &gser_fs_notify_desc, #endif (struct usb_descriptor_header *) &gser_fs_in_desc, (struct usb_descriptor_header *) &gser_fs_out_desc, NULL, }; /* high speed support: */ #ifdef CONFIG_MODEM_SUPPORT static struct usb_endpoint_descriptor gser_hs_notify_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = USB_DIR_IN, .bmAttributes = USB_ENDPOINT_XFER_INT, .wMaxPacketSize = __constant_cpu_to_le16(GS_NOTIFY_MAXPACKET), .bInterval = GS_LOG2_NOTIFY_INTERVAL+4, }; #endif static struct usb_endpoint_descriptor gser_hs_in_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bmAttributes = USB_ENDPOINT_XFER_BULK, .wMaxPacketSize = __constant_cpu_to_le16(512), }; static struct usb_endpoint_descriptor gser_hs_out_desc = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bmAttributes = USB_ENDPOINT_XFER_BULK, .wMaxPacketSize = __constant_cpu_to_le16(512), }; static struct usb_descriptor_header *gser_hs_function[] = { (struct usb_descriptor_header *) &gser_interface_desc, #ifdef CONFIG_MODEM_SUPPORT (struct usb_descriptor_header *) &gser_header_desc, (struct usb_descriptor_header *) &gser_call_mgmt_descriptor, (struct usb_descriptor_header *) &gser_descriptor, (struct usb_descriptor_header *) &gser_union_desc, (struct usb_descriptor_header *) &gser_hs_notify_desc, #endif (struct usb_descriptor_header *) &gser_hs_in_desc, (struct usb_descriptor_header *) &gser_hs_out_desc, NULL, }; static struct usb_endpoint_descriptor gser_ss_in_desc __initdata = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bmAttributes = USB_ENDPOINT_XFER_BULK, .wMaxPacketSize = cpu_to_le16(1024), }; static struct usb_endpoint_descriptor gser_ss_out_desc __initdata = { .bLength = USB_DT_ENDPOINT_SIZE, .bDescriptorType = USB_DT_ENDPOINT, .bmAttributes = USB_ENDPOINT_XFER_BULK, .wMaxPacketSize = cpu_to_le16(1024), }; static struct usb_ss_ep_comp_descriptor gser_ss_bulk_comp_desc __initdata = { .bLength = sizeof gser_ss_bulk_comp_desc, .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, }; static struct usb_descriptor_header *gser_ss_function[] __initdata = { (struct usb_descriptor_header *) &gser_interface_desc, (struct usb_descriptor_header *) &gser_ss_in_desc, (struct usb_descriptor_header *) &gser_ss_bulk_comp_desc, (struct usb_descriptor_header *) &gser_ss_out_desc, (struct usb_descriptor_header *) &gser_ss_bulk_comp_desc, NULL, }; /* string descriptors: */ static struct usb_string gser_string_defs[] = { [0].s = "Generic Serial", { } /* end of list */ }; static struct usb_gadget_strings gser_string_table = { .language = 0x0409, /* en-us */ .strings = gser_string_defs, }; static struct usb_gadget_strings *gser_strings[] = { &gser_string_table, NULL, }; static int gport_setup(struct usb_configuration *c) { int ret = 0; int port_idx; int i; pr_debug("%s: no_tty_ports: %u no_sdio_ports: %u" " no_smd_ports: %u no_hsic_sports: %u no_hsuart_ports: %u nr_ports: %u\n", __func__, no_tty_ports, no_sdio_ports, no_smd_ports, no_hsic_sports, no_hsuart_sports, nr_ports); if (no_tty_ports) ret = gserial_setup(c->cdev->gadget, no_tty_ports); if (no_sdio_ports) ret = gsdio_setup(c->cdev->gadget, no_sdio_ports); if (no_smd_ports) ret = gsmd_setup(c->cdev->gadget, no_smd_ports); if (no_hsic_sports) { port_idx = ghsic_data_setup(no_hsic_sports, USB_GADGET_SERIAL); if (port_idx < 0) return port_idx; for (i = 0; i < nr_ports; i++) { if (gserial_ports[i].transport == USB_GADGET_XPORT_HSIC) { gserial_ports[i].client_port_num = port_idx; port_idx++; } } /*clinet port num is same for data setup and ctrl setup*/ ret = ghsic_ctrl_setup(no_hsic_sports, USB_GADGET_SERIAL); if (ret < 0) return ret; return 0; } if (no_hsuart_sports) { port_idx = ghsuart_data_setup(no_hsuart_sports, USB_GADGET_SERIAL); if (port_idx < 0) return port_idx; for (i = 0; i < nr_ports; i++) { if (gserial_ports[i].transport == USB_GADGET_XPORT_HSUART) { gserial_ports[i].client_port_num = port_idx; port_idx++; } } return 0; } return ret; } static int gport_connect(struct f_gser *gser) { unsigned port_num; int ret; pr_debug("%s: transport: %s f_gser: %p gserial: %p port_num: %d\n", __func__, xport_to_str(gser->transport), gser, &gser->port, gser->port_num); port_num = gserial_ports[gser->port_num].client_port_num; switch (gser->transport) { case USB_GADGET_XPORT_TTY: gserial_connect(&gser->port, port_num); break; case USB_GADGET_XPORT_SDIO: gsdio_connect(&gser->port, port_num); break; case USB_GADGET_XPORT_SMD: gsmd_connect(&gser->port, port_num); break; case USB_GADGET_XPORT_HSIC: ret = ghsic_ctrl_connect(&gser->port, port_num); if (ret) { pr_err("%s: ghsic_ctrl_connect failed: err:%d\n", __func__, ret); return ret; } ret = ghsic_data_connect(&gser->port, port_num); if (ret) { pr_err("%s: ghsic_data_connect failed: err:%d\n", __func__, ret); ghsic_ctrl_disconnect(&gser->port, port_num); return ret; } break; case USB_GADGET_XPORT_HSUART: ret = ghsuart_data_connect(&gser->port, port_num); if (ret) { pr_err("%s: ghsuart_data_connect failed: err:%d\n", __func__, ret); return ret; } break; default: pr_err("%s: Un-supported transport: %s\n", __func__, xport_to_str(gser->transport)); return -ENODEV; } return 0; } static int gport_disconnect(struct f_gser *gser) { unsigned port_num; pr_debug("%s: transport: %s f_gser: %p gserial: %p port_num: %d\n", __func__, xport_to_str(gser->transport), gser, &gser->port, gser->port_num); port_num = gserial_ports[gser->port_num].client_port_num; switch (gser->transport) { case USB_GADGET_XPORT_TTY: gserial_disconnect(&gser->port); break; case USB_GADGET_XPORT_SDIO: gsdio_disconnect(&gser->port, port_num); break; case USB_GADGET_XPORT_SMD: gsmd_disconnect(&gser->port, port_num); break; case USB_GADGET_XPORT_HSIC: ghsic_ctrl_disconnect(&gser->port, port_num); ghsic_data_disconnect(&gser->port, port_num); break; case USB_GADGET_XPORT_HSUART: ghsuart_data_disconnect(&gser->port, port_num); break; default: pr_err("%s: Un-supported transport:%s\n", __func__, xport_to_str(gser->transport)); return -ENODEV; } return 0; } #ifdef CONFIG_MODEM_SUPPORT static void gser_complete_set_line_coding(struct usb_ep *ep, struct usb_request *req) { struct f_gser *gser = ep->driver_data; struct usb_composite_dev *cdev = gser->port.func.config->cdev; if (req->status != 0) { DBG(cdev, "gser ttyGS%d completion, err %d\n", gser->port_num, req->status); return; } /* normal completion */ if (req->actual != sizeof(gser->port_line_coding)) { DBG(cdev, "gser ttyGS%d short resp, len %d\n", gser->port_num, req->actual); usb_ep_set_halt(ep); } else { struct usb_cdc_line_coding *value = req->buf; gser->port_line_coding = *value; } } /*-------------------------------------------------------------------------*/ static int gser_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) { struct f_gser *gser = func_to_gser(f); struct usb_composite_dev *cdev = f->config->cdev; struct usb_request *req = cdev->req; int value = -EOPNOTSUPP; u16 w_index = le16_to_cpu(ctrl->wIndex); u16 w_value = le16_to_cpu(ctrl->wValue); u16 w_length = le16_to_cpu(ctrl->wLength); switch ((ctrl->bRequestType << 8) | ctrl->bRequest) { /* SET_LINE_CODING ... just read and save what the host sends */ case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | USB_CDC_REQ_SET_LINE_CODING: if (w_length != sizeof(struct usb_cdc_line_coding)) goto invalid; value = w_length; cdev->gadget->ep0->driver_data = gser; req->complete = gser_complete_set_line_coding; break; /* GET_LINE_CODING ... return what host sent, or initial value */ case ((USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | USB_CDC_REQ_GET_LINE_CODING: value = min_t(unsigned, w_length, sizeof(struct usb_cdc_line_coding)); memcpy(req->buf, &gser->port_line_coding, value); break; /* SET_CONTROL_LINE_STATE ... save what the host sent */ case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8) | USB_CDC_REQ_SET_CONTROL_LINE_STATE: value = 0; gser->port_handshake_bits = w_value; if (gser->port.notify_modem) { unsigned port_num = gserial_ports[gser->port_num].client_port_num; gser->port.notify_modem(&gser->port, port_num, w_value); } break; default: invalid: DBG(cdev, "invalid control req%02x.%02x v%04x i%04x l%d\n", ctrl->bRequestType, ctrl->bRequest, w_value, w_index, w_length); } /* respond with data transfer or status phase? */ if (value >= 0) { DBG(cdev, "gser ttyGS%d req%02x.%02x v%04x i%04x l%d\n", gser->port_num, ctrl->bRequestType, ctrl->bRequest, w_value, w_index, w_length); req->zero = 0; req->length = value; value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC); if (value < 0) ERROR(cdev, "gser response on ttyGS%d, err %d\n", gser->port_num, value); } /* device either stalls (value < 0) or reports success */ return value; } #endif static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned alt) { struct f_gser *gser = func_to_gser(f); struct usb_composite_dev *cdev = f->config->cdev; int rc = 0; /* we know alt == 0, so this is an activation or a reset */ #ifdef CONFIG_MODEM_SUPPORT if (gser->notify->driver_data) { DBG(cdev, "reset generic ctl ttyGS%d\n", gser->port_num); usb_ep_disable(gser->notify); } if (!gser->notify->desc) { if (config_ep_by_speed(cdev->gadget, f, gser->notify)) { gser->notify->desc = NULL; return -EINVAL; } } rc = usb_ep_enable(gser->notify); if (rc) { ERROR(cdev, "can't enable %s, result %d\n", gser->notify->name, rc); return rc; } gser->notify->driver_data = gser; #endif if (gser->port.in->driver_data) { DBG(cdev, "reset generic data ttyGS%d\n", gser->port_num); gport_disconnect(gser); } if (!gser->port.in->desc || !gser->port.out->desc) { DBG(cdev, "activate generic ttyGS%d\n", gser->port_num); if (config_ep_by_speed(cdev->gadget, f, gser->port.in) || config_ep_by_speed(cdev->gadget, f, gser->port.out)) { gser->port.in->desc = NULL; gser->port.out->desc = NULL; return -EINVAL; } } gport_connect(gser); gser->online = 1; #if defined(CONFIG_USB_AT) gserial_ports[gser->port_num].enable = gser->online; #endif return rc; } static void gser_disable(struct usb_function *f) { struct f_gser *gser = func_to_gser(f); struct usb_composite_dev *cdev = f->config->cdev; DBG(cdev, "generic ttyGS%d deactivated\n", gser->port_num); gport_disconnect(gser); #ifdef CONFIG_MODEM_SUPPORT usb_ep_fifo_flush(gser->notify); usb_ep_disable(gser->notify); #endif gser->online = 0; #if defined(CONFIG_USB_AT) gserial_ports[gser->port_num].enable = gser->online; #endif } #ifdef CONFIG_MODEM_SUPPORT static int gser_notify(struct f_gser *gser, u8 type, u16 value, void *data, unsigned length) { struct usb_ep *ep = gser->notify; struct usb_request *req; struct usb_cdc_notification *notify; const unsigned len = sizeof(*notify) + length; void *buf; int status; struct usb_composite_dev *cdev = gser->port.func.config->cdev; req = gser->notify_req; gser->notify_req = NULL; gser->pending = false; req->length = len; notify = req->buf; buf = notify + 1; notify->bmRequestType = USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE; notify->bNotificationType = type; notify->wValue = cpu_to_le16(value); notify->wIndex = cpu_to_le16(gser->data_id); notify->wLength = cpu_to_le16(length); memcpy(buf, data, length); status = usb_ep_queue(ep, req, GFP_ATOMIC); if (status < 0) { ERROR(cdev, "gser ttyGS%d can't notify serial state, %d\n", gser->port_num, status); gser->notify_req = req; } return status; } static int gser_notify_serial_state(struct f_gser *gser) { int status; unsigned long flags; struct usb_composite_dev *cdev = gser->port.func.config->cdev; spin_lock_irqsave(&gser->lock, flags); if (gser->notify_req) { DBG(cdev, "gser ttyGS%d serial state %04x\n", gser->port_num, gser->serial_state); status = gser_notify(gser, USB_CDC_NOTIFY_SERIAL_STATE, 0, &gser->serial_state, sizeof(gser->serial_state)); } else { gser->pending = true; status = 0; } spin_unlock_irqrestore(&gser->lock, flags); return status; } static void gser_notify_complete(struct usb_ep *ep, struct usb_request *req) { struct f_gser *gser = req->context; u8 doit = false; unsigned long flags; /* on this call path we do NOT hold the port spinlock, * which is why ACM needs its own spinlock */ spin_lock_irqsave(&gser->lock, flags); if (req->status != -ESHUTDOWN) doit = gser->pending; gser->notify_req = req; spin_unlock_irqrestore(&gser->lock, flags); if (doit && gser->online) gser_notify_serial_state(gser); } static void gser_connect(struct gserial *port) { struct f_gser *gser = port_to_gser(port); gser->serial_state |= ACM_CTRL_DSR | ACM_CTRL_DCD; gser_notify_serial_state(gser); } unsigned int gser_get_dtr(struct gserial *port) { struct f_gser *gser = port_to_gser(port); if (gser->port_handshake_bits & ACM_CTRL_DTR) return 1; else return 0; } unsigned int gser_get_rts(struct gserial *port) { struct f_gser *gser = port_to_gser(port); if (gser->port_handshake_bits & ACM_CTRL_RTS) return 1; else return 0; } unsigned int gser_send_carrier_detect(struct gserial *port, unsigned int yes) { struct f_gser *gser = port_to_gser(port); u16 state; state = gser->serial_state; state &= ~ACM_CTRL_DCD; if (yes) state |= ACM_CTRL_DCD; gser->serial_state = state; return gser_notify_serial_state(gser); } unsigned int gser_send_ring_indicator(struct gserial *port, unsigned int yes) { struct f_gser *gser = port_to_gser(port); u16 state; state = gser->serial_state; state &= ~ACM_CTRL_RI; if (yes) state |= ACM_CTRL_RI; gser->serial_state = state; return gser_notify_serial_state(gser); } static void gser_disconnect(struct gserial *port) { struct f_gser *gser = port_to_gser(port); gser->serial_state &= ~(ACM_CTRL_DSR | ACM_CTRL_DCD); gser_notify_serial_state(gser); } static int gser_send_break(struct gserial *port, int duration) { struct f_gser *gser = port_to_gser(port); u16 state; state = gser->serial_state; state &= ~ACM_CTRL_BRK; if (duration) state |= ACM_CTRL_BRK; gser->serial_state = state; return gser_notify_serial_state(gser); } static int gser_send_modem_ctrl_bits(struct gserial *port, int ctrl_bits) { struct f_gser *gser = port_to_gser(port); gser->serial_state = ctrl_bits; return gser_notify_serial_state(gser); } #endif /*-------------------------------------------------------------------------*/ /* serial function driver setup/binding */ static int gser_bind(struct usb_configuration *c, struct usb_function *f) { struct usb_composite_dev *cdev = c->cdev; struct f_gser *gser = func_to_gser(f); int status; struct usb_ep *ep; /* allocate instance-specific interface IDs */ status = usb_interface_id(c, f); if (status < 0) goto fail; gser->data_id = status; gser_interface_desc.bInterfaceNumber = status; status = -ENODEV; /* allocate instance-specific endpoints */ ep = usb_ep_autoconfig(cdev->gadget, &gser_fs_in_desc); if (!ep) goto fail; gser->port.in = ep; ep->driver_data = cdev; /* claim */ ep = usb_ep_autoconfig(cdev->gadget, &gser_fs_out_desc); if (!ep) goto fail; gser->port.out = ep; ep->driver_data = cdev; /* claim */ #ifdef CONFIG_MODEM_SUPPORT ep = usb_ep_autoconfig(cdev->gadget, &gser_fs_notify_desc); if (!ep) goto fail; gser->notify = ep; ep->driver_data = cdev; /* claim */ /* allocate notification */ gser->notify_req = gs_alloc_req(ep, sizeof(struct usb_cdc_notification) + 2, GFP_KERNEL); if (!gser->notify_req) goto fail; gser->notify_req->complete = gser_notify_complete; gser->notify_req->context = gser; #endif /* copy descriptors, and track endpoint copies */ f->descriptors = usb_copy_descriptors(gser_fs_function); if (!f->descriptors) goto fail; /* support all relevant hardware speeds... we expect that when * hardware is dual speed, all bulk-capable endpoints work at * both speeds */ if (gadget_is_dualspeed(c->cdev->gadget)) { gser_hs_in_desc.bEndpointAddress = gser_fs_in_desc.bEndpointAddress; gser_hs_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress; #ifdef CONFIG_MODEM_SUPPORT gser_hs_notify_desc.bEndpointAddress = gser_fs_notify_desc.bEndpointAddress; #endif /* copy descriptors, and track endpoint copies */ f->hs_descriptors = usb_copy_descriptors(gser_hs_function); if (!f->hs_descriptors) goto fail; } if (gadget_is_superspeed(c->cdev->gadget)) { gser_ss_in_desc.bEndpointAddress = gser_fs_in_desc.bEndpointAddress; gser_ss_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress; /* copy descriptors, and track endpoint copies */ f->ss_descriptors = usb_copy_descriptors(gser_ss_function); if (!f->ss_descriptors) goto fail; } DBG(cdev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n", gser->port_num, gadget_is_superspeed(c->cdev->gadget) ? "super" : gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", gser->port.in->name, gser->port.out->name); return 0; fail: if (f->descriptors) usb_free_descriptors(f->descriptors); #ifdef CONFIG_MODEM_SUPPORT if (gser->notify_req) gs_free_req(gser->notify, gser->notify_req); /* we might as well release our claims on endpoints */ if (gser->notify) gser->notify->driver_data = NULL; #endif /* we might as well release our claims on endpoints */ if (gser->port.out) gser->port.out->driver_data = NULL; if (gser->port.in) gser->port.in->driver_data = NULL; ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); return status; } static void gser_unbind(struct usb_configuration *c, struct usb_function *f) { struct f_gser *gser = func_to_gser(f); if (gadget_is_dualspeed(c->cdev->gadget)) usb_free_descriptors(f->hs_descriptors); if (gadget_is_superspeed(c->cdev->gadget)) usb_free_descriptors(f->ss_descriptors); usb_free_descriptors(f->descriptors); if (gser->port.out) gser->port.out->driver_data = NULL; if (gser->port.in) gser->port.in->driver_data = NULL; #ifdef CONFIG_MODEM_SUPPORT if (gser->notify) { gs_free_req(gser->notify, gser->notify_req); gser->notify->driver_data = NULL; } #endif kfree(func_to_gser(f)); } /** * gser_bind_config - add a generic serial function to a configuration * @c: the configuration to support the serial instance * @port_num: /dev/ttyGS* port this interface will use * Context: single threaded during gadget setup * * Returns zero on success, else negative errno. * * Caller must have called @gserial_setup() with enough ports to * handle all the ones it binds. Caller is also responsible * for calling @gserial_cleanup() before module unload. */ int gser_bind_config(struct usb_configuration *c, u8 port_num) { struct f_gser *gser; int status; /* REVISIT might want instance-specific strings to help * distinguish instances ... */ /* maybe allocate device-global string ID */ if (gser_string_defs[0].id == 0) { status = usb_string_id(c->cdev); if (status < 0) return status; gser_string_defs[0].id = status; } /* allocate and initialize one new instance */ gser = kzalloc(sizeof *gser, GFP_KERNEL); if (!gser) return -ENOMEM; #ifdef CONFIG_MODEM_SUPPORT spin_lock_init(&gser->lock); #endif gser->port_num = port_num; gser->port.func.name = "gser"; gser->port.func.strings = gser_strings; gser->port.func.bind = gser_bind; gser->port.func.unbind = gser_unbind; gser->port.func.set_alt = gser_set_alt; gser->port.func.disable = gser_disable; gser->transport = gserial_ports[port_num].transport; #ifdef CONFIG_MODEM_SUPPORT /* FIXME: hardcode. We support only three ports for now */ if (port_num == 0) gser->port.func.name = "modem"; else if (port_num == 1) gser->port.func.name = "nmea"; else #if defined(CONFIG_USB_AT) gser->port.func.name = "at";//zhangjing add for at :modem2---at #else gser->port.func.name = "modem2"; #endif gser->port.func.setup = gser_setup; gser->port.connect = gser_connect; gser->port.get_dtr = gser_get_dtr; gser->port.get_rts = gser_get_rts; gser->port.send_carrier_detect = gser_send_carrier_detect; gser->port.send_ring_indicator = gser_send_ring_indicator; gser->port.send_modem_ctrl_bits = gser_send_modem_ctrl_bits; gser->port.disconnect = gser_disconnect; gser->port.send_break = gser_send_break; #endif if (gser->transport == USB_GADGET_XPORT_SMD) { gsmd_set_smd_port(&gser->port); } status = usb_add_function(c, &gser->port.func); if (status) kfree(gser); return status; } /** * gserial_init_port - bind a gserial_port to its transport */ static int gserial_init_port(int port_num, const char *name) { enum transport_type transport; if (port_num >= GSERIAL_NO_PORTS) return -ENODEV; transport = str_to_xport(name); pr_debug("%s, port:%d, transport:%s\n", __func__, port_num, xport_to_str(transport)); gserial_ports[port_num].transport = transport; gserial_ports[port_num].port_num = port_num; switch (transport) { case USB_GADGET_XPORT_TTY: gserial_ports[port_num].client_port_num = no_tty_ports; no_tty_ports++; break; case USB_GADGET_XPORT_SDIO: gserial_ports[port_num].client_port_num = no_sdio_ports; no_sdio_ports++; break; case USB_GADGET_XPORT_SMD: gserial_ports[port_num].client_port_num = no_smd_ports; no_smd_ports++; break; case USB_GADGET_XPORT_HSIC: /*client port number will be updated in gport_setup*/ no_hsic_sports++; break; case USB_GADGET_XPORT_HSUART: /*client port number will be updated in gport_setup*/ no_hsuart_sports++; break; default: pr_err("%s: Un-supported transport transport: %u\n", __func__, gserial_ports[port_num].transport); return -ENODEV; } nr_ports++; return 0; }
gpl-2.0
tao-k/zomeki
app/controllers/organization/public/piece/all_groups_controller.rb
441
class Organization::Public::Piece::AllGroupsController < Sys::Controller::Public::Base def pre_dispatch @piece = Organization::Piece::AllGroup.where(id: Page.current_piece.id).first render :text => '' unless @piece @item = Page.current_item end def index sys_group_codes = @piece.content.root_sys_group.children.pluck(:code) @groups = @piece.content.groups.public.where(sys_group_code: sys_group_codes) end end
gpl-3.0
jtux270/translate
ovirt/3.6_source/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/ExistingBlankTemplateModelBehavior.java
2954
package org.ovirt.engine.ui.uicommonweb.models.templates; import org.ovirt.engine.core.common.businessentities.VmBase; import org.ovirt.engine.core.common.businessentities.VmTemplate; import org.ovirt.engine.core.compat.Version; import org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor; import org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder; import org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel; import org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.ExistingNonClusterModelBehavior; public class ExistingBlankTemplateModelBehavior extends ExistingNonClusterModelBehavior { private VmTemplate template; public ExistingBlankTemplateModelBehavior(VmTemplate template) { super(template); this.template = template; } @Override protected void postBuild() { getModel().getBaseTemplate().setIsAvailable(false); getModel().getTemplateVersionName().setIsAvailable(false); getModel().getVmType().setIsChangeable(true); getModel().getEmulatedMachine().setIsAvailable(false); getModel().getCustomCpu().setIsAvailable(false); getModel().getOSType().setIsAvailable(false); updateCustomPropertySheet(latestCluster()); getModel().getCustomPropertySheet().deserialize(template.getCustomProperties()); updateTimeZone(template.getTimeZone()); getModel().getVmInitEnabled().setEntity(template.getVmInit() != null); getModel().getVmInitModel().init(template); } @Override protected Version getClusterCompatibilityVersion() { return latestCluster(); } @Override protected void buildModel(VmBase vmBase, BuilderExecutor.BuilderExecutionFinished<VmBase, UnitVmModel> callback) { new BuilderExecutor<>(callback, new NameAndDescriptionVmBaseToUnitBuilder(), new CommentVmBaseToUnitBuilder(), new CommonVmBaseToUnitBuilder( new HwOnlyVmBaseToUnitBuilder().withEveryFeatureSupported(), new CoreVmBaseToUnitBuilder( new KernelParamsVmBaseToUnitBuilder(), new SerialNumberPolicyVmBaseToUnitBuilder().withEveryFeatureSupported() ).withEveryFeatureSupported())) .build(vmBase, getModel()); } public VmTemplate getVmTemplate() { return template; } }
gpl-3.0
ddugovic/xboard-4.7.1
FAQ.html
87608
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:webmasters@gnu.org" /> <link rel="icon" type="image/png" href="/graphics/gnu-head-mini.png" /> <meta name="ICBM" content="42.256233,-71.006581" /> <meta name="DC.title" content="gnu.org" /> <title>XBoard and WinBoard: Frequently Asked Questions</title> <style type="text/css" media="all"> @import url('/style.css'); </style> <style type="text/css" media="print"> @import url('/print.css'); </style> </head> <body> <h1>XBoard and WinBoard: Frequently Asked Questions</h1> <p>This document answers some frequently asked questions about the graphical chess interfaces XBoard and WinBoard. A hyperlinked version of this FAQ is available on the Web through the page <a href="http://www.gnu.org/software/xboard/FAQ.html"> http://www.gnu.org/software/xboard/FAQ.html</a>.</p> <p><i>This FAQ is in need of revision. Please contact us if you'd like to help update it.</i></p> <hr /> <h2>Outline</h2> <ul> <li><a href="#tag-A0">[A] Introduction and hot topics</a></li> <li><a href="#tag-B0">[B] XBoard and WinBoard</a></li> <li><a href="#tag-C0">[C] XBoard and WinBoard, bugs and problems</a></li> <li><a href="#tag-D0">[D] Crafty and other topics</a></li> </ul> <hr /> <h2>Detailed contents</h2> <ul> <li><a name="tag-A0" href="#tag[A">[A] Introduction and hot topics</a> <ul> <li><a href="#tag-A.1">[A.1] What are XBoard and WinBoard?</a></li> <li><a href="#tag-A.2">[A.2] Where can I get chess information and chess software?</a></li> <li><a href="#tag-A.3">[A.3] What are the current version numbers for XBoard and WinBoard?</a></li> <li><a href="#tag-A.4">[A.4] Who is working on this project?</a></li> <li><a href="#tag-A.5">[A.5] How do I report bugs, offer help, etc.?</a></li> <li><a href="#tag-A.6">[A.6] What are the future plans for XBoard and WinBoard?</a></li> </ul></li> <li><a name="tag-B0" href="#tag[B">[B] XBoard and WinBoard</a> <ul> <li><a href="#tag-B.1">[B.1] What is XBoard?</a></li> <li><a href="#tag-B.2">[B.2] Is there an XBoard for Microsoft Windows? What is WinBoard? How do I install WinBoard?</a></li> <li><a href="#tag-B.3">[B.3] Is there an XBoard for the Amiga? What is AmyBoard?</a></li> <li><a href="#tag-B.4">[B.4] Is there an XBoard for the Macintosh?</a></li> <li><a href="#tag-B.5">[B.5] Does XBoard run on VMS?</a></li> <li><a href="#tag-B.6">[B.6] What is cmail?</a></li> <li><a href="#tag-B.7">[B.7] How do I build XBoard? Do I have to have gcc?</a></li> <li><a href="#tag-B.8">[B.8] Can I use XBoard or WinBoard to play a game of chess with another human?</a></li> <li><a href="#tag-B.9">[B.9] Will WinBoard run on Windows 3.1? How about Windows CE (also known as Pocket PC)?</a></li> <li><a href="#tag-B.10">[B.10] How do I use XBoard or WinBoard as an external viewer for PGN files with my Web browser?</a></li> <li><a href="#tag-B.11">[B.11] How do I use WinBoard as an external viewer for PGN files with the MS Windows File Manager or Explorer?</a></li> <li><a href="#tag-B.12">[B.12] How do I use ICC timestamp or FICS timeseal with XBoard?</a></li> <li><a href="#tag-B.13">[B.13] How do I use ICC timestamp or FICS timeseal with WinBoard?</a></li> <li><a href="#tag-B.14">[B.14] How do I play bughouse with XBoard or WinBoard?</a></li> <li><a href="#tag-B.16">[B.16] What is Zippy? How can I interface a chess program to the Internet Chess Servers?</a></li> <li><a href="#tag-B.17">[B.17] How can I interface my own chess program to XBoard or WinBoard?</a></li> <li><a href="#tag-B.18">[B.18] How can I recompile WinBoard from source?</a></li> <li><a href="#tag-B.19">[B.19] How can I use XBoard or WinBoard to talk to an Internet Chess Server through a firewall or proxy?</a></li> <li><a href="#tag-B.20">[B.20] How can I use XBoard or WinBoard on chess.net with accuclock?</a></li> <li><a href="#tag-B.21">[B.21] Can I get Zippy to do one or more ICS commands automatically at the start or end of each game?</a></li> <li><a href="#tag-B.22">[B.22] How do I print from WinBoard?</a></li> <li><a href="#tag-B.23">[B.23] Can I get Zippy to automatically reconnect to ICS when its connection breaks?</a></li> <li><a href="#tag-B.24">[B.24] The chess engines are too strong and always beat me. How can I adjust the difficulty level to make them weaker?</a></li> <li><a href="#tag-B.25">[B.25] May I use the piece bitmaps from XBoard/WinBoard in my own program?</a></li> <li><a href="#tag-B.26">[B.26] How can I get rid of these silly logos that this new WinBoard displays above the board?</a></li> <li><a href="#tag-B.27">[B.27] How can I install logos for other engines, Internet Chess Servers or Human users?</a></li> <li><a href="#tag-B.28">[B.28] Is there readline support for XBoard?</a></li> </ul></li> <li><a name="tag-C0" href="#tag-C">[C] XBoard and WinBoard, bugs and problems</a> <ul> <li><a href="#tag-C.1">[C.1] I can't build XBoard because the X11/Xaw/... include files are not found.</a></li> <li><a href="#tag-C.2">[C.2] Configuring or building XBoard fails due to missing header files, missing libraries, or undefined symbols.</a></li> <li><a href="#tag-C.3">[C.3] I have problems using WinBoard on ICS with a modem. I'm not running SLIP or PPP, but just dialing in to an ordinary login account("shell account").</a></li> <li><a href="#tag-C.4">[C.4] I have problems using WinBoard on ICS with Windows 95 and SLIP or PPP. When trying to start up, it gets the error "Address family not supported by protocol family" (or some equally strange message).</a></li> <li><a href="#tag-C.5">[C.5] When I try to run WinBoard, I get the message "Failed to start chess program gnuchess on localhost: NO LANGFILE (file gnuchess.lan not found)".</a></li> <li><a href="#tag-C.6">[C.6] I want to use XBoard or WinBoard as an Internet Chess Server interface, but the ICS Client option is grayed out on the menu.</a></li> <li><a href="#tag-C.7">[C.7] How do I give command-line options to a Windows program like WinBoard?</a></li> <li><a href="#tag-C.9">[C.9] When I exit from WinBoard after using it to play against a chess program on my machine, the chess program keeps running in the background.</a></li> <li><a href="#tag-C.12">[C.12] Why do my ICS opponents often get extra time after they make their moves? Why do I sometimes lose time off my clock after I make my move?</a></li> <li><a href="#tag-C.13">[C.13] I can't run WinBoard unless I delete the WinBoard.ini file each time!</a></li> <li><a href="#tag-C.15">[C.15] I get errors compiling XBoard's parser.c.</a></li> <li><a href="#tag-C.16">[C.16] I get an error building WinBoard from source because "flex" is not found.</a></li> <li><a href="#tag-C.17">[C.17] XBoard hangs shortly after connecting to an ICS when used with dxterm, cmdtool, dtterm, kterm, konsole, or other substitutes for xterm.</a></li> <li><a href="#tag-C.18">[C.18] The WinBoard pieces show up in the wrong colors, appear distorted, or are not visible at all.</a></li> <li><a href="#tag-C.19">[C.19] XBoard or WinBoard tells me "Error: first chess program (...) exited unexpectedly".</a></li> <li><a href="#tag-C.20">[C.20] XBoard tells me "Warning: Cannot allocate colormap entry", or "too few colors available; trying monochrome mode", or "XPM pieces cannot be used in monochrome mode".</a></li> <li><a href="#tag-C.21">[C.21] When I log in to freechess.org, the Enter key doesn't work, and I have to use Ctrl+J instead. But when I use WinBoard, Ctrl+J doesn't work either, so I'm stuck.</a></li> <li><a href="#tag-C.22">[C.22] XBoard says, "Failed to start first chess program fairymax on localhost: fairymax: No such file or directory."</a></li> </ul></li> <li><a name="tag-D0" href="#tag-D">[D] Crafty and other topics</a> <ul> <li><a href="#tag-D.1">[D.1] What is XChess?</a></li> <li><a href="#tag-D.2">[D.2] What is Winsock Chess?</a></li> <li><a href="#tag-D.3">[D.3] What is Crafty?</a></li> <li><a href="#tag-D.4">[D.4] How do I use Crafty with XBoard?</a></li> <li><a href="#tag-D.5">[D.5] How do I use Crafty with WinBoard?</a></li> <li><a href="#tag-D.6">[D.6] How do I use GNU Chess with XBoard?</a></li> <li><a href="#tag-D.7">[D.7] How do I use GNU Chess with WinBoard?</a></li> <li><a href="#tag-D.8">[D.8] What is Fairy-Max?</a></li> <li><a href="#tag-D.9">[D.9] What is UCI? What is Polyglot?</a></li> <li><a href="#tag-D.10">[D.10] How do I use an UCI engine with XBoard / WinBoard?</a></li> </ul></li> </ul> <hr /> <h2><a name="tag-A">[A] Introduction and hot topics</a></h2> <hr /> <h3><a name="tag-A.1">[A.1] What are XBoard and WinBoard?</a></h3> <p>XBoard and WinBoard are graphical user interfaces for chess. XBoard runs with the X Window System on Unix systems (including GNU/Linux); see topic <a href="#tag-B.1">[B.1]</a>. WinBoard runs on true 32-bit Microsoft Windows operating systems, such as Windows 95, 98, NT, 2000, ME, XP, Vista, and should continue to work on future 32-bit Windows systems. It does not work on Windows CE (also known as Pocket PC), nor does it work on 16-bit Windows systems such as Windows 3.1. See topic <a href="#tag-B.2">[B.2]</a>.</p> <hr /> <h3><a name="tag-A.2">[A.2] Where can I get chess information and chess software?</a></h3> <p>As a shortcut to most things mentioned in this FAQ, try Tim Mann's Chess Web page, <a href= "http://www.tim-mann.org/chess.html" >http://www.tim-mann.org/chess.html</a>. This page page is currently a very bad place to get the latest released versions of XBoard and WinBoard and the most up-to-date version of this FAQ, though. A better place is the <a href= "http://www.open-aurec.com/wbforum">WinBoard forum</a>. Also see our Savannah project pages at <a href="https://savannah.gnu.org/projects/xboard/" >https://savannah.gnu.org/projects/xboard/</a>.</p> <p>If you have other questions about XBoard/WinBoard that aren't answered in this FAQ, you can try Aaron Tay's WinBoard and Chess Engines FAQ, at<a href="http://www.aarontay.per.sg/Winboard/">defunct URL</a>.</p> <p>For general news and information about chess, try the <a href="http://www.talkchess.com/forum">CCC forum</a> or the <a href= "http://www.open-aurec.com/wbforum">WinBoard forum</a>. Anothe possibility is the newsgroup hierarchy rec.games.chess.*, especially the groups rec.games.chess.misc and rec.games.chess.computer. Both of the latter groups have very informative FAQs maintained by Steve Pribut; look for them on the newsgroups or at <a href="http://www.clark.net/pub/pribut/chess.html">defunct URL</a>.</p> <p>Like other GNU software, you can get XBoard, and WinBoard by anonymous FTP from <a href="ftp://ftp.gnu.org/pub/gnu/">ftp://ftp.gnu.org/pub/gnu/</a> and its many mirror sites. Look in the subdirectories xboard, and winboard. The .tar.gz suffix on the files there indicates they were packed with tar and compressed with gzip. The .exe or .zip suffixes indicate files that were packed and compressed with zip.</p> <p>For other chess software, try the Internet Chess Library. Use anonymous FTP to connect to ftp.freechess.org, or go to the Web page <a href="http://www.freechess.org/">http://www.freechess.org/</a>. You can get chess software, game collections, the FAQ file for rec.games.chess, and other chess-related material there, in the directory pub/chess. The FTP server can automatically decompress files for you as you download them, useful if you don't have gzip.</p> <p>Here is a sample anonymous ftp session. Some of the ftp server's responses are abbreviated, but all the commands you must type are included.</p> <pre> % ftp ftp.gnu.org Connected to ftp.gnu.org Name: anonymous Password: your-email-address@your-site ftp&gt; binary 200 Type set to I. ftp&gt; cd /pub/gnu/xboard ftp&gt; dir -rw-r--r-- 1 14910 wheel 1057625 May 20 00:25 xboard-4.2.7.tar.gz ftp&gt; get xboard-4.2.7.tar.gz 150 BINARY connection for xboard-4.2.7.tar.gz (1057625 bytes). 226 Transfer complete. ftp&gt; quit </pre> <hr /> <h3><a name="tag-A.3">[A.3] What are the current version numbers for XBoard and WinBoard?</a></h3> <p>At this writing, the current version numbers are:</p> <ul> <li>XBoard 4.4.0</li> <li>WinBoard 4.4.0</li> </ul> <hr /> <h3><a name="tag-A.4">[A.4] Who is working on this project?</a></h3> Please see our Savannah project pages at <a href="https://savannah.gnu.org/projects/xboard/">https://savannah.gnu.org/projects/xboard/</a> for a list of active developers. Many others occasionally contribute suggestions and snippets of code, for which we are grateful. <hr /> <h3><a name="tag-A.5">[A.5] How do I report bugs, offer help, etc.?</a></h3> <p>Bug reports, suggestions, and offers to help on XBoard or WinBoard should be sent to bug-xboard<a name="nospam01">&#x40;</a>gnu.org.</p> <p>Beginner questions and discussion about the program may get faster answers on the WinBoard Forum at <a href="http://www.open-aurec.com/wbforum/" >http://www.open-aurec.com/wbforum/</a>. This forum also constains a section dedicated to propose and discuss new features for WinBoard / XBoard or WinBoard protocol, and reposrt bugs, and offers downloads of pre-installed packages of WinBoard bundled with other software, useful for conducting computer-computer tournaments.</p> <p>If you are developing a chess engine that works with XBoard or WinBoard (or an alternative GUI that works with such engines), see the Chess Engines mailing list, hosted at <a href="http://groups.yahoo.com/group/chess-engines" >http://groups.yahoo.com/group/chess-engines</a>. For better response, join the above-mentioned WinBoard forum, or the <a href="http://www.talkchess.com/forum">CCC forum</a>.</p> <p>Any time you want to report a possible bug in XBoard or WinBoard, we need to know exactly what you did, and exactly what error (or other) messages you got.</p> <p>If you are using Unix, run the "script" program, run XBoard with the -debug flag (if you get as far as running it), do whatever is necessary to reproduce the problem, type "exit" to the shell, and mail us the resulting typescript file. We also need to know what hardware/operating system combination you are using. The command "uname -a" will usually tell you this; include its output in your typescript.</p> <p>If you are using MS Windows, run WinBoard with the -debug flag, and send us a copy of the WinBoard.debug file. If you aren't sure how to add command-line flags to WinBoard, you can hit Ctrl+Alt+F12 to create a WinBoard.debug file after WinBoard starts, but that is not as good, because a few messages that would have been printed at the start are lost.</p> <p>Either way, please send us the exact text of the commands you typed and the output you got, not just your recollection of approximately what they were. The messages may seem meaningless to you, but they are very meaningful to us and essential for diagnosing problems.</p> <hr /> <h3><a name="tag-A.6">[A.6] What are the future plans for XBoard and WinBoard?</a></h3> <p>Our plans are always in flux. As with most free software projects, the next release will happen when it happens -- or it may never happen. This has always been the policy for XBoard/WinBoard. Releases have never been promised in specific time frames.</p> <p>Starting in November 2003, several new developers have joined the project, and work is now hosted at <a href="https://savannah.gnu.org/projects/xboard/" >https://savannah.gnu.org/projects/xboard/</a>. Lots of work is just getting underway, but nothing is far along yet.</p> <p>Here is a partial list of items that have a nonzero probability of happening in finite time.</p> <ul> <li>Small bug fixes. Occasionally someone sends us a fix, or reports a small bug very clearly so that we're able to fix it in a few minutes work.</li> <li>Protocol version 3. The members of the chess engine authors' mailing list discussed a set of proposed features for the next version of the XBoard/WinBoard chess engine communication protocol. The WinBoard 4.3 fork has taken the protocol in a different direction, though, extending version 2 with new features as they were needed, rather than upgrading to a new protocol in a single sweep. It does not seem likely that there will be a v3 protocol in the foreseeable future. </li> <li>Contributed features. Several people have mailed me code to add various features. Most of this code is available on the XBoard/WinBoard extensions page at <a href="http://www.tim-mann.org/extensions.html"> http://www.tim-mann.org/extensions.html</a>, but it is not in any official releases yet. We are in the process of getting folks to formally assign the copyrights on their contributions to the Free Software Foundation so that we can include it in official releases in the future.</li> <li>Internationalization. Several people have expressed interest in internationalizing XBoard/WinBoard. Version 4.4 implements internationalization in its XBoard branch, and includes (partial) Turkish and German translations. For WinBoard a suitable way for internationalization still has to be found, as all menu strings there are not in the C code, but in a Windows resource file. In any case, we will need more translators, to update the existing translations (for version 4.2.7) to the current version, and to provide translaions for oter languages. Watch for news on the xboard-devel mailing list on our Savannah pages.</li> </ul> <hr /> <H2><a name="tag-B">[B] XBoard and WinBoard</a></H2> <hr /> <h3><a name="tag-B.1">[B.1] What is XBoard?</a></h3> <p>XBoard is a graphical user interface for chess. It displays a chessboard on the screen, accepts moves made with the mouse, and loads and saves games in Portable Game Notation (PGN). XBoard is free software. It serves as a front-end for many different chess services, including:</p> <p><strong>Chess engines</strong> that will run on your machine and play a game against you or help you analyze, such as GNU Chess and Crafty (topic <a href="#tag-D.3">[D.3]</a> below).</p> <p><strong>Chess servers</strong> on the Internet, where you can connect to play chess with people from all over the world, watch other users play, or just hang out and chat.</p> <p><strong>Correspondence chess</strong> played by electronic mail. The cmail program (topic <a href="#tag-B.6">[B.6]</a> below) automates the tasks of parsing email from your opponent, playing his moves out on your board, and mailing your reply move after you've chosen it.</p> <p><strong>The Web</strong> and your own saved games. You can use XBoard as a helper application to view PGN games in your Web browser, or to load and save your own PGN files.</p> <p>XBoard runs under Unix or Unix-compatible systems. It requires the X Window System, version X11R4 or later. There are also ports of XBoard to 32-bit Microsoft Windows and to the Amiga. See topics <a href="#tag-B.2">[B.2]</a> and <a HREF="#tag-B.3">[B.3]</a> respectively.</p> <hr /> <h3><a name="tag-B.2">[B.2] Is there an XBoard for Microsoft Windows? What is WinBoard? How do I install WinBoard?</a></h3> <p>WinBoard is a port of XBoard to 32-bit Microsoft Windows systems, such as Windows 95, 98, NT, 2000, ME, and XP. It uses the same back end chess code as XBoard, but the front end graphics code is a complete rewrite. WinBoard is free software.</p> <p>The WinBoard distribution includes a sample Chess engine.</p> <p>The WinBoard distribution also includes the ICC timestamp and FICS timeseal programs (topic <a href="#tag-B.12">[B.12]</a>).</p> <p>cmail (topic <a href="#tag-B.6">[B.6]</a>) has not been ported to Windows. All the other XBoard functions are included in WinBoard. The International Email Chess Group web site at <a href="http://www.iecg.org/" >http://www.iecg.org/</a> recommends ECTool (<a href="http://www.ectool.nu/" >http://www.ectool.nu/</a>) for playing correspondence chess under Windows.</p> <p>You install WinBoard as follows. Download the WinBoard package to your PC (see topic <a href="#tag-A.2">[A.2]</a>). It will be a file with a name like winboard-4_0_0.exe. Double-click on this file in the Explorer or File Manager to run it. Follow the on-screen prompts.</p> <hr /> <h3><a name="tag-B.3">[B.3] Is there an XBoard for the Amiga? What is AmyBoard?</a></h3> <p>AmyBoard is a port of XBoard to the Amiga, by Jochen Wiedmann. The distribution includes a port of GNU Chess. AmyBoard is free software.</p> <p>The current version of AmyBoard is 330.5 (based on XBoard 3.3.0). No one is currently maintaining it.</p> <p>System requirements:</p> <ul> <li>An Amiga (obviously :-), running OS 2.04 or later, 2Mb RAM or more.</li> <li>MUI 2.0 or later.</li> <li>Workbench or another screen with no less than 640x400 pixels (adjustable with the MUI-Prefs); this restriction is just because we don't have bitmaps with less than 40x40 pixels per square. If someone contributes bitmaps with 20x20 or 20x25, they will work with any Hires mode.</li> </ul> <p>If you would like to use an ICS, you need an Internet connection via either</p> <ul> <li>a telnet-like program, or</li> <li>a terminal program reading from stdin and writing to stdout.</li> </ul> <p>AmyBoard is available in the Internet Chess Library (topic <a href="#tag-A.2">[A.2]</a>).</p> <hr /> <h3><a name="tag-B.4">[B.4] Is there an XBoard for the Macintosh?</a></h3> <p>Note: I am not a Mac user and have not tried this myself, so I cannot answer questions about it. </p> <p>Because MacOS X has a Unix base, XBoard will compile and run on it. You do need an X11 (X Window System) server and client libraries. I'm told that these come standard with MacOS X 10.3 and later. Once you install the X11 package, XBoard is reported to compile and run without changes.</p> <p>You can avoid having to compile XBoard (and GNU Chess) yourself by using the Fink sofware packaging system. See http://fink.sourceforge.net/ and http://finkcommander.sourceforge.net/ for more info on Fink.</p> <p>There is no version of XBoard or WinBoard that runs with the native (non-X11) Mac graphical interface, and none that runs on MacOS 9 or earlier.</p> <hr /> <h3><a name="tag-B.5">[B.5] Does XBoard run on VMS?</a></h3> <p>No. This port would probably be a lot easier than the Win32 and Amiga ports were, because VMS has the X Window system (under the name DECwindows) and is now POSIX compliant. If you are working on this, send mail to bug-xboard<a name="nospam02">&#x40;</a>gnu.org to let us know.</p> <hr /> <h3><a name="tag-B.6">[B.6] What is cmail?</a></h3> <p>cmail is a program that helps you play and keep track of electronic mail correspondence chess games using XBoard. It is distributed with XBoard and has its own manual page. cmail is free software. It was written by Even Welsh. cmail has not been ported to Windows; sorry.</p> <hr /> <h3><a name="tag-B.7">[B.7] How do I build XBoard? Do I need gcc?</a></h3> <p>The first step to building XBoard is to get the distribution file. See topic <a href="#tag-A.2">[A.2]</a> for places you can ftp the software from.</p> <p>Next, decide what directory tree you are going to install XBoard in. The default is /usr/local, but you probably don't have write access to that directory unless you are a system administrator. If you do, type the following to install it there:</p> <pre> gzip -cd xboard-*.tar.gz | tar -xvf - cd xboard-*/ ./configure make su make install </pre> <p>If you want to install xboard in your personal home directory ($HOME/bin), type this:</p> <pre> gzip -cd xboard-*.tar.gz | tar -xvf - cd xboard-*/ ./configure --prefix=$HOME make make install </pre> <p>If the first step above fails because you don't have gzip, see topic <a href="#tag-A.2">[A.2]</a>, and ask a local Unix expert if you need more help. If you have any problems with the last two steps, read the READ_ME and INSTALL files in the xboard-*/ directory. You will also find this FAQ there.</p> <p>You don't need to have gcc to build XBoard. Almost any Unix C compiler should do.</p> <hr /> <h3><a name="tag-B.8">[B.8] Can I use XBoard or WinBoard to play a game of chess with another human?</a></h3> <p>The only way for two humans on different machines to play chess in real time using XBoard/WinBoard is to use an Internet Chess Server as an intermediary. That is, each player runs his own copy of XBoard or WinBoard, both of them log into an ICS, and they play a game there. Two copies of XBoard/WinBoard cannot communicate with each other directly.</p> <p>Instructions on how to get started with Internet chess are included with the XBoard and WinBoard distributions. The network addresses included in the distribution may not always be current. The oldest and largest ICS is the Internet Chess Club at chessclub.com, which now has a fee for registered use, but still allows free unregistered use. There are also many newer sites with no fees, using the Free Internet Chess Server implementation (FICS). The most active FICS site is freechess.org. On these and most other chess servers, the port number to use is 5000.</p> <p>If you don't have network connectivity to any ICS site, you can run your own server using a version of the FICS code, but this is not easy. See <a href="http://www.tim-mann.org/ics.html#ownics" >http://www.tim-mann.org/ics.html#ownics</a> for advice and pointers.</p> <p>The cmail program included with XBoard lets you play email postal games with another human; see topic <a href="#tag-B.6">[B.6]</a>.</p> <p>Two humans can play chess on the same machine using one copy of XBoard/WinBoard in Edit Game mode, but the clocks don't run in this mode, so it's of limited usefulness.</p> <p>See also topic <a href="#tag-D.2">[D.2]</a>, Winsock Chess.</p> <hr /> <h3><a name="tag-B.9">[B.9] Will WinBoard run on Windows 3.1? How about Windows CE (also known as Pocket PC)? </a></h3> <p>WinBoard does not run on Windows 3.1, Windows for Workgroups 3.11, etc., not even with the Win32s compatibility package. The main problem is that Win32s does not have threads or real concurrent processes. A port of WinBoard to Windows 3.1 is possible in theory, but it would be difficult and messy, and no one is going to do it.</p> <p>WinBoard does not run on Windows CE (also known as Pocket PC). I don't know what would be required to port it.</p> <p>WinBoard does run well on full 32-bit versions of Windows, such as Windows 95, 98, NT, 2000, ME, XP, and Vista, and should continue to work on future 32-bit Windows systems. To use the help files in Vista, you will need to install the WinHlp32.exe from MicroSoft on your Vista system. </p> <hr /> <h3><a name="tag-B.10">[B.10] How do I use XBoard or WinBoard as an external viewer for PGN files with my Web browser?</a></h3> <ol> <li> On Unix systems: <ul> <li> Add the following line to the file .mime.types in your home directory. (Create the file if it doesn't exist already.) <pre> application/x-chess-pgn pgn </pre> </li> <li> Add the following line to the file .mailcap in your home directory. (Create the file if it doesn't exist already.) <pre> application/x-chess-pgn; xboard -ncp -lgf %s </pre> </li> <li> Exit from your Web browser and restart it. </li> </ul> </li> <li> On MS Windows systems: <p>The exact procedure depends on which Web browser you are using. The current version of WinBoard automatically configures itself as your PGN viewer for local files, Netscape 4.x and later, and Internet Explorer. This automatic setup probably works for all other current Web browsers, too.</p> </li> </ol> <hr /> <h3><a name="tag-B.11">[B.11] How do I use WinBoard as an external viewer for PGN files with the MS Windows File Manager or Explorer?</a></h3> <p>WinBoard sets this up automatically when you install it, except on old versions of Windows NT (prior to 4.0). On Windows NT 3.51 or earlier, go to the File Manager, click on the File menu, select Associate, enter "pgn" as the extension, and use the Browse button to find your copy of WinBoard and set up the association.</p> <hr /> <h3><a name="tag-B.12">[B.12] How do I use ICC timestamp or FICS timeseal with XBoard?</a></h3> <p>First, get the appropriate version of timestamp or timeseal for your machine from ftp.chessclub.com or ftp.freechess.org. Second, be sure that you can connect using XBoard <I>without</I> timestamp/timeseal. Third, be sure that you can connect using timestamp/timeseal without XBoard. See the help files on ICC and FICS or ask people online if you have problems.</p> <p>If you are in a completely ordinary situation, where your machine is directly on the Internet and you can connect to ICC or FICS without timestamp/timeseal using just the command "xboard -ics" or "xboard -ics -icshost freechess.org", change that command to one of the following:</p> <pre> xboard -ics -icshost chessclub.com -icshelper timestamp xboard -ics -icshost freechess.org -icshelper timeseal </pre> <p>If you have a firewall between your machine and the ICS, see topic <a href="#tag-B.19">[B.19]</a>.</p> <p>If you normally have to use the "/icscomm" command line option on xboard to log into a second machine, and then telnet to ICC or FICS from there, you are going to have to run the Unix version of timestamp or timeseal on the second machine. (If the second machine is not running Unix, you are out of luck.) Get the appropriate version of timestamp or timeseal onto the shell machine via FTP; see the help files on ICC and FICS for instructions. Then simply run it when you would normally run telnet. In this configuration you are not protected against lag between your PC and the shell machine, or for lag caused by heavy load on the shell machine itself from other users.</p> <p>For further information on timestamp and timeseal, see the help files on ICC and FICS.</p> <hr /> <h3><a name="tag-B.13">[B.13] How do I use ICC timestamp or FICS timeseal with WinBoard?</a></h3> <p>If you select an ICS from either the WinBoard Startup dialog or the Windows Start submenu that WinBoard installs, WinBoard automatically runs timestamp or timeseal if the ICS you chose is known to support it.</p> <p>If you are constructing a WinBoard command line by hand, add the option "/icshelper timestamp" or "/icshelper timeseal" to the WinBoard command line to use timestamp or timeseal. Both timestamp.exe and timeseal.exe are included in the WinBoard distribution. They both function identically to the Unix versions, as documented in "help timestamp" on ICC and "help timeseal" on FICS.</p> <p>If you have a firewall between your machine and the ICS, see topic <a href="#tag-B.19">[B.19]</a>.</p> <p>If you normally have to use the "/icscomm" command line option on WinBoard to log into a shell account, and then telnet to ICC or FICS from there, you are going to have to run the Unix version of timestamp or timeseal on the shell machine. (If the shell account is not on a Unix machine, you are out of luck.) Get the appropriate version of timestamp or timeseal onto the shell machine via FTP; see the help files on ICC and FICS for instructions. Then simply run it when you would normally run telnet. In this configuration you are not protected against lag between your PC and the shell machine, or for lag caused by heavy load on the shell machine itself from other users.</p> <p>For further information on timestamp and timeseal, see the help files on ICC and FICS.</p> <hr /> <h3><a name="tag-B.14">[B.14] How do I play bughouse with XBoard or WinBoard? </a></h3> <p>XBoard and WinBoard have full bughouse support. Offboard piece holdings are shown next to the board, and you drop offboard pieces by dragging them with the mouse (holding the left button down) to their drop square, or left-click the piece and the drop square, just like when you enter any ordinary move.</p> <p>XBoard and WinBoard can display only one board at a time, but you can observe your partner's game by running a second copy of the program and logging in as a guest. (Unfortunately, this is not possible if you are using the /icscomm option.) To observe your partner's games automatically, use the "follow" or "pfollow" ICS command; see the ICS online help for details.</p> <hr /> <h3><a name="tag-B.16">[B.16] What is Zippy? How can I interface a chess program to the Internet Chess Servers?</a></h3> <p>Zippy is an interface that lets a compatible chess engine (such as GNU Chess or Crafty) act as a computer player on an Internet Chess Server. Zippy is included in both the XBoard and WinBoard distributions. It is implemented as a small amount of additional code within XBoard or WinBoard. For documentation, see the file zippy.README, included in both distributions or available from my chess Web page, <a href= "http://www.tim-mann.org/chess.html" >http://www.tim-mann/chess.html</a>. The version of zippy.README on my Web page is often more up-to-date than those in the XBoard/WinBoard distributions. You'll also find a "biography" of Zippy and pointers to the original Zippy the Pinhead comic strips on my Web page. Please read zippy.README carefully before you ask me any questions about Zippy.</p> <p>Using a computer to choose your moves on a chess server is considered cheating unless your account is on the computer (C) list. Read "help computer" on your favorite server for details on their policy. Most of the servers have plenty of computers running now, so they will not be excited about having you run a new one unless you have written your own chess engine. They don't really need yet another Crafty or GNU Chess clone.</p> <hr /> <h3><a name="tag-B.17">[B.17] How can I interface my own chess program to XBoard or WinBoard?</a></h3> <p>This is a non-trivial task. XBoard and WinBoard were not designed with a clean interface for talking to chess programs; they were written to work with an existing version of GNU Chess that expects to be talking to a person. Your program has to emulate GNU Chess's rather idiosyncratic command structure to work with XBoard and WinBoard. We are gradually cleaning up, improving, and documenting the interface as newer versions of XBoard and WinBoard come out, however.</p> <p>For documentation, see the file engine-intf.html, included in both distributions or available from Tim Mann's chess Web page, <a href= "http://www.tim-mann.org/chess.html" >http://www.tim-mann.org/chess.html</a>. The version of engine-intf.html on Tim's Web page might totally obsolete, though. To know how the current WinBoard or XBoard version communicate with their engines, use the documentation in the XBoard/WinBoard distributions, or on the <a href= "http://www.open-aurec.com/wbforum/WinBoard/engine-intf.html" >WinBoard forum</a>.</p> <hr /> <h3><a name="tag-B.18">[B.18] How can I recompile WinBoard from source?</a></h3> <p>The source code for WinBoard is available from the author's Web page, <a href= "http://www.tim-mann.org/chess.html" >http://www.tim-mann.org/chess.html</a>.</p> <p>WinBoard is currently developed using gcc under Cygwin. To build WinBoard with the free Cygwin tools, available from <a href= "http://www.cygwin.com/" >http://www.cygwin.com/</a>), use the command "make -f makefile.gcc" from the winboard directory of the source distribution.</p> <p>You can build the program from the MSVC++ GUI by opening the project file (winboard.dsp) and telling MSVC++ to build the project. You can also build it from the the command line by using the nmake program supplied with MSVC++. The makefile for MSVC is makefile.ms in the winboard directory.</p> <p>WinBoard 4.2.5 was successfully compiled with the net release of Cygwin as downloaded on 20-March-2001 (cygwin1.dll 1.1.8, gcc 2.95.2-6, binutils 20001221-1, flex 2.5.4-1), but exhibits a command-line parsing bug; see item 511 in the ToDo file that comes with WinBoard. WinBoard 4.1.0 does not compile with Cygwin. WinBoard 4.0.7 is known to compile with Cygwin BL20.1.</p> <p>To build WinBoard with Borland C++ 4.5, use "borland.mak", supplied with the WinBoard sources, as the Makefile. Support for Borland C++ was contributed by Don Fong and has not been tested by the author of WinBoard.</p> <p>WinBoard is a Win32 application, so you definitely need a compiler and tool set that supports Win32. In particular, older versions of DJGPP can build only 32-bit MSDOS programs; that is, programs that use a DOS extender to get a 32-bit address space and do not make any Windows calls. The latest versions of DJGPP are said to be able to build Win32 programs when used with the proper extension package(s), but this is not known to work with WinBoard. Use Cygwin instead.</p> <p>See also topic <a href="#tag-C.16">[C.16]</a>.</p> <hr /> <h3><a name="tag-B.19">[B.19] How can I use XBoard or WinBoard to talk to an Internet Chess Server through a firewall or proxy? </a></h3> <p>There is no single answer to this question, because there are many different kinds of firewalls in use. They work in various different ways and have various different security policies. This answer can only provide hints.</p> <p>Note that you can't access Internet Chess Servers through a Web proxy, because they are not a Web service. You talk to them through a raw TCP connection, not an HTTP connection. If you can only access the Web through a proxy, there may be a firewall that stops you from making direct TCP connections, but there may also be a way through it. Read on for hints, and contact your local system administrator if you need more information about your local configuration.</p> <p>A helpful user mailed me the following explanation of how to use WinBoard with WinGate:</p> <blockquote> "I have managed to setup WinBoard though my WinGate proxy. I have the Office version. What I needed to do was to setup the TCP/IP connection to add the User/Host name and my provider service name for the DNS, but I had to leave the HOST IP address blank. I have not played with all the variations, so it may be just that I have the DNS lookup enabled." </blockquote> <p>I hope this helps, though I don't find it very clear. I don't have a copy of WinGate myself and can't help if you have questions about it.</p> <p>If you are using some other non-SOCKS firewall, read the FIREWALLS section in your XBoard or WinBoard documentation (man page, info document, or Help file). If you can telnet to a chess server in some way, then you can almost certainly connect to it with xboard/WinBoard, though in some cases you may not be able to run timestamp or timeseal. The timestamp and timeseal protocols require a clean, 8-bit wide TCP connection from your machine to the ICS, which some firewalls do not provide.</p> <p>If you have a SOCKS firewall and are using <strong>XBoard</strong>, you should be able to SOCKSify xboard and use it. See <a href="http://www.socks.nec.com/">http://www.socks.nec.com/</a> for information about SOCKS and socksification. However, if you do this, you can't use timestamp or timeseal; what you really need is a socksified version of timestamp or timeseal. This is hard because the source code for timestamp and timeseal is proprietary; the folks running the chess servers don't give it out because that would make it too easy to cheat. On some versions of Unix, you may be able to socksify a program that you don't have the source code to by running it with an appropriate dynamic library; see <a href="http://www.socks.nec.com/">http://www.socks.nec.com/</a>. For others, you might be able to get a pre-built socksified version from the chess server administrators. For timeseal versions, see <a href="ftp://ftp.freechess.org/pub/chess/timeseal/" >ftp://ftp.freechess.org/pub/chess/timeseal/</a>. For timestamp versions, the directory would be <a href="ftp://ftp.chessclub.com/pub/icc/timestamp/" >ftp://ftp.chessclub.com/pub/icc/timestamp/</a>, but at this writing there don't seem to be any socksified timestamps there. Once you have a socksified timestamp or timeseal, simply run it with a normal, non-socksified xboard in place of the standard timestamp or timeseal.</p> <p>If you have a SOCKS firewall and you are using <strong>WinBoard</strong>, we now know how to make this configuration work, complete with timestamp or timeseal!</p> <p>Start by getting SocksCap32. This software is freely available from <a href="http://www.socks.nec.com/">http://www.socks.nec.com/</a>. Install it on your machine, read the documentation, and learn to use it. You may find it useful with many other programs besides WinBoard.</p> <p>Next, <strong>don't</strong> socksify WinBoard. Socksifying WinBoard itself doesn't let you use it with timestamp or timeseal. For some reason I don't understand -- something strange that SocksCap32 does -- the socksified WinBoard runs but does nothing, and timestamp/timeseal runs all by itself in its own window.</p> <p>Instead, use the following workaround. Follow the instructions exactly; don't try to skip steps or simplify things.</p> <p>First, make SocksCap32 application profiles for timestamp and timeseal. Use the following command lines in the SocksCap32 profiles. Name the first profile "timestamp" and the second "timeseal".</p> <pre> "c:\program files\winboard\timestamp.exe" chessclub.com 5000 -p 5000 "c:\program files\winboard\timeseal.exe" freechess.org 5000 -p 5000 </pre> <p>Second, run timestamp or timeseal by itself, socksified, using its profile. This will open an unneeded, black window that will not respond to typing. Minimize it to the task bar and ignore it. It will go away when you exit from WinBoard.</p> <p>Next, run WinBoard using the following command line. Make a shortcut or type this command into an MS-DOS Prompt box. Don't run WinBoard itself socksified, just run it directly.</p> <pre> "c:\program files\winboard.exe" /ics /icshost=localhost /icsport=5000 </pre> <p>After you get this working, you can try getting the timestamp window to auto-minimize by starting it from a shortcut instead of from the SocksCap32 control window. As it says in the SocksCap32 help file, put the following in the Target field of a shortcut's Properties page:</p> <pre> "c:\program files\sockscap32\sc32.exe" timestamp </pre> <p>Then select "Run: Minimized" on the same page. Do the same for timeseal.</p> <p>Another method that can work is to use a .bat file to start both timestamp and WinBoard. It would look something like this:</p> <pre> REM -- REM -- icc.bat REM -- Start timestamp under SocksCap32 and use WinBoard to connect to it. REM -- The string "timestamp" refers to a SocksCap32 profile for timestamp. REM -- Do not change it to the filename of the timestamp program! REM -- start /minimized "c:\program files\sockscap32\sc32.exe" timestamp cd "c:\program files\winboard" winboard /ics /icshost=localhost /icsport=5000 </pre> <p>This workaround has a problem if you want to run two copies of WinBoard at once, talking to the same chess server twice (for bughouse) or to two different chess servers. If you need to do that, you will need to run a separate copy of timestamp with <i>a different port number</i> for each connection. You'll need to make a second set of profile entries with a different value after the -p flag (say, 5001) and you'll need to change the WinBoard command line /icsport=5000 for the second WinBoard to match.</p> <hr /> <h3><a name="tag-B.20">[B.20] How can I use XBoard or WinBoard on chess.net with accuclock? </a></h3> <p>I believe chess.net provides a Win32 command-line version of accuclock that will work with WinBoard. Please see the documentation on the chess.net server itself; don't ask the author of WinBoard.</p> <p>I don't know whether chess.net provides versions of accuclock for Unix at this time. Ask them.</p> <hr /> <h3><a name="tag-B.21">[B.21] Can I get Zippy to do one or more ICS commands automatically at the start or end of each game?</a></h3> <p>By default, Zippy automatically sends the command "gameend" to ICS at the end of each game. You can alias this command (using the ICS "alias" feature) to anything you want. On ICC, you can use the "multi" feature to alias gameend to several commands, but other servers don't have that feature. Zippy doesn't send anything at the start of the game by default.</p> <p>You can get Zippy to send one or more commands of your choosing, at the start and/or end of each game, by using the -zippyGameStart and -zippyGameEnd command line options, newly added in version 4.0.3. Both xboard and WinBoard have (somewhat obscure) ways of getting newlines into this option to send several commands. Here is an example of one way to do it for each.</p> <pre> xboard -ics -zp -xrm '*zippyGameStart: say hi\nsay prepare to die\n' WinBoard /ics /zp /zippyGameEnd='say thanks\nseek 5 0\nseek 2 12\n' </pre> <hr /> <h3><a name="tag-B.22">[B.22] How do I print from WinBoard? </a></h3> <p>WinBoard does not have built-in printing functionality. If you want to print a picture of the board, press Alt+PrintScrn, run the standard Windows application Paintbrush, select Paste, and print from there. If you want to print a list of moves, save your game as a PGN file, then open the PGN file with Notepad or any other plain text editor and print it from there.</p> <p>WinBoard 4.4 has a menu item "Save Diagram..." in the file menu, which saves the board part of the display as a Windows .bmp file, but only if the board size is not too big.</p> <hr /> <h3><a name="tag-B.23">[B.23] Can I get Zippy to automatically reconnect to ICS when its connection breaks?</a></h3> <p>There isn't a perfect solution to this problem yet, but a pretty good one is to write a shell script (for xboard) or .bat script (for WinBoard) that automatically restarts the program whenever it exits. Use the -xexit flag so that you don't get a popup dialog that must be dismissed with the OK button before the program will exit. The gap in this solution is that your connection to ICS can sometimes get into a state where the program does not notice that the connection is broken until the next time it tries to send a command. Perhaps some future version of xboard/WinBoard will have an option to send a harmless command every five minutes or so.</p> <p>Anyway, here is a sample Windows .bat file that restarts WinBoard each time it exits. Thanks to Jason Williamson. It assumes that you have put your computer account's name and password in a file named logon.ini.</p> <pre> REM -- REM -- wbrecon.bat REM -- Start WinBoard in Zippy mode, and restart it each time it exits. REM -- Add or change parameters as needed for your application. REM -- :loop start /w winboard /zp /ics /icslogon logon.ini /xexit /xautoraise REM -- The next line is to have a short delay setup for 139 seconds. REM -- Leave it out if it doesn't work on the version of Windows you use. TYPE NUL | CHOICE.COM /N /CY /TY,99 &gt;NUL goto loop </pre> <p>Here is a Unix shell script to do the same thing for xboard. It's a bit more elaborate. It is based on the script I use for the original Zippy. It logs all ICS output to a file named zippy.out, and it lets you type commands to Zippy by running "cat &gt; zippy.fifo".</p> <pre> #! /bin/sh host="204.178.125.65 -icsport 5000 -telnet -telnetProgram timestamp" #host="164.58.253.13 -icsport 5000 -telnet -telnetProgram timeseal" out=zippy.out fifo=zippy.fifo ZIPPYPASSWORD='something' export ZIPPYPASSWORD ZIPPYPASSWORD2='orother' export ZIPPYPASSWORD2 ZIPPYLINES=`pwd`/all.lines export ZIPPYLINES ZIPPYGAMEEND='say Yow, that was FUN! gameend' export ZIPPYGAMEEND zippylogon=`pwd`/logon.ini DISPLAY=`hostname`:0.0 export DISPLAY mv -f $out ${out}.old rm -f $fifo mkfifo $fifo pid=$$ ( while [ true ] ; do cat -u $fifo ; done ) | \ ( while [ true ] ; do xboard -iconic -ics -icshost $host \ -zt -zp -xbell -xanimate \ -xautosave -xquiet -fcp "gnuchessx -h" \ -icslogon $zippylogon -xexit -autoflag -xautoraise $* sleep 600 done ) &gt; $out 2&gt;&amp;1 &amp; </pre> <hr /> <h3><a name="tag-B.24">[B.24] The chess engines are too strong and always beat me. How can I adjust the difficulty level to make them weaker?</a></h3> <p>The best way is to get a weaker chess engine. On the <a href="http://www.open-aurec.com/chesswar">ChessWar</a> website you will find a rating list of virtually all engines that are able to play under XBoard/WinBoard, from super-humanly strong to ridculously weak. Most of them can be downloaded for free from the internet.</p> <p>A way to get that effect is to limit the time the engine can use for deciding on its move. The time-odds options or menu items in the time-control dialog) can be used to this end. This is only of limited help, as engines do not weeken that much at faster time-control, and there is a practical limit to how fast you can order the engine to go. Also feel free to use Retract Move if you make a blunder. </p> <p>Many chess coaches will let you switch sides after they get a stronger position so that you can get experience playing positions where you are winning. You can try this with XBoard/WinBoard by using the Machine White or Machine Black menu command to make the machine take over your position.</p> <p>The -depth command-line option to XBoard/WinBoard can also be used to weaken the engine (see the man page or Help file). It's a bit of a nuisance to set command line options in Windows, but see topic <a href="#tag-C.7">[C.7]</a> for instructions.</p> <p>Other ways of weakening engines are engine-specific. Many of them let you adjust various parameters, and if you choose bad settings, the engine will play more poorly. Consult whatever documentation came with the engine you are using.</p> <hr /> <h3><a name="tag-B.25">[B.25] May I use the piece bitmaps from XBoard/WinBoard in my own program?</a></h3> <p>The piece bitmaps used in XBoard and WinBoard were designed by Elmar Bartel. He released them under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>. This means that if your program is also free software distributed under the GPL, you can use them freely. If your program is distributed under some other license, including commercial, shareware, or non-GPL freeware, then you cannot use the bitmaps unless you obtain special permission from Elmar. See the file README.bitmaps that comes with the XBoard and WinBoard source code for more information and an email address you can write to.</p> <hr /> <h3><a name="tag-B.26">[B.26] How can I get rid of these silly logos that this new WinBoard displays above the board?</a></h3> <p>WinBoard 4.4.0 has an option /autoLogo, which makes is search for bitmap files to display as logo, in the engine directory or in the folder "logos". If you see logos without having asked for them, the settings in your winboard.ini file probably contains the line</p> <pre>/autoLogo=true</pre> <p>Just change that to /autoLogo=false. You can also achieve that by starting WinBoard through the startup dialog (from the start menu), and then tick "additional options" at the bottom, and type /autoLogo=false in the edit field, before pressing OK. If you then later select "Save Settings Now" from the Option menu, or when "Save Settings on Exit" is on, and you close WinBoard, this will automatically end up in your settings field. </p><p> When /autoLogo=false, logos will only be displayed if you explicitly ask for them, by running WinBoard with the option /firstLogo=FILENAME.bmp or /secondLogo=FILENAME.bmp. (Which will not be stored in the winboard.ini, but might of course be hidden somewhere in a settings file mentioned on the command line as @SETTINGSFILE.ini.) </p> <hr /> <h3><a name="tag-B.27">[B.27] How can I install logos for other engines, Internet Chess Servers or Human users?</a></h3> <p>With the option /autoLogo=true, (which is remembered in your settings file), WinBoard automatically looks into the engine folder (specified by the /fd="..." or /sd="..." option), for a file called "logo.bmp". If it is found, it is used as a logo for the engine when it plays. So all you have to do is put a logo.bmp file there. Popular logo formats are 100x50 and 130x65; many engine logos are available from <a href="http://www.geocities.com/davedahlem/my_logos.html">David Dahlem</a> or <a href="http://kirill-kryukov.com/chess/discussion-board/viewtopic.php?t=545&f=7">Graham Banks</a> </p><p> It is possible to overrule the /autoLogo by explicitly using a /firstLogo="FILENAME.bmp" or /secondLogo="FILENAME.bmp" with the engine on the engine line in the startup dialog. This is useful for engines that run with an adapter like Polyglot, when you have only one polyglot on your system, used by many engines. E.g. for Fruit the engine line to be typed in or selected from the combo box is <pre> "polyglot fruit.ini" /firstLogo="D:\Engines\Fruit\logo.bmp" /fd="D:\Engines\Polyglot" </pre> This prevents WinBoard looking for the logo in the Polyglot folder. </p> For Internet Chess Servers and Human users the logos should be in the "logos" sub-folder of the folder where WinBoard is installed. With /autoLogo=true, WinBoard would look for a logo file in that folder with the same name as the ICS, suffixed with .bmp (e.g. freechess.org.bmp) or the Human username (specified by the /userName="..." option or taken from the system), suffixed by .bmp, e.g. administrator.bmp) </p> <hr /> <h3><a name="tag-B.28">[B.28] Is there readline/history support for the input in XBoard/Winboard? </a></h3> <p>There is a special ICS input box that has history support which is the standard in Winboard and can be used in XBoard too.</p> <p>Another good tip from Michel van der Bergh is to use the rlwarp program together with XBoard which gives you full readline support. Just run "rlwrap xboard" instead of just "xboard". The rlwarp program should be available for most linux distributions or can be downloaded at: <a href="http://utopia.knoware.nl/~hlub/uck/rlwrap/">http://utopia.knoware.nl/~hlub/uck/rlwrap/</a>. </p> <hr /><h2><a name="tag-C">[C] XBoard and WinBoard, bugs and problems</a></h2> <hr /><h3><a name="tag-C.1">[C.1] I can't build XBoard because the X11/Xaw/... include files are not found.</a></h3> <p>These are the header files for the Athena Widgets library, which XBoard uses heavily. Some versions of Unix don't supply these files, but they are part of the standard X distribution, freely available from MIT. </p> <p>For general information on getting missing X sources, see the FAQ on comp.windows.x. Note that you may be missing only the header files, or you may be missing the libraries themselves too.</p> <p>HP-UX users are missing only the header files. You can get them by anonymous FTP as follows. (But first check with your system administrator to see if someone else at your site has already done this.) Get the archive file /hpux9/X11R5/Core/Xaw-5.00.tar.gz (Xaw header files) via anonymous FTP from the site hpux.csc.liv.ac.uk (138.253.42.172), or one of the other official sites---Germany: hpux.ask.uni-karlsruhe.de (129.13.200.57), US: hpux.cae.wisc.edu (144.92.4.15), France: hpux.cict.fr (192.70.79.53) or Netherlands: hpux.ced.tudelft.nl (130.161.140.100). Unpack the archive using gzip and follow the instructions in its README and/or HPUX.Install files. Thanks to Richard Lloyd for this information.</p> <p>If you have the Xaw header files installed in a different place than the other X11 headers, you may need to configure XBoard with an extra flag to help it find them. For example, if yours are in /foo/bar/X11/Xaw, try this:</p> <pre> rm config.cache (setenv CFLAGS -I/foo/bar ; configure) </pre> <p>Also see topic <a href="#tag-C.2">[C.2]</a>.</p> <hr /> <h3><a name="tag-C.2">[C.2] Configuring or building XBoard fails due to missing header files, missing libraries, or undefined symbols. </a></h3> <p>Perhaps you have the X server and client programs installed on your machine, but not the X header files and link-time libraries. If so, you can run existing X programs, but you cannot compile a new X program from source code. In this case the XBoard configure script will fail and will tell you to look at this question in the FAQ. Many GNU/Linux distributions put the headers and libraries in a separate package, which you might not have installed. If you are using RedHat, install the XFree86-devel package. If you are using some other kind of Unix, ask your system administrator where to find the X header files and link-time libraries. If this is not your problem, read on.</p> <p>The configure script for XBoard looks for X libraries and header files in some common places. Sometimes it fails: If yours are installed in an odd place, it may not find them at all. If you have more than one version of X installed on your system, it may find the "wrong" one, or occasionally it may find libraries from one version and incompatible header files from another. You can work around these problems by telling the configure script where the files are. For example:</p> <pre> configure --x-includes=/odd/place/include \ --x-libraries=/odd/place/lib </pre> <p>The directory named in the argument to --x-includes must have a subdirectory "X11" that contains the actual .h files. That is, if your X.h file has full pathname /odd/place/X11R6/include/X11/X.h, then you must give the argument --x-includes=/odd/place/X11R6/include.</p> <p>Some linkers have bugs that cause bogus error messages when you try to link X programs. The configure script includes a workaround for a bug of this kind that exists in some SunOS 4.x.x installations. See the FAQ on comp.windows.x for more information about problems of this kind.</p> <p>If all else fails, check whether anyone else at your site has been able to compile any X programs on your system. Your X installation might be buggy. If so, the system administrator at your site might know how to fix or work around the problem.</p> <p>Also see topic <a href="#tag-C.1">[C.1]</a>.</p> <hr /><h3><a name="tag-C.3">[C.3] I have problems using WinBoard on ICS with a modem. I'm not running SLIP or PPP, but just dialing in to an ordinary login account ("shell account").</a></h3> <p>Here are solutions to some common problems in this area.</p> <p>Some people want to connect to ICS through HyperTerminal or some other terminal program first, then run WinBoard. This is not how it works. WinBoard wants to talk directly with your modem, acting as a terminal program itself. Start out with the modem "on hook" (not making a call).</p> <p>Run WinBoard with a command line like this (adding more options if desired):</p> <pre> WinBoard /ics /icscom com1 </pre> <p>Use com2, com3, or com4 in place of com1 if your modem is connected to one of those ports.</p> <p>After you start WinBoard, you may need to change some of the options in the Communications dialog (on the Options menu). The dialog has the usual options for talking to modems: bits per second, bits per byte, parity, number of stop bits. You will probably want to use Save Settings Now when you're done.</p> <p>Next, type dialing commands to your modem in the text window that WinBoard creates. You may need to turn off Local Line Editing on the Options menu while you are typing commands to your modem. Turn it back on when you're done. See the WinBoard Help file for instructions if you see your typing echoed an extra time after you hit Enter.</p> <hr /> <h3><a name="tag-C.4">[C.4] I have problems using WinBoard on ICS with Windows 95 and SLIP or PPP. When trying to start up, it gets the error "Address family not supported by protocol family" (or some equally strange message). </a></h3> <p>WinBoard is a 32-bit application, but some Winsock (TCP/IP) implementations support only 16-bit applications. You get a strange looking error message if you try to use a 32-bit application because there is no standard Winsock error code number for "32-bit application not supported."</p> <p>Microsoft TCP/IP works with both 16-bit and 32-bit applications, supports SLIP, PPP, Ethernet, etc., and is included with Windows 95 and later Windows systems. If possible, I recommend that you uninstall whatever Winsock you are using and install Microsoft TCP/IP instead. For more information, see <a href= "http://walden.mo.net/~rymabry/95winfaq.html" >http://walden.mo.net/~rymabry/95winfaq.html (the Win95-L FAQ)</a>.</p> <p>Trumpet Winsock 2.1 (and earlier) supports only 16-bit applications, and hence does not work with WinBoard. But there is a beta-test release available that does support 32-bit applications. I have not tried it with WinBoard, but it should work. See Trumpet's Web page <a href= "http://www.trumpet.com.au/wsk/winsock.htm" >http://www.trumpet.com.au/wsk/winsock.htm</a> for more information.</p> <p>The 16-bit versions of America On-Line's software do not support 32-bit Winsock applications. Get the 32-bit version. At one time the 32-bit version was called "AOL for Windows 95," but I imagine that has changed. Hopefully the current versions are all 32-bit.</p> <p>A few versions of Winsock may have bugs that prevent Windows timestamp/timeseal from working with them. I'm not sure if such bugs exist in any versions that actually have 32-bit support, so this point might be moot. Again, Microsoft TCP/IP is known to work.</p> <hr /> <h3><a name="tag-C.5">[C.5] When I try to run WinBoard, I get the message "Failed to start chess program gnuchess on localhost: NO LANGFILE (file gnuchess.lan not found)".</a></h3> <p>This message means that WinBoard is trying to run GNU Chess, but GNU Chess cannot find a file that it needs, named gnuchess.lan. If you see it, you've probably customized WinBoard's /fcp, /fd, /scp, and/or /sd options and made a mistake in the process. Review what you did, and see the WinBoard help file.</p> <hr /> <h3><a name="tag-C.6">[C.6] I want to use XBoard or WinBoard as an Internet Chess Server interface, but the ICS Client option is grayed out on the menu.</a></h3> <p>XBoard and WinBoard have three major modes that can't be changed from the menus: local chess engine mode, ICS mode, and standalone mode.</p> <p>With XBoard, you have to set the mode using command-line options. Local chess engine mode is the default, -ics selects ICS mode, and -ncp ("no chess program") selects standalone mode.</p> <p>With WinBoard, if you don't set the mode using command-line options, you get a dialog box asking which mode you want. To bypass the dialog box, use -cp ("chess program") for local chess engine mode, or -ics or -ncp as with XBoard. Also see topic <a href="#tag-C.7">[C.7]</a>.</p> <hr /> <h3><a name="tag-C.7">[C.7] How do I give command-line options to a Windows program like WinBoard?</a></h3> <p>There are many ways; pick your favorite:</p> <ul> <li>Type the command line into an MS-DOS Prompt box. Example: "WinBoard -ics".</li> <li>Make a Windows shortcut for WinBoard. You can do this by right-dragging WinBoard.exe to the desktop and selecting "Create Shortcut(s) Here" from the menu that appears. Right-click on the shortcut, select Properties, and click the Shortcut tab. The command-line text box is labelled "Target" instead of "Command line" just to confuse you. Edit the text in this box, adding the command line options to the end.</li> <li>Choose Run from the Start menu, or File / Run from the Program Manager or File Manager, and type the command line into the dialog you get. You may have to give WinBoard's full drivespec and filename if it is not in a directory on your search path.</li> <li>Make a Program Manager icon for WinBoard. You can do this by dragging WinBoard.exe from the File Manager into the Program Manager, or by using File / New in the Program Manager. Select the icon and choose File / Properties. Edit the Command Line text box to add the command-line options to the end.</li> </ul> <hr /> <h3><a name="tag-C.9">[C.9] When I exit from WinBoard after using it to play against a chess program on my machine, the chess program keeps running in the background. </a></h3> <p>Be sure you have the current versions of WinBoard and the chess engine you are using. WinBoard 3.4.1 and earlier had a bug that caused this problem to occur with all chess engines. A buggy chess engine that does not respond to the "quit" command will also cause this.</p> <p>If you still see this problem, you can stop the rogue chess engine by pressing Ctrl+Alt+Del, selecting the chess engine process from the menu, and pressing the End Task button.</p> <hr /> <h3><a name="tag-C.12">[C.12] Why do my ICS opponents often get extra time after they make their moves? Why do I sometimes lose time off my clock after I make my move? </a></h3> <p>If you are playing with the ICS incremental clock, both you and your opponent get a set amount of extra time after each move.</p> <p>If your or your opponent has netlag, your opponent might appear to get extra time, especially if your opponent is using timestamp or timeseal. The ICS charges each player who is using timestamp or timeseal only for the time between when the player received his opponent's move and the time he sent his own move. Thus delays in network transmission do not count against either player. But WinBoard counts down the display of your opponent's clock on your screen under the assumption that there is no netlag. When his move comes in, if there was netlag, the ICS may not have really charged him for that much time, and WinBoard corrects the clock to what the ICS says it should read.</p> <p>If you are not using timestamp or timeseal, you may appear to lose time off your clock at some point after you make your move. In this case, the ICS charges you for the time between when it sent you your opponent's move and the time it received your move. Thus delays in network transmission count against you. WinBoard stops counting down the display of your clock on your screen (and starts your opponent's) when you make your move. When the ICS echoes your move back to you, it may have charged you for more time than that, and WinBoard corrects the clocks to what the ICS says they should read.</p> <p>See "help lag" and "help timestamp" or "help timeseal" on your ICS for more detailed information.</p> <hr /> <h3><a name="tag-C.13">[C.13] I can't run WinBoard unless I delete the WinBoard.ini file each time! </a></h3> <p>Most people don't have this problem, but two or three people using Windows NT 4.0 with Service Pack 3 or 4 have reported it. I have no idea what causes this problem. Contrary to what was reported in a previous version of this FAQ, reinstalling the service pack after installing WinBoard does not seem to solve the problem.</p> <hr /> <h3><a name="tag-C.15">[C.15] I get errors compiling XBoard's parser.c. </a></h3> <p>The file parser.c is automatically generated from parser.l. The copy included with XBoard 4.0.2 was generated by lex on Tru64 Unix and has problems compiling and linking on current GNU/Linux versions. The copy included with XBoard 4.0.3 was generated by flex on a GNU/Linux machine, but it too won't necessarily work on other versions of Unix. If you have this problem, you can fix it by deleting parser.c and letting the Makefile re-create it from parser.l. This will work if you have either lex or flex on your system. Flex is available in all GNU/Linux distributions and can be obtained at no charge from the Free Software Foundation, www.fsf.org.</p> <hr /> <h3><a name="tag-C.16">[C.16] I get an error building WinBoard from source because "flex" is not found. </a></h3> <p>The file parser.c is automatically generated from parser.l. The Makefile included with the WinBoard source kit has a rule for generating parser.c using the program "flex", which will fail if you don't have flex. However, the source kit also includes a ready-made copy of parser.c, so you don't really need flex unless you have made changes to parser.l. Check that you still have a copy of parser.c; if you don't, unpack the WinBoard source zip file again to get one. Either set the last-modified time of parser.c to be later than that of parser.l, delete parser.l, or comment out the Makefile rule for building parser.c from parser.l, and then try building WinBoard again.</p> <p>If you do want to change parser.l and rebuild parser.c, you can get flex as part of the free Cygwin kit from <a href="http://sourceware.cygnus.com/cygwin/" >http://sourceware.cygnus.com/cygwin/</a>. You can probably also get flex for Windows by itself from various other places around the Internet. It is free software distributed by the Free Software Foundation, www.fsf.org.</p> <hr /> <h3><a name="tag-C.17">[C.17] XBoard hangs shortly after connecting to an ICS when used with dxterm, cmdtool, dtterm, kterm, konsole, or other substitutes for xterm. </a></h3> <p>After connecting to a chess server, XBoard 4.0.2 and later sends an escape sequence to its terminal that is meant to display your handle and the ICS host name (for example, "user<a name="nospam03">&#x40;</a>chessclub.com") in the terminal's banner and icon. It seems that several of the alternative X terminal programs have a bug that makes them hang when sent this escape sequence.</p> <p>You can work around the problem by using xterm, nxterm, rxvt, aterm, xiterm, or gnome-terminal, all of which seem to work fine. In fact, current versions of kterm and konsole seem to work fine too, so if you are having problems with one of them, be sure you are not running an outdated version. </p> <p>Alternatively, you can disable this feature by commenting out the body of DisplayIcsInteractionTitle in xboard.c and recompling xboard.</p> <hr /> <h3><a name="tag-C.18">[C.18] The WinBoard pieces show up in the wrong colors, appear distorted, or are not visible at all. </a></h3> <p>This can happen if you have a bug in your Windows display driver. Check with the manufacturer of your display card, the manufacturer of your computer, or Microsoft to see if there is an updated driver available. You can usually download updated drivers from the Web.</p> <p>If you can't find an updated driver, you can try running Windows using a different number of colors and/or disabling some of the hardware acceleration features on your display card. To change the number of colors, go to Windows Start / Settings / Control Panel / Display / Settings / Color Palette. To disable hardware acceleration features, go to Windows Start / Settings / Control Panel / Display / Settings / Advanced Properties / Performance / Hardware Acceleration.</p> <p>It's also possible that Windows has the right driver for your hardware already but you are not using it. It may help to reinstall your driver. Go to Windows Start / Settings / Control Panel / System and delete your display card (maybe even your monitor too), then reboot. Windows should automatically re-detect your card and monitor and re-install the drivers; if it doesn't, run Start / Settings / Control Panel / Add New Hardware to force it to.</p> <p>If all else fails, try Monochrome mode. On WinBoard's menus, go to Options / Color and check Monochrome. WinBoard will display in black and white.</p> <hr /> <h3><a name="tag-C.19">[C.19] XBoard or WinBoard tells me "Error: first chess program (...) exited unexpectedly".</a></h3> <p>This message means that your chess engine crashed, probably due to a bug in the engine, or because you have it configured incorrectly. You can try running XBoard or WinBoard again with the "-debug" flag on the command line. This will print out all the messages received from the chess engine. (With WinBoard, the messages go into a file called WinBoard.debug; with XBoard, they go to the xterm that you started XBoard from.)</p> <p>If you are using GNU Chess and you see this problem as soon as it starts up, most likely GNU Chess is exiting with an error message. If you see the message "NO LANGFILE", it means that you did not install GNU Chess correctly, and it is unable to find the file gnuchess.lang. Make sure that you defined LIBDIR in the gnuchess Makefile, and that gnuchess.lang is in that directory. If gnuchess.lang is not there, you probably didn't type "make install" in the gnuchess src directory; you must do this to install gnuchess.lang (and the gnuchess book). If you defined LIBDIR to something that is not an absolute pathname (that is, to something that does not start with a "/"), GNU Chess will work only if you run it from the GNU Chess "src" directory where you built it.</p> <hr /><h3><a name="tag-C.20">[C.20] XBoard tells me "Warning: Cannot allocate colormap entry", or "too few colors available; trying monochrome mode", or "XPM pieces cannot be used in monochrome mode". </a></h3> <p>You are running your X server with 8-bit color depth, and you are running some program that has used up all 256 of your colors. Netscape tends to do this, or maybe you have a background image that uses up all of your colors.</p> <p>If you have a modern machine, you probably have enough display memory to run your X server with 16-, 24-, or 32-bit color depth. If you're using "startx" to start the X server, try giving the command as "<tt>startx -- -bpp 24</tt>" (or 16, or 32). On newer X servers you may have to use -depth instead of -bpp. Further details on configuring your X server are beyond the scope of this FAQ.</p> <p>If you must run in 8-bit mode, try the following: Avoid background images that use up all your colors. If you run Netscape, try starting it up with the <tt>-install</tt> command-line option; this gives Netscape its own private colormap that X will switch to when Netscape has the keyboard focus. </p> <p>If all else fails, another possibility is to run xboard in monochrome (black and white) mode by giving it the <tt>-mono</tt> command-line option. XBoard will try this by itself in some cases. Monochrome mode works only with bitmap pieces, not pixmap pieces, so trying to use it may give you the error "XPM pieces cannot be used in monochrome mode". To get around this, either use the -bitmapDirectory command line option to point XBoard to the directory containing the bitmap pieces included with the XBoard source code, or rebuild XBoard with pixmap support disabled, using "./configure --disable-xpm ; make clean ; make".</p> <hr /><h3><a name="tag-C.21">[C.21] When I log in to freechess.org, the Enter key doesn't work, and I have to use Ctrl+J instead. But when I use WinBoard, Ctrl+J doesn't work either, so I'm stuck. </a></h3> <p>This is a pretty rare problem. It should only arise if you have to reach freechess.org by telnetting (or connecting with WinBoard /icsport=23) from a Windows PC to a Unix box, and then telnetting from there to freechess.org. The Enter key should always work when connecting directly from your PC to freechess.org.</p> <p>The best way to get around the problem is to run timeseal on the intermediate Unix box instead of telnet. Get the appropriate version of timeseal for your box from ftp.freechess.org and follow the directions in the help files on FICS.</p> <p>If you can't run timeseal for some reason, there are some things you can do to make telnet stay in line mode instead of going to character mode. Then the Enter key will work. First, try "telnet freechess.org 5000" instead of "telnet freechess.org." If that still doesn't work, then when the Enter key stops working, type the following. Here <tt>&lt;</tt> and <tt>&gt;</tt> surround the names of keys.</p> <pre> &lt;Ctrl+S&gt;&lt;Ctrl+]&gt;mode line&lt;Enter&gt; </pre> <hr /><h3><a name="tag-C.22">[C.22] XBoard says, "Failed to start first chess program fairymax on localhost: fairymax: No such file or directory." </a></h3> <p>XBoard is looking for the Fairy-Max chess engine. If you didn't want to use XBoard with Fairy-Max, please see topic <a href="#tag-C.6">[C.6]</a>. If you did want to use Fairy-Max, be sure you have it installed and that it is on your $PATH. If you wanted to use GNU Chess instead, see topic <a href="#tag-D.6">[D.6]</a>.</p> <hr /> <h2><a name="tag-D">[D] Crafty and other topics</a></h2> <hr /> <h3><a name="tag-D.1">[D.1] What is XChess?</a></h3> <p>XChess is an older chessboard program that is no longer supported. XChess was written for X version 10, and you may or may not be able to build and run it on an X11 system.</p> <p>XChess has only one significant feature that is not present in XBoard: Two humans can play chess using XChess on different machines, without using the Internet Chess Server as an intermediary. This feature is of interest only if you don't have network connectivity to the Internet Chess Server.</p> <p>Note: There actually have been several different programs called "XChess" in circulation at various times. The above describes one that was associated with GNU Chess.</p> <hr /> <h3><a name="tag-D.2">[D.2] What is Winsock Chess?</a></h3> <p>Winsock Chess is a program that lets two people play chess across a network. It runs only under Microsoft Windows. Some of the code in Winsock Chess is derived from GNU Chess, but it is not maintained by the GNU Chess team. You can get a copy from the Internet Chess Library; see topic <a href="#tag-A.2">[A.2]</a>. For more information, contact its author, Donald Munro, ccahdm<a name="nospam04">&#x40;</a>beluga.upe.ac.za.</p> <hr /> <h3><a name="tag-D.3">[D.3] What is Crafty?</a></h3> <p>Crafty is a freely-available chess program written by Bob Hyatt. Bob is the main author of the well-known chess program Cray Blitz. Crafty is a very strong program, its code is available, commented and fairly readable, and its author is actively working on improvements.</p> <p>You can download Crafty from <a href="ftp://ftp.cis.uab.edu/pub/hyatt/" >ftp://ftp.cis.uab.edu/pub/hyatt/</a>. Start by getting the <a href="ftp://ftp.cis.uab.edu/pub/hyatt/read.me" >read.me</a> file and reading it. Among other things, this file contains instructions on how to install Crafty as a command-line application on your machine.</p> <p>There is a Crafty mailing list. To subscribe, send email to majordomo<a name="nospam05">&#x40;</a>cis.uab.edu, with "subscribe crafty-list" in the body.</p> <hr /> <h3><a name="tag-D.4">[D.4] How do I use Crafty with XBoard?</a></h3> <p>First, you need to get Crafty and install it as a command-line application on your machine. See topic <a href="#tag-D.3">[D.3]</a>.</p> <p>To use Crafty with XBoard, give the -fcp parameter like this:</p> <pre> xboard -fcp "./crafty" -fd <I>crafty_directory</I> </pre> <p>Here <I>crafty_directory</I> is the directory where you installed Crafty. You can add more xboard options at the end of the command line.</p> <p>Crafty 15.14 or later is required to work properly with XBoard 4.0.0 or later. We generally recommend using the latest versions of both XBoard and Crafty.</p> <hr /> <h3><a name="tag-D.5">[D.5] How do I use Crafty with WinBoard?</a></h3> <p>First, you need to get Crafty and install it as a command-line application on your machine. See topic <a href="#tag-D.3">[D.3]</a>. It is best to use the latest version of Crafty with the latest version of WinBoard to make sure all features are compatible and function correctly. You can install Crafty in any directory you like.</p> <p>You also need to get WinBoard and install it in the normal way using its built-in installer. You can do that either before or after you install Crafty.</p> <p>After both Crafty and WinBoard are installed separately, follow the directions in the WinBoard Help file (included with WinBoard) for connecting new chess engines to WinBoard.</p> <p>If you want to have Crafty act as an automated computer player on a chess server, see topic <a href="#tag-B.16">[B.16]</a>. Before you try to get that working, be sure you can play against Crafty locally, first without WinBoard, then with it. Also be sure you can use WinBoard to play on the chess server yourself, without having Crafty connected to it. You have to crawl before you can walk!</p> <hr /> <h3><a name="tag-D.6">[D.6] How do I use GNU Chess with XBoard?</a></h3> <p>By default, XBoard tries to use Fairy-Max by running the command "fairymax". That's why if you don't have Fairy-Max, you get the error message "Failed to start first chess program fairymax on localhost: fairymax: No such file or directory."</p> <p>If you have GNU Chess 5, the command should be "gnuchess xboard" instead. To make XBoard use this command, give the -fcp parameter like this:</p> <pre> xboard -fcp "gnuchess xboard" </pre> If you instaled GNU Chess as a package, the operating system usually knows where to find it, and GNU Chess knwos where to find its data files, such as the opening book. If GNU Chess is installed in a non-compliant way, e.g. together with its book file in a user directory, you must use: <pre> xboard -fd <I>gnuchess_directory</I> -fcp "./gnuchess xboard" </pre> <p>Here <I>gnuchess_directory</I> is the directory where you installed GNU Chess 5 and its book. In all cases you can add more xboard options at the end of the command line.</p> <p>If you want to use GNU Chess 4, the command should be "gnuchessx" instead. To make XBoard use this command, give the -fcp parameter like this:</p> <pre> xboard -fcp "gnuchessx" </pre> <p>The same applies for non-compliant installs as for GNU Chess 5: the install directory has to be given with the -fd argument. </p> <hr /> <h3><a name="tag-D.7">[D.7] How do I use GNU Chess with WinBoard?</a></h3> <p>Well, why would you want to? If you want a strong free engine, use Crafty, Glaurung, Fruit or Toga. If you wnt an engine that plays many variants, use Fairy-Max, Pulsar or Sjeng. But the procedure to install and run those is not any different than for GNU Chess. </p> <p>If you want to use a WinBoard-compatible chess engine that is not automatically installed with the download, you will have to download it yourself. Most chess engines are downloaded as a compressed archive (e.g. a .zip file), and on downloadig it, the decompression software on your Windows system is automatically invoked when you seected "Open" in the download dialog. You can then click "extract all files", and you are prompted for a place to put the unpacked stuff. The place it proposes is usually no good, so browse to the folder in which you installed the winBoard download (where you see the Fairy-Max and WinBoard folders). </p><p> When the archiv contained a single folder, (with files in it), unpack it there. If the archive contained a lot of small files, first create a folder, and browse there, before you unpack. (To get all the files in a single place, not mixed with others, so you can easily delete it again.) Say you unpacked in a folder named "NewEngine", which now sits next to your "WinBoard" folder amongst the chess files on your system. Say there is a file "Engine.exe" in this "NewEngine" folder. </p><p> Then to run the engine with WinBoard, you have to enter the command: </p> <pre> winboard /fcp="Engine.exe" /fd="..\NewEngine" </pre> <p> Sometimes engines need parameters on their command line, e.g. to set the hash-table size, or tell them they have to deal with WinBoard. These should then go within the quotes around the Engine.exe file name, directly behind it, and separated from it (and each other) by spaces. See any README files that come with the engine to learn how exactly the engine has to be invoked. </p> <hr /> <h3><a name="tag-D.8">[D.8] What is Fairy-Max?</a></h3> <p>Fairy-Max is a chess engine that plays chess at a level where you don't need to be a super GM to still have a chance to beat it. Apart from normal chess it plays many variants as well, such as Capablanca or Gothic Chess, Knightmate, etc. Dedicated versions of it are available to play Shatranj and Xiangqi (Chinese Chess). </p> <hr /> <h3><a name="tag-D.9">[D.9] What is UCI? What is Polyglot?</a></h3> <p>UCI, or Universal Chess Interface, is a standard for communication between chess engines and its Graphical User Interface, that was created as an alternative to the way XBoard / WinBoard does it. (The latter way having become known as "<a href="#tag-B.17">WinBoard protocol</a>"). XBoard / WinBoard do not understand a word of UCI, so UCI engines cannnot be run directly as engine under them. </p><p> Polyglot is an adapter that translates WB protocol to UCI. It bhaves like it is a WB engine, but, without XBoard / WinBoard knowing about this, it consults an UCI engine for getting the moves. With the aid of Polyglot, any UCI engine can be run under WinBoard. Polyglot is available as a Debian package for Linux, and is included in the WinBoard installation. Polyglot is open source software released under the GPL. </p> <hr /> <h3><a name="tag-D.10">[D.10] How can I run a UCI engine under XBoard / WinBoard?</a></h3> <p>First you have to download and install the UCI engine. This is similar to installing WinBoard engines, see <a href="#tag-D.7">D.7</a>. Furthermore, you have to make sure that <a href="#tag-D.9">Polyglot</a> is nstalled on your system, in a place where XBoard / WinBoard can find it. There are then two ways to run the UCI engine: </p><p> In the first method, the only thing you have to do is add an extra option to the command that invokes XBoard / WinBoard, to tell it that the engine is UCI: </p> <pre> xboard -fcp "fruit" -fUCI winboard /fcp="Fruit_21.exe" /fd="..\Fruit" /fUCI </pre> <p> The second method is more complicated, but also more versatile. UCI engines accept many settings from their GUI than XBoard / WinBoard usually send to a WB engine. Polyglot can provide such settings from a file dedicated to that engine, usully referred to as a "polyglot.ini" file (although the actual name can be different.) If the engine you downloaded comes with a polyglot.ini file for it, you can force Polyglot to use this file with engine settings by invoking it explicitly from XBoard / WinBoard: </p> <pre> xboard -fcp "polyglot INIFILE" winboard /fcp="polyglot INIFILE" /fd="POLYGLOTDIR" </pre> <p> INIFILE is the name of the polyglot.ini file (possibly a path name, such as "PG\fruit.ini", while POLYGLOTDIR should be the directory (path) name were the Polyglot executable is located. The directory and name of the actual engine are described in the polygot.ini file, and XBoard / WinBoard need not be aware of them. </p><p> If you don't have a polyglot.ini file for the engine, you would have to make one. How to do that is beyond the scope of this FAQ. Refer to the Polyglot documentation for this, or use method 1. </p> <hr /> ** End of XBoard/WinBoard FAQ ** </body></html>
gpl-3.0
dougmassay/flightcrew
src/zipios/src/outputstringstream.h
2155
#ifndef OUTPUTSTRINGSTREAM_H #define OUTPUTSTRINGSTREAM_H #include "zipios++/zipios-config.h" #include "zipios++/meta-iostreams.h" #include <string> namespace zipios { #if defined (HAVE_STD_IOSTREAM) && defined (USE_STD_IOSTREAM) typedef std::ostringstream OutputStringStream ; #else /** OutputStringStream is typedefed to ostringstream if sstream is part of the standard library (unless Zipios++ has been explicitly configured not to use it). If sstream is not present OutputStringStream is a subclass of ostrstream from strstream.h. In this case OutputStringStream specializes the str() method, such that the caller does not have to concern himself with null-terminating the string and unfreezing the ostrstream. */ class OutputStringStream : public ostrstream { public: /** Specialization of ostrstream::str() that takes care of null-terminating the string and unfreezing the ostrstream. */ inline string str() { *this << ends ; // null terminate ostrstream string o_str( ostrstream::str() ) ; freeze( 0 ) ; return o_str ; } private: // To avoid invoking such a member function in the base // class if there is one! string str() const ; }; #endif } // namespace #endif /** \file Header file that defines OutputStringStream. */ /* Zipios++ - a small C++ library that provides easy access to .zip files. Copyright (C) 2000 Thomas Søndergaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
gpl-3.0
farkam135/GoIV
openCVLibrary330/src/main/java/org/opencv/videoio/VideoWriter.java
7935
// // This file is auto-generated. Please don't modify it! // package org.opencv.videoio; import org.opencv.core.Mat; import org.opencv.core.Size; // C++: class VideoWriter //javadoc: VideoWriter public class VideoWriter { protected final long nativeObj; protected VideoWriter(long addr) { nativeObj = addr; } public long getNativeObjAddr() { return nativeObj; } // // C++: VideoWriter(String filename, int apiPreference, int fourcc, double fps, Size frameSize, bool isColor = true) // //javadoc: VideoWriter::VideoWriter(filename, apiPreference, fourcc, fps, frameSize, isColor) public VideoWriter(String filename, int apiPreference, int fourcc, double fps, Size frameSize, boolean isColor) { nativeObj = VideoWriter_0(filename, apiPreference, fourcc, fps, frameSize.width, frameSize.height, isColor); return; } //javadoc: VideoWriter::VideoWriter(filename, apiPreference, fourcc, fps, frameSize) public VideoWriter(String filename, int apiPreference, int fourcc, double fps, Size frameSize) { nativeObj = VideoWriter_1(filename, apiPreference, fourcc, fps, frameSize.width, frameSize.height); return; } // // C++: VideoWriter(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) // //javadoc: VideoWriter::VideoWriter(filename, fourcc, fps, frameSize, isColor) public VideoWriter(String filename, int fourcc, double fps, Size frameSize, boolean isColor) { nativeObj = VideoWriter_2(filename, fourcc, fps, frameSize.width, frameSize.height, isColor); return; } //javadoc: VideoWriter::VideoWriter(filename, fourcc, fps, frameSize) public VideoWriter(String filename, int fourcc, double fps, Size frameSize) { nativeObj = VideoWriter_3(filename, fourcc, fps, frameSize.width, frameSize.height); return; } // // C++: VideoWriter() // //javadoc: VideoWriter::VideoWriter() public VideoWriter() { nativeObj = VideoWriter_4(); return; } // // C++: bool isOpened() // //javadoc: VideoWriter::isOpened() public boolean isOpened() { boolean retVal = isOpened_0(nativeObj); return retVal; } // // C++: bool open(String filename, int apiPreference, int fourcc, double fps, Size frameSize, bool isColor = true) // //javadoc: VideoWriter::open(filename, apiPreference, fourcc, fps, frameSize, isColor) public boolean open(String filename, int apiPreference, int fourcc, double fps, Size frameSize, boolean isColor) { boolean retVal = open_0(nativeObj, filename, apiPreference, fourcc, fps, frameSize.width, frameSize.height, isColor); return retVal; } //javadoc: VideoWriter::open(filename, apiPreference, fourcc, fps, frameSize) public boolean open(String filename, int apiPreference, int fourcc, double fps, Size frameSize) { boolean retVal = open_1(nativeObj, filename, apiPreference, fourcc, fps, frameSize.width, frameSize.height); return retVal; } // // C++: bool open(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) // //javadoc: VideoWriter::open(filename, fourcc, fps, frameSize, isColor) public boolean open(String filename, int fourcc, double fps, Size frameSize, boolean isColor) { boolean retVal = open_2(nativeObj, filename, fourcc, fps, frameSize.width, frameSize.height, isColor); return retVal; } //javadoc: VideoWriter::open(filename, fourcc, fps, frameSize) public boolean open(String filename, int fourcc, double fps, Size frameSize) { boolean retVal = open_3(nativeObj, filename, fourcc, fps, frameSize.width, frameSize.height); return retVal; } // // C++: bool set(int propId, double value) // //javadoc: VideoWriter::set(propId, value) public boolean set(int propId, double value) { boolean retVal = set_0(nativeObj, propId, value); return retVal; } // // C++: double get(int propId) // //javadoc: VideoWriter::get(propId) public double get(int propId) { double retVal = get_0(nativeObj, propId); return retVal; } // // C++: static int fourcc(char c1, char c2, char c3, char c4) // //javadoc: VideoWriter::fourcc(c1, c2, c3, c4) public static int fourcc(char c1, char c2, char c3, char c4) { int retVal = fourcc_0(c1, c2, c3, c4); return retVal; } // // C++: void release() // //javadoc: VideoWriter::release() public void release() { release_0(nativeObj); return; } // // C++: void write(Mat image) // //javadoc: VideoWriter::write(image) public void write(Mat image) { write_0(nativeObj, image.nativeObj); return; } @Override protected void finalize() throws Throwable { delete(nativeObj); } // C++: VideoWriter(String filename, int apiPreference, int fourcc, double fps, Size frameSize, bool isColor = true) private static native long VideoWriter_0(String filename, int apiPreference, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor); private static native long VideoWriter_1(String filename, int apiPreference, int fourcc, double fps, double frameSize_width, double frameSize_height); // C++: VideoWriter(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) private static native long VideoWriter_2(String filename, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor); private static native long VideoWriter_3(String filename, int fourcc, double fps, double frameSize_width, double frameSize_height); // C++: VideoWriter() private static native long VideoWriter_4(); // C++: bool isOpened() private static native boolean isOpened_0(long nativeObj); // C++: bool open(String filename, int apiPreference, int fourcc, double fps, Size frameSize, bool isColor = true) private static native boolean open_0(long nativeObj, String filename, int apiPreference, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor); private static native boolean open_1(long nativeObj, String filename, int apiPreference, int fourcc, double fps, double frameSize_width, double frameSize_height); // C++: bool open(String filename, int fourcc, double fps, Size frameSize, bool isColor = true) private static native boolean open_2(long nativeObj, String filename, int fourcc, double fps, double frameSize_width, double frameSize_height, boolean isColor); private static native boolean open_3(long nativeObj, String filename, int fourcc, double fps, double frameSize_width, double frameSize_height); // C++: bool set(int propId, double value) private static native boolean set_0(long nativeObj, int propId, double value); // C++: double get(int propId) private static native double get_0(long nativeObj, int propId); // C++: static int fourcc(char c1, char c2, char c3, char c4) private static native int fourcc_0(char c1, char c2, char c3, char c4); // C++: void release() private static native void release_0(long nativeObj); // C++: void write(Mat image) private static native void write_0(long nativeObj, long image_nativeObj); // native support for java finalize() private static native void delete(long nativeObj); }
gpl-3.0
UlyssesWu/dnSpy
ILSpy.AddIn/ILSpyAddInPackage.cs
6884
using System; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.ComponentModel.Design; using Microsoft.Win32; using Microsoft.VisualStudio; using Microsoft.VisualStudio.Shell.Interop; using Microsoft.VisualStudio.OLE.Interop; using Microsoft.VisualStudio.Shell; using System.Reflection; using System.IO; using dnlib.DotNet; namespace ICSharpCode.ILSpy.AddIn { /// <summary> /// This is the class that implements the package exposed by this assembly. /// /// The minimum requirement for a class to be considered a valid package for Visual Studio /// is to implement the IVsPackage interface and register itself with the shell. /// This package uses the helper classes defined inside the Managed Package Framework (MPF) /// to do it: it derives from the Package class that provides the implementation of the /// IVsPackage interface and uses the registration attributes defined in the framework to /// register itself and its components with the shell. /// </summary> // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is // a package. [PackageRegistration(UseManagedResourcesOnly = true)] // This attribute is used to register the information needed to show this package // in the Help/About dialog of Visual Studio. [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // This attribute is needed to let the shell know that this package exposes some menus. [ProvideMenuResource("Menus.ctmenu", 1)] [Guid(GuidList.guidILSpyAddInPkgString)] [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string)] public sealed class ILSpyAddInPackage : Package { /// <summary> /// Default constructor of the package. /// Inside this method you can place any initialization code that does not require /// any Visual Studio service because at this point the package object is created but /// not sited yet inside Visual Studio environment. The place to do all the other /// initialization is the Initialize method. /// </summary> public ILSpyAddInPackage() { Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); } ///////////////////////////////////////////////////////////////////////////// // Overridden Package Implementation #region Package Members /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (null != mcs) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidILSpyAddInCmdSet, (int)PkgCmdIDList.cmdidOpenReferenceInILSpy); MenuCommand menuItem = new MenuCommand(OpenReferenceInILSpyCallback, menuCommandID); mcs.AddCommand(menuItem); // Create the command for the menu item. CommandID menuCommandID2 = new CommandID(GuidList.guidILSpyAddInCmdSet, (int)PkgCmdIDList.cmdidOpenProjectOutputInILSpy); MenuCommand menuItem2 = new MenuCommand(OpenProjectOutputInILSpyCallback, menuCommandID2); mcs.AddCommand(menuItem2); // Create the command for the menu item. CommandID menuCommandID3 = new CommandID(GuidList.guidILSpyAddInCmdSet, (int)PkgCmdIDList.cmdidOpenILSpy); MenuCommand menuItem3 = new MenuCommand(OpenILSpyCallback, menuCommandID3); mcs.AddCommand(menuItem3); } } #endregion /// <summary> /// This function is the callback used to execute a command when the a menu item is clicked. /// See the Initialize method to see how the menu item is associated to this function using /// the OleMenuCommandService service and the MenuCommand class. /// </summary> private void OpenReferenceInILSpyCallback(object sender, EventArgs e) { var explorer = ((EnvDTE80.DTE2)GetGlobalService(typeof(EnvDTE.DTE))).ToolWindows.SolutionExplorer; var items =(object[]) explorer.SelectedItems; foreach (EnvDTE.UIHierarchyItem item in items) { dynamic reference = item.Object; string path = null; if (reference.PublicKeyToken != "") { var token = Utils.HexStringToBytes(reference.PublicKeyToken); path = GacInterop.FindAssemblyInNetGac(new AssemblyNameInfo() { Name = reference.Identity, Version = new Version(reference.Version), PublicKeyOrToken = new PublicKeyToken(token), Culture = string.Empty }); } if (path == null) path = reference.Path; OpenAssemblyInILSpy(path); } } private void OpenProjectOutputInILSpyCallback(object sender, EventArgs e) { var explorer = ((EnvDTE80.DTE2)GetGlobalService(typeof(EnvDTE.DTE))).ToolWindows.SolutionExplorer; var items = (object[])explorer.SelectedItems; foreach (EnvDTE.UIHierarchyItem item in items) { EnvDTE.Project project = (EnvDTE.Project)item.Object; EnvDTE.Configuration config = project.ConfigurationManager.ActiveConfiguration; string projectPath = Path.GetDirectoryName(project.FileName); string outputPath = config.Properties.Item("OutputPath").Value.ToString(); string assemblyFileName = project.Properties.Item("OutputFileName").Value.ToString(); OpenAssemblyInILSpy(Path.Combine(projectPath, outputPath, assemblyFileName)); } } private void OpenILSpyCallback(object sender, EventArgs e) { Process.Start(GetILSpyPath()); } private string GetILSpyPath() { var basePath = Path.GetDirectoryName(typeof(ILSpyAddInPackage).Assembly.Location); return Path.Combine(basePath, "dnSpy.exe"); } private void OpenAssemblyInILSpy(string assemblyFileName) { if (!File.Exists(assemblyFileName)) { ShowMessage("Could not find assembly '{0}', please ensure the project and all references were built correctly!", assemblyFileName); return; } Process.Start(GetILSpyPath(), Utils.ArgumentArrayToCommandLine(assemblyFileName)); } private void ShowMessage(string format, params object[] items) { IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell)); Guid clsid = Guid.Empty; int result; Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure( uiShell.ShowMessageBox( 0, ref clsid, "ILSpy.AddIn", string.Format(CultureInfo.CurrentCulture, format, items), string.Empty, 0, OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST, OLEMSGICON.OLEMSGICON_INFO, 0, // false out result ) ); } } }
gpl-3.0
Xephi/AuthMeReloaded
src/test/java/fr/xephi/authme/data/limbo/persistence/SegmentNameBuilderTest.java
5364
package fr.xephi.authme.data.limbo.persistence; import org.junit.Test; import java.util.HashSet; import java.util.Set; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.EIGHT; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.FOUR; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.ONE; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.SIXTEEN; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.SIXTY_FOUR; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.THIRTY_TWO; import static fr.xephi.authme.data.limbo.persistence.SegmentSize.TWO_FIFTY; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; /** * Test for {@link SegmentNameBuilder}. */ public class SegmentNameBuilderTest { /** * Checks that using a given segment size really produces as many segments as defined. * E.g. if we partition with {@link SegmentSize#EIGHT} we expect eight different buckets. */ @Test public void shouldCreatePromisedSizeOfSegments() { for (SegmentSize part : SegmentSize.values()) { // Perform this check only for `length` <= 5 because the test creates all hex numbers with `length` digits. if (part.getLength() <= 5) { checkTotalSegmentsProduced(part); } } } private void checkTotalSegmentsProduced(SegmentSize part) { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(part); Set<String> encounteredSegments = new HashSet<>(); int shift = part.getLength() * 4; // e.g. (1 << 16) - 1 = 0xFFFF. (Number of digits = shift/4, since 16 = 2^4) int max = (1 << shift) - 1; // when for (int i = 0; i <= max; ++i) { String uuid = toPaddedHex(i, part.getLength()); encounteredSegments.add(nameBuilder.createSegmentName(uuid)); } // then assertThat(encounteredSegments, hasSize(part.getTotalSegments())); } private static String toPaddedHex(int dec, int padLength) { String hexResult = Integer.toString(dec, 16); while (hexResult.length() < padLength) { hexResult = "0" + hexResult; } return hexResult; } @Test public void shouldCreateOneSegment() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(ONE); // when / then assertThat(nameBuilder.createSegmentName("abc"), equalTo("seg1-0")); assertThat(nameBuilder.createSegmentName("f0e"), equalTo("seg1-0")); assertThat(nameBuilder.createSegmentName("329"), equalTo("seg1-0")); } @Test public void shouldCreateFourSegments() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(FOUR); // when / then assertThat(nameBuilder.createSegmentName("f9cc"), equalTo("seg4-3")); assertThat(nameBuilder.createSegmentName("84c9"), equalTo("seg4-2")); assertThat(nameBuilder.createSegmentName("3799"), equalTo("seg4-0")); } @Test public void shouldCreateEightSegments() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(EIGHT); // when / then assertThat(nameBuilder.createSegmentName("fc9c"), equalTo("seg8-7")); assertThat(nameBuilder.createSegmentName("90ad"), equalTo("seg8-4")); assertThat(nameBuilder.createSegmentName("35e4"), equalTo("seg8-1")); assertThat(nameBuilder.createSegmentName("a39f"), equalTo("seg8-5")); } @Test public void shouldCreateSixteenSegments() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(SIXTEEN); // when / then assertThat(nameBuilder.createSegmentName("fc9a054"), equalTo("seg16-f")); assertThat(nameBuilder.createSegmentName("b0a945e"), equalTo("seg16-b")); assertThat(nameBuilder.createSegmentName("7afebab"), equalTo("seg16-7")); } @Test public void shouldCreateThirtyTwoSegments() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(THIRTY_TWO); // when / then assertThat(nameBuilder.createSegmentName("f890c9"), equalTo("seg32-11101")); assertThat(nameBuilder.createSegmentName("49c39a"), equalTo("seg32-01101")); assertThat(nameBuilder.createSegmentName("b75d09"), equalTo("seg32-10010")); } @Test public void shouldCreateSixtyFourSegments() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(SIXTY_FOUR); // when / then assertThat(nameBuilder.createSegmentName("82f"), equalTo("seg64-203")); assertThat(nameBuilder.createSegmentName("9b4"), equalTo("seg64-221")); assertThat(nameBuilder.createSegmentName("068"), equalTo("seg64-012")); } @Test public void shouldCreate256Segments() { // given SegmentNameBuilder nameBuilder = new SegmentNameBuilder(TWO_FIFTY); // when / then assertThat(nameBuilder.createSegmentName("a813c"), equalTo("seg256-a8")); assertThat(nameBuilder.createSegmentName("b4d01"), equalTo("seg256-b4")); assertThat(nameBuilder.createSegmentName("7122f"), equalTo("seg256-71")); } }
gpl-3.0
syslover33/ctank
java/android-sdk-linux_r24.4.1_src/sources/android-23/android/os/storage/VolumeRecord.java
4577
/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.os.storage; import android.os.Parcel; import android.os.Parcelable; import android.util.DebugUtils; import android.util.TimeUtils; import com.android.internal.util.IndentingPrintWriter; import com.android.internal.util.Preconditions; import java.util.Objects; /** * Metadata for a storage volume which may not be currently present. * * @hide */ public class VolumeRecord implements Parcelable { public static final String EXTRA_FS_UUID = "android.os.storage.extra.FS_UUID"; public static final int USER_FLAG_INITED = 1 << 0; public static final int USER_FLAG_SNOOZED = 1 << 1; public final int type; public final String fsUuid; public String partGuid; public String nickname; public int userFlags; public long createdMillis; public long lastTrimMillis; public long lastBenchMillis; public VolumeRecord(int type, String fsUuid) { this.type = type; this.fsUuid = Preconditions.checkNotNull(fsUuid); } public VolumeRecord(Parcel parcel) { type = parcel.readInt(); fsUuid = parcel.readString(); partGuid = parcel.readString(); nickname = parcel.readString(); userFlags = parcel.readInt(); createdMillis = parcel.readLong(); lastTrimMillis = parcel.readLong(); lastBenchMillis = parcel.readLong(); } public int getType() { return type; } public String getFsUuid() { return fsUuid; } public String getNickname() { return nickname; } public boolean isInited() { return (userFlags & USER_FLAG_INITED) != 0; } public boolean isSnoozed() { return (userFlags & USER_FLAG_SNOOZED) != 0; } public void dump(IndentingPrintWriter pw) { pw.println("VolumeRecord:"); pw.increaseIndent(); pw.printPair("type", DebugUtils.valueToString(VolumeInfo.class, "TYPE_", type)); pw.printPair("fsUuid", fsUuid); pw.printPair("partGuid", partGuid); pw.println(); pw.printPair("nickname", nickname); pw.printPair("userFlags", DebugUtils.flagsToString(VolumeRecord.class, "USER_FLAG_", userFlags)); pw.println(); pw.printPair("createdMillis", TimeUtils.formatForLogging(createdMillis)); pw.printPair("lastTrimMillis", TimeUtils.formatForLogging(lastTrimMillis)); pw.printPair("lastBenchMillis", TimeUtils.formatForLogging(lastBenchMillis)); pw.decreaseIndent(); pw.println(); } @Override public VolumeRecord clone() { final Parcel temp = Parcel.obtain(); try { writeToParcel(temp, 0); temp.setDataPosition(0); return CREATOR.createFromParcel(temp); } finally { temp.recycle(); } } @Override public boolean equals(Object o) { if (o instanceof VolumeRecord) { return Objects.equals(fsUuid, ((VolumeRecord) o).fsUuid); } else { return false; } } @Override public int hashCode() { return fsUuid.hashCode(); } public static final Creator<VolumeRecord> CREATOR = new Creator<VolumeRecord>() { @Override public VolumeRecord createFromParcel(Parcel in) { return new VolumeRecord(in); } @Override public VolumeRecord[] newArray(int size) { return new VolumeRecord[size]; } }; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int flags) { parcel.writeInt(type); parcel.writeString(fsUuid); parcel.writeString(partGuid); parcel.writeString(nickname); parcel.writeInt(userFlags); parcel.writeLong(createdMillis); parcel.writeLong(lastTrimMillis); parcel.writeLong(lastBenchMillis); } }
gpl-3.0
aaujon/dolibarr
htdocs/install/mysql/data/llx_accounting.sql
521717
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org> -- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> -- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be> -- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> -- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> -- Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com> -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- -- -- -- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors -- de l'install et tous les sigles '--' sont supprimés. -- delete from llx_accountingaccount; delete from llx_accounting_system; -- -- Descriptif des plans comptables FR PCG99-ABREGE -- INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (1,'PCG99-ABREGE', 1, 'The simple accountancy french plan', 1); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 1,'PCG99-ABREGE','CAPIT', 'CAPITAL', '101', '1401', 'Capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 2,'PCG99-ABREGE','CAPIT', 'XXXXXX', '105', '1401', 'Ecarts de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 3,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1061', '1401', 'Réserve légale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 4,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1063', '1401', 'Réserves statutaires ou contractuelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 5,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1064', '1401', 'Réserves réglementées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 6,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1068', '1401', 'Autres réserves', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 7,'PCG99-ABREGE','CAPIT', 'XXXXXX', '108', '1401', 'Compte de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 8,'PCG99-ABREGE','CAPIT', 'XXXXXX', '12', '1401', 'Résultat de l''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 9,'PCG99-ABREGE','CAPIT', 'XXXXXX', '145', '1401', 'Amortissements dérogatoires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 10,'PCG99-ABREGE','CAPIT', 'XXXXXX', '146', '1401', 'Provision spéciale de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 11,'PCG99-ABREGE','CAPIT', 'XXXXXX', '147', '1401', 'Plus-values réinvesties', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 12,'PCG99-ABREGE','CAPIT', 'XXXXXX', '148', '1401', 'Autres provisions réglementées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 13,'PCG99-ABREGE','CAPIT', 'XXXXXX', '15', '1401', 'Provisions pour risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 14,'PCG99-ABREGE','CAPIT', 'XXXXXX', '16', '1401', 'Emprunts et dettes assimilees', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 15,'PCG99-ABREGE','IMMO', 'XXXXXX', '20', '1402', 'Immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 16,'PCG99-ABREGE','IMMO', 'XXXXXX', '201', '15', 'Frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 17,'PCG99-ABREGE','IMMO', 'XXXXXX', '206', '15', 'Droit au bail', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 18,'PCG99-ABREGE','IMMO', 'XXXXXX', '207', '15', 'Fonds commercial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 19,'PCG99-ABREGE','IMMO', 'XXXXXX', '208', '15', 'Autres immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 20,'PCG99-ABREGE','IMMO', 'XXXXXX', '21', '1402', 'Immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 21,'PCG99-ABREGE','IMMO', 'XXXXXX', '23', '1402', 'Immobilisations en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 22,'PCG99-ABREGE','IMMO', 'XXXXXX', '27', '1402', 'Autres immobilisations financieres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 23,'PCG99-ABREGE','IMMO', 'XXXXXX', '280', '1402', 'Amortissements des immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 24,'PCG99-ABREGE','IMMO', 'XXXXXX', '281', '1402', 'Amortissements des immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 25,'PCG99-ABREGE','IMMO', 'XXXXXX', '290', '1402', 'Provisions pour dépréciation des immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 26,'PCG99-ABREGE','IMMO', 'XXXXXX', '291', '1402', 'Provisions pour dépréciation des immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 27,'PCG99-ABREGE','IMMO', 'XXXXXX', '297', '1402', 'Provisions pour dépréciation des autres immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 28,'PCG99-ABREGE','STOCK', 'XXXXXX', '31', '1403', 'Matieres premières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 29,'PCG99-ABREGE','STOCK', 'XXXXXX', '32', '1403', 'Autres approvisionnements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 30,'PCG99-ABREGE','STOCK', 'XXXXXX', '33', '1403', 'En-cours de production de biens', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 31,'PCG99-ABREGE','STOCK', 'XXXXXX', '34', '1403', 'En-cours de production de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 32,'PCG99-ABREGE','STOCK', 'XXXXXX', '35', '1403', 'Stocks de produits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 33,'PCG99-ABREGE','STOCK', 'XXXXXX', '37', '1403', 'Stocks de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 34,'PCG99-ABREGE','STOCK', 'XXXXXX', '391', '1403', 'Provisions pour dépréciation des matières premières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 35,'PCG99-ABREGE','STOCK', 'XXXXXX', '392', '1403', 'Provisions pour dépréciation des autres approvisionnements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 36,'PCG99-ABREGE','STOCK', 'XXXXXX', '393', '1403', 'Provisions pour dépréciation des en-cours de production de biens', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 37,'PCG99-ABREGE','STOCK', 'XXXXXX', '394', '1403', 'Provisions pour dépréciation des en-cours de production de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 38,'PCG99-ABREGE','STOCK', 'XXXXXX', '395', '1403', 'Provisions pour dépréciation des stocks de produits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 39,'PCG99-ABREGE','STOCK', 'XXXXXX', '397', '1403', 'Provisions pour dépréciation des stocks de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 40,'PCG99-ABREGE','TIERS', 'SUPPLIER','400', '1404', 'Fournisseurs et Comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 41,'PCG99-ABREGE','TIERS', 'XXXXXX', '409', '1404', 'Fournisseurs débiteurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 42,'PCG99-ABREGE','TIERS', 'CUSTOMER','410', '1404', 'Clients et Comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 43,'PCG99-ABREGE','TIERS', 'XXXXXX', '419', '1404', 'Clients créditeurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 44,'PCG99-ABREGE','TIERS', 'XXXXXX', '421', '1404', 'Personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 45,'PCG99-ABREGE','TIERS', 'XXXXXX', '428', '1404', 'Personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 46,'PCG99-ABREGE','TIERS', 'XXXXXX', '43', '1404', 'Sécurité sociale et autres organismes sociaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 47,'PCG99-ABREGE','TIERS', 'XXXXXX', '444', '1404', 'Etat - impôts sur bénéfice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 48,'PCG99-ABREGE','TIERS', 'XXXXXX', '445', '1404', 'Etat - Taxes sur chiffre affaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 49,'PCG99-ABREGE','TIERS', 'XXXXXX', '447', '1404', 'Autres impôts, taxes et versements assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 50,'PCG99-ABREGE','TIERS', 'XXXXXX', '45', '1404', 'Groupe et associes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 51,'PCG99-ABREGE','TIERS', 'XXXXXX', '455', '50', 'Associés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 52,'PCG99-ABREGE','TIERS', 'XXXXXX', '46', '1404', 'Débiteurs divers et créditeurs divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 53,'PCG99-ABREGE','TIERS', 'XXXXXX', '47', '1404', 'Comptes transitoires ou d''attente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 54,'PCG99-ABREGE','TIERS', 'XXXXXX', '481', '1404', 'Charges à répartir sur plusieurs exercices', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 55,'PCG99-ABREGE','TIERS', 'XXXXXX', '486', '1404', 'Charges constatées d''avance', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 56,'PCG99-ABREGE','TIERS', 'XXXXXX', '487', '1404', 'Produits constatés d''avance', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 57,'PCG99-ABREGE','TIERS', 'XXXXXX', '491', '1404', 'Provisions pour dépréciation des comptes de clients', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 58,'PCG99-ABREGE','TIERS', 'XXXXXX', '496', '1404', 'Provisions pour dépréciation des comptes de débiteurs divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 59,'PCG99-ABREGE','FINAN', 'XXXXXX', '50', '1405', 'Valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 60,'PCG99-ABREGE','FINAN', 'BANK', '51', '1405', 'Banques, établissements financiers et assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 61,'PCG99-ABREGE','FINAN', 'CASH', '53', '1405', 'Caisse', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 62,'PCG99-ABREGE','FINAN', 'XXXXXX', '54', '1405', 'Régies d''avance et accréditifs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 63,'PCG99-ABREGE','FINAN', 'XXXXXX', '58', '1405', 'Virements internes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 64,'PCG99-ABREGE','FINAN', 'XXXXXX', '590', '1405', 'Provisions pour dépréciation des valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 65,'PCG99-ABREGE','CHARGE','PRODUCT', '60', '1406', 'Achats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 66,'PCG99-ABREGE','CHARGE','XXXXXX', '603', '65', 'Variations des stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 67,'PCG99-ABREGE','CHARGE','SERVICE', '61', '1406', 'Services extérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 68,'PCG99-ABREGE','CHARGE','XXXXXX', '62', '1406', 'Autres services extérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 69,'PCG99-ABREGE','CHARGE','XXXXXX', '63', '1406', 'Impôts, taxes et versements assimiles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 70,'PCG99-ABREGE','CHARGE','XXXXXX', '641', '1406', 'Rémunérations du personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 71,'PCG99-ABREGE','CHARGE','XXXXXX', '644', '1406', 'Rémunération du travail de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 72,'PCG99-ABREGE','CHARGE','SOCIAL', '645', '1406', 'Charges de sécurité sociale et de prévoyance', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 73,'PCG99-ABREGE','CHARGE','XXXXXX', '646', '1406', 'Cotisations sociales personnelles de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 74,'PCG99-ABREGE','CHARGE','XXXXXX', '65', '1406', 'Autres charges de gestion courante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 75,'PCG99-ABREGE','CHARGE','XXXXXX', '66', '1406', 'Charges financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 76,'PCG99-ABREGE','CHARGE','XXXXXX', '67', '1406', 'Charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 77,'PCG99-ABREGE','CHARGE','XXXXXX', '681', '1406', 'Dotations aux amortissements et aux provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 78,'PCG99-ABREGE','CHARGE','XXXXXX', '686', '1406', 'Dotations aux amortissements et aux provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 79,'PCG99-ABREGE','CHARGE','XXXXXX', '687', '1406', 'Dotations aux amortissements et aux provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 80,'PCG99-ABREGE','CHARGE','XXXXXX', '691', '1406', 'Participation des salariés aux résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 81,'PCG99-ABREGE','CHARGE','XXXXXX', '695', '1406', 'Impôts sur les bénéfices', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 82,'PCG99-ABREGE','CHARGE','XXXXXX', '697', '1406', 'Imposition forfaitaire annuelle des sociétés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 83,'PCG99-ABREGE','CHARGE','XXXXXX', '699', '1406', 'Produits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 84,'PCG99-ABREGE','PROD', 'PRODUCT', '701', '1407', 'Ventes de produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 85,'PCG99-ABREGE','PROD', 'SERVICE', '706', '1407', 'Prestations de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 86,'PCG99-ABREGE','PROD', 'PRODUCT', '707', '1407', 'Ventes de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 87,'PCG99-ABREGE','PROD', 'PRODUCT', '708', '1407', 'Produits des activités annexes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 88,'PCG99-ABREGE','PROD', 'XXXXXX', '709', '1407', 'Rabais, remises et ristournes accordés par l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 89,'PCG99-ABREGE','PROD', 'XXXXXX', '713', '1407', 'Variation des stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 90,'PCG99-ABREGE','PROD', 'XXXXXX', '72', '1407', 'Production immobilisée', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 91,'PCG99-ABREGE','PROD', 'XXXXXX', '73', '1407', 'Produits nets partiels sur opérations à long terme', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 92,'PCG99-ABREGE','PROD', 'XXXXXX', '74', '1407', 'Subventions d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 93,'PCG99-ABREGE','PROD', 'XXXXXX', '75', '1407', 'Autres produits de gestion courante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 94,'PCG99-ABREGE','PROD', 'XXXXXX', '753', '93', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 95,'PCG99-ABREGE','PROD', 'XXXXXX', '754', '93', 'Ristournes perçues des coopératives', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 96,'PCG99-ABREGE','PROD', 'XXXXXX', '755', '93', 'Quotes-parts de résultat sur opérations faites en commun', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 97,'PCG99-ABREGE','PROD', 'XXXXXX', '76', '1407', 'Produits financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 98,'PCG99-ABREGE','PROD', 'XXXXXX', '77', '1407', 'Produits exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES ( 99,'PCG99-ABREGE','PROD', 'XXXXXX', '781', '1407', 'Reprises sur amortissements et provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (100,'PCG99-ABREGE','PROD', 'XXXXXX', '786', '1407', 'Reprises sur provisions pour risques', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (101,'PCG99-ABREGE','PROD', 'XXXXXX', '787', '1407', 'Reprises sur provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (102,'PCG99-ABREGE','PROD', 'XXXXXX', '79', '1407', 'Transferts de charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1401,'PCG99-ABREGE','CAPIT', 'XXXXXX', '1', '', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1402,'PCG99-ABREGE','IMMO', 'XXXXXX', '2', '', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1403,'PCG99-ABREGE','STOCK', 'XXXXXX', '3', '', 'Stock et commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1404,'PCG99-ABREGE','TIERS', 'XXXXXX', '4', '', 'Créances et dettes à un an au plus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1405,'PCG99-ABREGE','FINAN', 'XXXXXX', '5', '', 'Placement de trésorerie et de valeurs disponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1406,'PCG99-ABREGE','CHARGE','XXXXXX', '6', '', 'Charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1407,'PCG99-ABREGE','PROD', 'XXXXXX', '7', '', 'Produits', '1'); -- -- Descriptif des plans comptables FR PCG99-BASE -- INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (2,'PCG99-BASE', 1, 'The base accountancy french plan', 1); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (103,'PCG99-BASE','CAPIT', 'XXXXXX', '10','1501', 'Capital et réserves', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (104,'PCG99-BASE','CAPIT', 'CAPITAL', '101', '103', 'Capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (105,'PCG99-BASE','CAPIT', 'XXXXXX', '104', '103', 'Primes liées au capital social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (106,'PCG99-BASE','CAPIT', 'XXXXXX', '105', '103', 'Ecarts de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (107,'PCG99-BASE','CAPIT', 'XXXXXX', '106', '103', 'Réserves', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (108,'PCG99-BASE','CAPIT', 'XXXXXX', '107', '103', 'Ecart d''equivalence', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (109,'PCG99-BASE','CAPIT', 'XXXXXX', '108', '103', 'Compte de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (110,'PCG99-BASE','CAPIT', 'XXXXXX', '109', '103', 'Actionnaires : capital souscrit - non appelé', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (111,'PCG99-BASE','CAPIT', 'XXXXXX', '11','1501', 'Report à nouveau (solde créditeur ou débiteur)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (112,'PCG99-BASE','CAPIT', 'XXXXXX', '110', '111', 'Report à nouveau (solde créditeur)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (113,'PCG99-BASE','CAPIT', 'XXXXXX', '119', '111', 'Report à nouveau (solde débiteur)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (114,'PCG99-BASE','CAPIT', 'XXXXXX', '12','1501', 'Résultat de l''exercice (bénéfice ou perte)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (115,'PCG99-BASE','CAPIT', 'XXXXXX', '120', '114', 'Résultat de l''exercice (bénéfice)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (116,'PCG99-BASE','CAPIT', 'XXXXXX', '129', '114', 'Résultat de l''exercice (perte)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (117,'PCG99-BASE','CAPIT', 'XXXXXX', '13','1501', 'Subventions d''investissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (118,'PCG99-BASE','CAPIT', 'XXXXXX', '131', '117', 'Subventions d''équipement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (119,'PCG99-BASE','CAPIT', 'XXXXXX', '138', '117', 'Autres subventions d''investissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (120,'PCG99-BASE','CAPIT', 'XXXXXX', '139', '117', 'Subventions d''investissement inscrites au compte de résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (121,'PCG99-BASE','CAPIT', 'XXXXXX', '14','1501', 'Provisions réglementées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (122,'PCG99-BASE','CAPIT', 'XXXXXX', '142', '121', 'Provisions réglementées relatives aux immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (123,'PCG99-BASE','CAPIT', 'XXXXXX', '143', '121', 'Provisions réglementées relatives aux stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (124,'PCG99-BASE','CAPIT', 'XXXXXX', '144', '121', 'Provisions réglementées relatives aux autres éléments de l''actif', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (125,'PCG99-BASE','CAPIT', 'XXXXXX', '145', '121', 'Amortissements dérogatoires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (126,'PCG99-BASE','CAPIT', 'XXXXXX', '146', '121', 'Provision spéciale de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (127,'PCG99-BASE','CAPIT', 'XXXXXX', '147', '121', 'Plus-values réinvesties', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (128,'PCG99-BASE','CAPIT', 'XXXXXX', '148', '121', 'Autres provisions réglementées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (129,'PCG99-BASE','CAPIT', 'XXXXXX', '15','1501', 'Provisions pour risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (130,'PCG99-BASE','CAPIT', 'XXXXXX', '151', '129', 'Provisions pour risques', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (131,'PCG99-BASE','CAPIT', 'XXXXXX', '153', '129', 'Provisions pour pensions et obligations similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (132,'PCG99-BASE','CAPIT', 'XXXXXX', '154', '129', 'Provisions pour restructurations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (133,'PCG99-BASE','CAPIT', 'XXXXXX', '155', '129', 'Provisions pour impôts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (134,'PCG99-BASE','CAPIT', 'XXXXXX', '156', '129', 'Provisions pour renouvellement des immobilisations (entreprises concessionnaires)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (135,'PCG99-BASE','CAPIT', 'XXXXXX', '157', '129', 'Provisions pour charges à répartir sur plusieurs exercices', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (136,'PCG99-BASE','CAPIT', 'XXXXXX', '158', '129', 'Autres provisions pour charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (137,'PCG99-BASE','CAPIT', 'XXXXXX', '16','1501', 'Emprunts et dettes assimilees', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (138,'PCG99-BASE','CAPIT', 'XXXXXX', '161', '137', 'Emprunts obligataires convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (139,'PCG99-BASE','CAPIT', 'XXXXXX', '163', '137', 'Autres emprunts obligataires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (140,'PCG99-BASE','CAPIT', 'XXXXXX', '164', '137', 'Emprunts auprès des établissements de crédit', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (141,'PCG99-BASE','CAPIT', 'XXXXXX', '165', '137', 'Dépôts et cautionnements reçus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (142,'PCG99-BASE','CAPIT', 'XXXXXX', '166', '137', 'Participation des salariés aux résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (143,'PCG99-BASE','CAPIT', 'XXXXXX', '167', '137', 'Emprunts et dettes assortis de conditions particulières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (144,'PCG99-BASE','CAPIT', 'XXXXXX', '168', '137', 'Autres emprunts et dettes assimilées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (145,'PCG99-BASE','CAPIT', 'XXXXXX', '169', '137', 'Primes de remboursement des obligations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (146,'PCG99-BASE','CAPIT', 'XXXXXX', '17','1501', 'Dettes rattachées à des participations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (147,'PCG99-BASE','CAPIT', 'XXXXXX', '171', '146', 'Dettes rattachées à des participations (groupe)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (148,'PCG99-BASE','CAPIT', 'XXXXXX', '174', '146', 'Dettes rattachées à des participations (hors groupe)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (149,'PCG99-BASE','CAPIT', 'XXXXXX', '178', '146', 'Dettes rattachées à des sociétés en participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (150,'PCG99-BASE','CAPIT', 'XXXXXX', '18','1501', 'Comptes de liaison des établissements et sociétés en participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (151,'PCG99-BASE','CAPIT', 'XXXXXX', '181', '150', 'Comptes de liaison des établissements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (152,'PCG99-BASE','CAPIT', 'XXXXXX', '186', '150', 'Biens et prestations de services échangés entre établissements (charges)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (153,'PCG99-BASE','CAPIT', 'XXXXXX', '187', '150', 'Biens et prestations de services échangés entre établissements (produits)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (154,'PCG99-BASE','CAPIT', 'XXXXXX', '188', '150', 'Comptes de liaison des sociétés en participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (155,'PCG99-BASE','IMMO', 'XXXXXX', '20','1502', 'Immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (156,'PCG99-BASE','IMMO', 'XXXXXX', '201', '155', 'Frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (157,'PCG99-BASE','IMMO', 'XXXXXX', '203', '155', 'Frais de recherche et de développement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (158,'PCG99-BASE','IMMO', 'XXXXXX', '205', '155', 'Concessions et droits similaires, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (159,'PCG99-BASE','IMMO', 'XXXXXX', '206', '155', 'Droit au bail', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (160,'PCG99-BASE','IMMO', 'XXXXXX', '207', '155', 'Fonds commercial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (161,'PCG99-BASE','IMMO', 'XXXXXX', '208', '155', 'Autres immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (162,'PCG99-BASE','IMMO', 'XXXXXX', '21','1502', 'Immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (163,'PCG99-BASE','IMMO', 'XXXXXX', '211', '162', 'Terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (164,'PCG99-BASE','IMMO', 'XXXXXX', '212', '162', 'Agencements et aménagements de terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (165,'PCG99-BASE','IMMO', 'XXXXXX', '213', '162', 'Constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (166,'PCG99-BASE','IMMO', 'XXXXXX', '214', '162', 'Constructions sur sol d''autrui', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (167,'PCG99-BASE','IMMO', 'XXXXXX', '215', '162', 'Installations techniques, matériels et outillage industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (168,'PCG99-BASE','IMMO', 'XXXXXX', '218', '162', 'Autres immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (169,'PCG99-BASE','IMMO', 'XXXXXX', '22','1502', 'Immobilisations mises en concession', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (170,'PCG99-BASE','IMMO', 'XXXXXX', '23','1502', 'Immobilisations en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (171,'PCG99-BASE','IMMO', 'XXXXXX', '231', '170', 'Immobilisations corporelles en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (172,'PCG99-BASE','IMMO', 'XXXXXX', '232', '170', 'Immobilisations incorporelles en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (173,'PCG99-BASE','IMMO', 'XXXXXX', '237', '170', 'Avances et acomptes versés sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (174,'PCG99-BASE','IMMO', 'XXXXXX', '238', '170', 'Avances et acomptes versés sur commandes d''immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (175,'PCG99-BASE','IMMO', 'XXXXXX', '25','1502', 'Parts dans des entreprises liées et créances sur des entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (176,'PCG99-BASE','IMMO', 'XXXXXX', '26','1502', 'Participations et créances rattachées à des participations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (177,'PCG99-BASE','IMMO', 'XXXXXX', '261', '176', 'Titres de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (178,'PCG99-BASE','IMMO', 'XXXXXX', '266', '176', 'Autres formes de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (179,'PCG99-BASE','IMMO', 'XXXXXX', '267', '176', 'Créances rattachées à des participations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (180,'PCG99-BASE','IMMO', 'XXXXXX', '268', '176', 'Créances rattachées à des sociétés en participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (181,'PCG99-BASE','IMMO', 'XXXXXX', '269', '176', 'Versements restant à effectuer sur titres de participation non libérés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (182,'PCG99-BASE','IMMO', 'XXXXXX', '27','1502', 'Autres immobilisations financieres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (183,'PCG99-BASE','IMMO', 'XXXXXX', '271', '183', 'Titres immobilisés autres que les titres immobilisés de l''activité de portefeuille (droit de propriété)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (184,'PCG99-BASE','IMMO', 'XXXXXX', '272', '183', 'Titres immobilisés (droit de créance)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (185,'PCG99-BASE','IMMO', 'XXXXXX', '273', '183', 'Titres immobilisés de l''activité de portefeuille', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (186,'PCG99-BASE','IMMO', 'XXXXXX', '274', '183', 'Prêts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (187,'PCG99-BASE','IMMO', 'XXXXXX', '275', '183', 'Dépôts et cautionnements versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (188,'PCG99-BASE','IMMO', 'XXXXXX', '276', '183', 'Autres créances immobilisées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (189,'PCG99-BASE','IMMO', 'XXXXXX', '277', '183', '(Actions propres ou parts propres)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (190,'PCG99-BASE','IMMO', 'XXXXXX', '279', '183', 'Versements restant à effectuer sur titres immobilisés non libérés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (191,'PCG99-BASE','IMMO', 'XXXXXX', '28','1502', 'Amortissements des immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (192,'PCG99-BASE','IMMO', 'XXXXXX', '280', '191', 'Amortissements des immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (193,'PCG99-BASE','IMMO', 'XXXXXX', '281', '191', 'Amortissements des immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (194,'PCG99-BASE','IMMO', 'XXXXXX', '282', '191', 'Amortissements des immobilisations mises en concession', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (195,'PCG99-BASE','IMMO', 'XXXXXX', '29','1502', 'Dépréciations des immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (196,'PCG99-BASE','IMMO', 'XXXXXX', '290', '195', 'Dépréciations des immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (197,'PCG99-BASE','IMMO', 'XXXXXX', '291', '195', 'Dépréciations des immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (198,'PCG99-BASE','IMMO', 'XXXXXX', '292', '195', 'Dépréciations des immobilisations mises en concession', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (199,'PCG99-BASE','IMMO', 'XXXXXX', '293', '195', 'Dépréciations des immobilisations en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (200,'PCG99-BASE','IMMO', 'XXXXXX', '296', '195', 'Provisions pour dépréciation des participations et créances rattachées à des participations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (201,'PCG99-BASE','IMMO', 'XXXXXX', '297', '195', 'Provisions pour dépréciation des autres immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (202,'PCG99-BASE','STOCK', 'XXXXXX', '31','1503', 'Matières premières (et fournitures)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (203,'PCG99-BASE','STOCK', 'XXXXXX', '311', '202', 'Matières (ou groupe) A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (204,'PCG99-BASE','STOCK', 'XXXXXX', '312', '202', 'Matières (ou groupe) B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (205,'PCG99-BASE','STOCK', 'XXXXXX', '317', '202', 'Fournitures A, B, C,', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (206,'PCG99-BASE','STOCK', 'XXXXXX', '32','1503', 'Autres approvisionnements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (207,'PCG99-BASE','STOCK', 'XXXXXX', '321', '206', 'Matières consommables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (208,'PCG99-BASE','STOCK', 'XXXXXX', '322', '206', 'Fournitures consommables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (209,'PCG99-BASE','STOCK', 'XXXXXX', '326', '206', 'Emballages', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (210,'PCG99-BASE','STOCK', 'XXXXXX', '33','1503', 'En-cours de production de biens', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (211,'PCG99-BASE','STOCK', 'XXXXXX', '331', '210', 'Produits en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (212,'PCG99-BASE','STOCK', 'XXXXXX', '335', '210', 'Travaux en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (213,'PCG99-BASE','STOCK', 'XXXXXX', '34','1503', 'En-cours de production de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (214,'PCG99-BASE','STOCK', 'XXXXXX', '341', '213', 'Etudes en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (215,'PCG99-BASE','STOCK', 'XXXXXX', '345', '213', 'Prestations de services en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (216,'PCG99-BASE','STOCK', 'XXXXXX', '35','1503', 'Stocks de produits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (217,'PCG99-BASE','STOCK', 'XXXXXX', '351', '216', 'Produits intermédiaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (218,'PCG99-BASE','STOCK', 'XXXXXX', '355', '216', 'Produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (219,'PCG99-BASE','STOCK', 'XXXXXX', '358', '216', 'Produits résiduels (ou matières de récupération)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (220,'PCG99-BASE','STOCK', 'XXXXXX', '37','1503', 'Stocks de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (221,'PCG99-BASE','STOCK', 'XXXXXX', '371', '220', 'Marchandises (ou groupe) A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (222,'PCG99-BASE','STOCK', 'XXXXXX', '372', '220', 'Marchandises (ou groupe) B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (223,'PCG99-BASE','STOCK', 'XXXXXX', '39','1503', 'Provisions pour dépréciation des stocks et en-cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (224,'PCG99-BASE','STOCK', 'XXXXXX', '391', '223', 'Provisions pour dépréciation des matières premières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (225,'PCG99-BASE','STOCK', 'XXXXXX', '392', '223', 'Provisions pour dépréciation des autres approvisionnements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (226,'PCG99-BASE','STOCK', 'XXXXXX', '393', '223', 'Provisions pour dépréciation des en-cours de production de biens', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (227,'PCG99-BASE','STOCK', 'XXXXXX', '394', '223', 'Provisions pour dépréciation des en-cours de production de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (228,'PCG99-BASE','STOCK', 'XXXXXX', '395', '223', 'Provisions pour dépréciation des stocks de produits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (229,'PCG99-BASE','STOCK', 'XXXXXX', '397', '223', 'Provisions pour dépréciation des stocks de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (230,'PCG99-BASE','TIERS', 'XXXXXX', '40','1504', 'Fournisseurs et Comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (231,'PCG99-BASE','TIERS', 'XXXXXX', '400', '230', 'Fournisseurs et Comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (232,'PCG99-BASE','TIERS', 'SUPPLIER','401', '230', 'Fournisseurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (233,'PCG99-BASE','TIERS', 'XXXXXX', '403', '230', 'Fournisseurs - Effets à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (234,'PCG99-BASE','TIERS', 'XXXXXX', '404', '230', 'Fournisseurs d''immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (235,'PCG99-BASE','TIERS', 'XXXXXX', '405', '230', 'Fournisseurs d''immobilisations - Effets à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (236,'PCG99-BASE','TIERS', 'XXXXXX', '408', '230', 'Fournisseurs - Factures non parvenues', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (237,'PCG99-BASE','TIERS', 'XXXXXX', '409', '230', 'Fournisseurs débiteurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (238,'PCG99-BASE','TIERS', 'XXXXXX', '41','1504', 'Clients et comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (239,'PCG99-BASE','TIERS', 'XXXXXX', '410', '238', 'Clients et Comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (240,'PCG99-BASE','TIERS', 'CUSTOMER','411', '238', 'Clients', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (241,'PCG99-BASE','TIERS', 'XXXXXX', '413', '238', 'Clients - Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (242,'PCG99-BASE','TIERS', 'XXXXXX', '416', '238', 'Clients douteux ou litigieux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (243,'PCG99-BASE','TIERS', 'XXXXXX', '418', '238', 'Clients - Produits non encore facturés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (244,'PCG99-BASE','TIERS', 'XXXXXX', '419', '238', 'Clients créditeurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (245,'PCG99-BASE','TIERS', 'XXXXXX', '42','1504', 'Personnel et comptes rattachés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (246,'PCG99-BASE','TIERS', 'XXXXXX', '421', '245', 'Personnel - Rémunérations dues', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (247,'PCG99-BASE','TIERS', 'XXXXXX', '422', '245', 'Comités d''entreprises, d''établissement, ...', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (248,'PCG99-BASE','TIERS', 'XXXXXX', '424', '245', 'Participation des salariés aux résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (249,'PCG99-BASE','TIERS', 'XXXXXX', '425', '245', 'Personnel - Avances et acomptes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (250,'PCG99-BASE','TIERS', 'XXXXXX', '426', '245', 'Personnel - Dépôts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (251,'PCG99-BASE','TIERS', 'XXXXXX', '427', '245', 'Personnel - Oppositions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (252,'PCG99-BASE','TIERS', 'XXXXXX', '428', '245', 'Personnel - Charges à payer et produits à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (253,'PCG99-BASE','TIERS', 'XXXXXX', '43','1504', 'Sécurité sociale et autres organismes sociaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (254,'PCG99-BASE','TIERS', 'XXXXXX', '431', '253', 'Sécurité sociale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (255,'PCG99-BASE','TIERS', 'XXXXXX', '437', '253', 'Autres organismes sociaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (256,'PCG99-BASE','TIERS', 'XXXXXX', '438', '253', 'Organismes sociaux - Charges à payer et produits à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (257,'PCG99-BASE','TIERS', 'XXXXXX', '44','1504', 'État et autres collectivités publiques', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (258,'PCG99-BASE','TIERS', 'XXXXXX', '441', '257', 'État - Subventions à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (259,'PCG99-BASE','TIERS', 'XXXXXX', '442', '257', 'Etat - Impôts et taxes recouvrables sur des tiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (260,'PCG99-BASE','TIERS', 'XXXXXX', '443', '257', 'Opérations particulières avec l''Etat, les collectivités publiques, les organismes internationaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (261,'PCG99-BASE','TIERS', 'XXXXXX', '444', '257', 'Etat - Impôts sur les bénéfices', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (262,'PCG99-BASE','TIERS', 'XXXXXX', '445', '257', 'Etat - Taxes sur le chiffre d''affaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (263,'PCG99-BASE','TIERS', 'XXXXXX', '446', '257', 'Obligations cautionnées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (264,'PCG99-BASE','TIERS', 'XXXXXX', '447', '257', 'Autres impôts, taxes et versements assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (265,'PCG99-BASE','TIERS', 'XXXXXX', '448', '257', 'Etat - Charges à payer et produits à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (266,'PCG99-BASE','TIERS', 'XXXXXX', '449', '257', 'Quotas d''émission à restituer à l''Etat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (267,'PCG99-BASE','TIERS', 'XXXXXX', '45','1504', 'Groupe et associes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (268,'PCG99-BASE','TIERS', 'XXXXXX', '451', '267', 'Groupe', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (269,'PCG99-BASE','TIERS', 'XXXXXX', '455', '267', 'Associés - Comptes courants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (270,'PCG99-BASE','TIERS', 'XXXXXX', '456', '267', 'Associés - Opérations sur le capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (271,'PCG99-BASE','TIERS', 'XXXXXX', '457', '267', 'Associés - Dividendes à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (272,'PCG99-BASE','TIERS', 'XXXXXX', '458', '267', 'Associés - Opérations faites en commun et en G.I.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (273,'PCG99-BASE','TIERS', 'XXXXXX', '46','1504', 'Débiteurs divers et créditeurs divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (274,'PCG99-BASE','TIERS', 'XXXXXX', '462', '273', 'Créances sur cessions d''immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (275,'PCG99-BASE','TIERS', 'XXXXXX', '464', '273', 'Dettes sur acquisitions de valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (276,'PCG99-BASE','TIERS', 'XXXXXX', '465', '273', 'Créances sur cessions de valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (277,'PCG99-BASE','TIERS', 'XXXXXX', '467', '273', 'Autres comptes débiteurs ou créditeurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (278,'PCG99-BASE','TIERS', 'XXXXXX', '468', '273', 'Divers - Charges à payer et produits à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (279,'PCG99-BASE','TIERS', 'XXXXXX', '47','1504', 'Comptes transitoires ou d''attente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (280,'PCG99-BASE','TIERS', 'XXXXXX', '471', '279', 'Comptes d''attente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (281,'PCG99-BASE','TIERS', 'XXXXXX', '476', '279', 'Différence de conversion - Actif', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (282,'PCG99-BASE','TIERS', 'XXXXXX', '477', '279', 'Différences de conversion - Passif', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (283,'PCG99-BASE','TIERS', 'XXXXXX', '478', '279', 'Autres comptes transitoires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (284,'PCG99-BASE','TIERS', 'XXXXXX', '48','1504', 'Comptes de régularisation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (285,'PCG99-BASE','TIERS', 'XXXXXX', '481', '284', 'Charges à répartir sur plusieurs exercices', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (286,'PCG99-BASE','TIERS', 'XXXXXX', '486', '284', 'Charges constatées d''avance', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (287,'PCG99-BASE','TIERS', 'XXXXXX', '487', '284', 'Produits constatés d''avance', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (288,'PCG99-BASE','TIERS', 'XXXXXX', '488', '284', 'Comptes de répartition périodique des charges et des produits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (289,'PCG99-BASE','TIERS', 'XXXXXX', '489', '284', 'Quotas d''émission alloués par l''Etat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (290,'PCG99-BASE','TIERS', 'XXXXXX', '49','1504', 'Provisions pour dépréciation des comptes de tiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (291,'PCG99-BASE','TIERS', 'XXXXXX', '491', '290', 'Provisions pour dépréciation des comptes de clients', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (292,'PCG99-BASE','TIERS', 'XXXXXX', '495', '290', 'Provisions pour dépréciation des comptes du groupe et des associés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (293,'PCG99-BASE','TIERS', 'XXXXXX', '496', '290', 'Provisions pour dépréciation des comptes de débiteurs divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (294,'PCG99-BASE','FINAN', 'XXXXXX', '50','1505', 'Valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (295,'PCG99-BASE','FINAN', 'XXXXXX', '501', '294', 'Parts dans des entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (296,'PCG99-BASE','FINAN', 'XXXXXX', '502', '294', 'Actions propres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (297,'PCG99-BASE','FINAN', 'XXXXXX', '503', '294', 'Actions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (298,'PCG99-BASE','FINAN', 'XXXXXX', '504', '294', 'Autres titres conférant un droit de propriété', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (299,'PCG99-BASE','FINAN', 'XXXXXX', '505', '294', 'Obligations et bons émis par la société et rachetés par elle', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (300,'PCG99-BASE','FINAN', 'XXXXXX', '506', '294', 'Obligations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (301,'PCG99-BASE','FINAN', 'XXXXXX', '507', '294', 'Bons du Trésor et bons de caisse à court terme', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (302,'PCG99-BASE','FINAN', 'XXXXXX', '508', '294', 'Autres valeurs mobilières de placement et autres créances assimilées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (303,'PCG99-BASE','FINAN', 'XXXXXX', '509', '294', 'Versements restant à effectuer sur valeurs mobilières de placement non libérées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (304,'PCG99-BASE','FINAN', 'XXXXXX', '51','1505', 'Banques, établissements financiers et assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (305,'PCG99-BASE','FINAN', 'XXXXXX', '511', '304', 'Valeurs à l''encaissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (306,'PCG99-BASE','FINAN', 'BANK', '512', '304', 'Banques', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (307,'PCG99-BASE','FINAN', 'XXXXXX', '514', '304', 'Chèques postaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (308,'PCG99-BASE','FINAN', 'XXXXXX', '515', '304', '"Caisses" du Trésor et des établissements publics', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (309,'PCG99-BASE','FINAN', 'XXXXXX', '516', '304', 'Sociétés de bourse', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (310,'PCG99-BASE','FINAN', 'XXXXXX', '517', '304', 'Autres organismes financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (311,'PCG99-BASE','FINAN', 'XXXXXX', '518', '304', 'Intérêts courus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (312,'PCG99-BASE','FINAN', 'XXXXXX', '519', '304', 'Concours bancaires courants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (313,'PCG99-BASE','FINAN', 'XXXXXX', '52','1505', 'Instruments de trésorerie', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (314,'PCG99-BASE','FINAN', 'CASH', '53','1505', 'Caisse', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (315,'PCG99-BASE','FINAN', 'XXXXXX', '531', '314', 'Caisse siège social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (316,'PCG99-BASE','FINAN', 'XXXXXX', '532', '314', 'Caisse succursale (ou usine) A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (317,'PCG99-BASE','FINAN', 'XXXXXX', '533', '314', 'Caisse succursale (ou usine) B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (318,'PCG99-BASE','FINAN', 'XXXXXX', '54','1505', 'Régies d''avance et accréditifs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (319,'PCG99-BASE','FINAN', 'XXXXXX', '58','1505', 'Virements internes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (320,'PCG99-BASE','FINAN', 'XXXXXX', '59','1505', 'Provisions pour dépréciation des comptes financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (321,'PCG99-BASE','FINAN', 'XXXXXX', '590', '320', 'Provisions pour dépréciation des valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (322,'PCG99-BASE','CHARGE','PRODUCT', '60','1506', 'Achats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (323,'PCG99-BASE','CHARGE','XXXXXX', '601', '322', 'Achats stockés - Matières premières (et fournitures)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (324,'PCG99-BASE','CHARGE','XXXXXX', '602', '322', 'Achats stockés - Autres approvisionnements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (325,'PCG99-BASE','CHARGE','XXXXXX', '603', '322', 'Variations des stocks (approvisionnements et marchandises)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (326,'PCG99-BASE','CHARGE','XXXXXX', '604', '322', 'Achats stockés - Matières premières (et fournitures)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (327,'PCG99-BASE','CHARGE','XXXXXX', '605', '322', 'Achats de matériel, équipements et travaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (328,'PCG99-BASE','CHARGE','XXXXXX', '606', '322', 'Achats non stockés de matière et fournitures', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (329,'PCG99-BASE','CHARGE','XXXXXX', '607', '322', 'Achats de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (330,'PCG99-BASE','CHARGE','XXXXXX', '608', '322', '(Compte réservé, le cas échéant, à la récapitulation des frais accessoires incorporés aux achats)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (331,'PCG99-BASE','CHARGE','XXXXXX', '609', '322', 'Rabais, remises et ristournes obtenus sur achats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (332,'PCG99-BASE','CHARGE','SERVICE', '61','1506', 'Services extérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (333,'PCG99-BASE','CHARGE','XXXXXX', '611', '332', 'Sous-traitance générale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (334,'PCG99-BASE','CHARGE','XXXXXX', '612', '332', 'Redevances de crédit-bail', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (335,'PCG99-BASE','CHARGE','XXXXXX', '613', '332', 'Locations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (336,'PCG99-BASE','CHARGE','XXXXXX', '614', '332', 'Charges locatives et de copropriété', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (337,'PCG99-BASE','CHARGE','XXXXXX', '615', '332', 'Entretien et réparations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (338,'PCG99-BASE','CHARGE','XXXXXX', '616', '332', 'Primes d''assurances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (339,'PCG99-BASE','CHARGE','XXXXXX', '617', '332', 'Etudes et recherches', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (340,'PCG99-BASE','CHARGE','XXXXXX', '618', '332', 'Divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (341,'PCG99-BASE','CHARGE','XXXXXX', '619', '332', 'Rabais, remises et ristournes obtenus sur services extérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (342,'PCG99-BASE','CHARGE','XXXXXX', '62','1506', 'Autres services extérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (343,'PCG99-BASE','CHARGE','XXXXXX', '621', '342', 'Personnel extérieur à l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (344,'PCG99-BASE','CHARGE','XXXXXX', '622', '342', 'Rémunérations d''intermédiaires et honoraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (345,'PCG99-BASE','CHARGE','XXXXXX', '623', '342', 'Publicité, publications, relations publiques', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (346,'PCG99-BASE','CHARGE','XXXXXX', '624', '342', 'Transports de biens et transports collectifs du personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (347,'PCG99-BASE','CHARGE','XXXXXX', '625', '342', 'Déplacements, missions et réceptions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (348,'PCG99-BASE','CHARGE','XXXXXX', '626', '342', 'Frais postaux et de télécommunications', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (349,'PCG99-BASE','CHARGE','XXXXXX', '627', '342', 'Services bancaires et assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (350,'PCG99-BASE','CHARGE','XXXXXX', '628', '342', 'Divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (351,'PCG99-BASE','CHARGE','XXXXXX', '629', '342', 'Rabais, remises et ristournes obtenus sur autres services extérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (352,'PCG99-BASE','CHARGE','XXXXXX', '63','1506', 'Impôts, taxes et versements assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (353,'PCG99-BASE','CHARGE','XXXXXX', '631', '352', 'Impôts, taxes et versements assimilés sur rémunérations (administrations des impôts)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (354,'PCG99-BASE','CHARGE','XXXXXX', '633', '352', 'Impôts, taxes et versements assimilés sur rémunérations (autres organismes)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (355,'PCG99-BASE','CHARGE','XXXXXX', '635', '352', 'Autres impôts, taxes et versements assimilés (administrations des impôts)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (356,'PCG99-BASE','CHARGE','XXXXXX', '637', '352', 'Autres impôts, taxes et versements assimilés (autres organismes)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (357,'PCG99-BASE','CHARGE','XXXXXX', '64','1506', 'Charges de personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (358,'PCG99-BASE','CHARGE','XXXXXX', '641', '357', 'Rémunérations du personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (359,'PCG99-BASE','CHARGE','XXXXXX', '644', '357', 'Rémunération du travail de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (360,'PCG99-BASE','CHARGE','SOCIAL', '645', '357', 'Charges de sécurité sociale et de prévoyance', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (361,'PCG99-BASE','CHARGE','XXXXXX', '646', '357', 'Cotisations sociales personnelles de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (362,'PCG99-BASE','CHARGE','XXXXXX', '647', '357', 'Autres charges sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (363,'PCG99-BASE','CHARGE','XXXXXX', '648', '357', 'Autres charges de personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (364,'PCG99-BASE','CHARGE','XXXXXX', '65','1506', 'Autres charges de gestion courante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (365,'PCG99-BASE','CHARGE','XXXXXX', '651', '364', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (366,'PCG99-BASE','CHARGE','XXXXXX', '653', '364', 'Jetons de présence', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (367,'PCG99-BASE','CHARGE','XXXXXX', '654', '364', 'Pertes sur créances irrécouvrables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (368,'PCG99-BASE','CHARGE','XXXXXX', '655', '364', 'Quote-part de résultat sur opérations faites en commun', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (369,'PCG99-BASE','CHARGE','XXXXXX', '658', '364', 'Charges diverses de gestion courante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (370,'PCG99-BASE','CHARGE','XXXXXX', '66','1506', 'Charges financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (371,'PCG99-BASE','CHARGE','XXXXXX', '661', '370', 'Charges d''intérêts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (372,'PCG99-BASE','CHARGE','XXXXXX', '664', '370', 'Pertes sur créances liées à des participations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (373,'PCG99-BASE','CHARGE','XXXXXX', '665', '370', 'Escomptes accordés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (374,'PCG99-BASE','CHARGE','XXXXXX', '666', '370', 'Pertes de change', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (375,'PCG99-BASE','CHARGE','XXXXXX', '667', '370', 'Charges nettes sur cessions de valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (376,'PCG99-BASE','CHARGE','XXXXXX', '668', '370', 'Autres charges financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (377,'PCG99-BASE','CHARGE','XXXXXX', '67','1506', 'Charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (378,'PCG99-BASE','CHARGE','XXXXXX', '671', '377', 'Charges exceptionnelles sur opérations de gestion', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (379,'PCG99-BASE','CHARGE','XXXXXX', '672', '377', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les charges sur exercices antérieurs)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (380,'PCG99-BASE','CHARGE','XXXXXX', '675', '377', 'Valeurs comptables des éléments d''actif cédés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (381,'PCG99-BASE','CHARGE','XXXXXX', '678', '377', 'Autres charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (382,'PCG99-BASE','CHARGE','XXXXXX', '68','1506', 'Dotations aux amortissements et aux provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (383,'PCG99-BASE','CHARGE','XXXXXX', '681', '382', 'Dotations aux amortissements et aux provisions - Charges d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (384,'PCG99-BASE','CHARGE','XXXXXX', '686', '382', 'Dotations aux amortissements et aux provisions - Charges financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (385,'PCG99-BASE','CHARGE','XXXXXX', '687', '382', 'Dotations aux amortissements et aux provisions - Charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (386,'PCG99-BASE','CHARGE','XXXXXX', '69','1506', 'Participation des salariés - impôts sur les bénéfices et assimiles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (387,'PCG99-BASE','CHARGE','XXXXXX', '691', '386', 'Participation des salariés aux résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (388,'PCG99-BASE','CHARGE','XXXXXX', '695', '386', 'Impôts sur les bénéfices', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (389,'PCG99-BASE','CHARGE','XXXXXX', '696', '386', 'Suppléments d''impôt sur les sociétés liés aux distributions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (390,'PCG99-BASE','CHARGE','XXXXXX', '697', '386', 'Imposition forfaitaire annuelle des sociétés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (391,'PCG99-BASE','CHARGE','XXXXXX', '698', '386', 'Intégration fiscale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (392,'PCG99-BASE','CHARGE','XXXXXX', '699', '386', 'Produits - Reports en arrière des déficits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (393,'PCG99-BASE','PROD', 'XXXXXX', '70','1507', 'Ventes de produits fabriqués, prestations de services, marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (394,'PCG99-BASE','PROD', 'PRODUCT', '701', '393', 'Ventes de produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (395,'PCG99-BASE','PROD', 'XXXXXX', '702', '393', 'Ventes de produits intermédiaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (396,'PCG99-BASE','PROD', 'XXXXXX', '703', '393', 'Ventes de produits résiduels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (397,'PCG99-BASE','PROD', 'XXXXXX', '704', '393', 'Travaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (398,'PCG99-BASE','PROD', 'XXXXXX', '705', '393', 'Etudes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (399,'PCG99-BASE','PROD', 'SERVICE', '706', '393', 'Prestations de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (400,'PCG99-BASE','PROD', 'PRODUCT', '707', '393', 'Ventes de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (401,'PCG99-BASE','PROD', 'PRODUCT', '708', '393', 'Produits des activités annexes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (402,'PCG99-BASE','PROD', 'XXXXXX', '709', '393', 'Rabais, remises et ristournes accordés par l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (403,'PCG99-BASE','PROD', 'XXXXXX', '71','1507', 'Production stockée (ou déstockage)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (404,'PCG99-BASE','PROD', 'XXXXXX', '713', '403', 'Variation des stocks (en-cours de production, produits)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (405,'PCG99-BASE','PROD', 'XXXXXX', '72','1507', 'Production immobilisée', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (406,'PCG99-BASE','PROD', 'XXXXXX', '721', '405', 'Immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (407,'PCG99-BASE','PROD', 'XXXXXX', '722', '405', 'Immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (408,'PCG99-BASE','PROD', 'XXXXXX', '74','1507', 'Subventions d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (409,'PCG99-BASE','PROD', 'XXXXXX', '75','1507', 'Autres produits de gestion courante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (410,'PCG99-BASE','PROD', 'XXXXXX', '751', '409', 'Redevances pour concessions, brevets, licences, marques, procédés, logiciels, droits et valeurs similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (411,'PCG99-BASE','PROD', 'XXXXXX', '752', '409', 'Revenus des immeubles non affectés à des activités professionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (412,'PCG99-BASE','PROD', 'XXXXXX', '753', '409', 'Jetons de présence et rémunérations d''administrateurs, gérants,...', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (413,'PCG99-BASE','PROD', 'XXXXXX', '754', '409', 'Ristournes perçues des coopératives (provenant des excédents)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (414,'PCG99-BASE','PROD', 'XXXXXX', '755', '409', 'Quotes-parts de résultat sur opérations faites en commun', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (415,'PCG99-BASE','PROD', 'XXXXXX', '758', '409', 'Produits divers de gestion courante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (416,'PCG99-BASE','PROD', 'XXXXXX', '76','1507', 'Produits financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (417,'PCG99-BASE','PROD', 'XXXXXX', '761', '416', 'Produits de participations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (418,'PCG99-BASE','PROD', 'XXXXXX', '762', '416', 'Produits des autres immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (419,'PCG99-BASE','PROD', 'XXXXXX', '763', '416', 'Revenus des autres créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (420,'PCG99-BASE','PROD', 'XXXXXX', '764', '416', 'Revenus des valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (421,'PCG99-BASE','PROD', 'XXXXXX', '765', '416', 'Escomptes obtenus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (422,'PCG99-BASE','PROD', 'XXXXXX', '766', '416', 'Gains de change', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (423,'PCG99-BASE','PROD', 'XXXXXX', '767', '416', 'Produits nets sur cessions de valeurs mobilières de placement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (424,'PCG99-BASE','PROD', 'XXXXXX', '768', '416', 'Autres produits financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (425,'PCG99-BASE','PROD', 'XXXXXX', '77','1507', 'Produits exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (426,'PCG99-BASE','PROD', 'XXXXXX', '771', '425', 'Produits exceptionnels sur opérations de gestion', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (427,'PCG99-BASE','PROD', 'XXXXXX', '772', '425', '(Compte à la disposition des entités pour enregistrer, en cours d''exercice, les produits sur exercices antérieurs)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (428,'PCG99-BASE','PROD', 'XXXXXX', '775', '425', 'Produits des cessions d''éléments d''actif', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (429,'PCG99-BASE','PROD', 'XXXXXX', '777', '425', 'Quote-part des subventions d''investissement virée au résultat de l''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (430,'PCG99-BASE','PROD', 'XXXXXX', '778', '425', 'Autres produits exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (431,'PCG99-BASE','PROD', 'XXXXXX', '78','1507', 'Reprises sur amortissements et provisions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (432,'PCG99-BASE','PROD', 'XXXXXX', '781', '431', 'Reprises sur amortissements et provisions (à inscrire dans les produits d''exploitation)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (433,'PCG99-BASE','PROD', 'XXXXXX', '786', '431', 'Reprises sur provisions pour risques (à inscrire dans les produits financiers)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (434,'PCG99-BASE','PROD', 'XXXXXX', '787', '431', 'Reprises sur provisions (à inscrire dans les produits exceptionnels)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (435,'PCG99-BASE','PROD', 'XXXXXX', '79','1507', 'Transferts de charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (436,'PCG99-BASE','PROD', 'XXXXXX', '791', '435', 'Transferts de charges d''exploitation ', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (437,'PCG99-BASE','PROD', 'XXXXXX', '796', '435', 'Transferts de charges financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (438,'PCG99-BASE','PROD', 'XXXXXX', '797', '435', 'Transferts de charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1501,'PCG99-BASE','CAPIT', 'XXXXXX', '1', '', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1502,'PCG99-BASE','IMMO', 'XXXXXX', '2', '', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1503,'PCG99-BASE','STOCK', 'XXXXXX', '3', '', 'Stock et commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1504,'PCG99-BASE','TIERS', 'XXXXXX', '4', '', 'Créances et dettes à un an au plus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1505,'PCG99-BASE','FINAN', 'XXXXXX', '5', '', 'Placement de trésorerie et de valeurs disponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1506,'PCG99-BASE','CHARGE','XXXXXX', '6', '', 'Charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1507,'PCG99-BASE','PROD', 'XXXXXX', '7', '', 'Produits', '1'); -- -- Descriptif des plans comptables BE PCMN-BASE -- INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (3, 'PCMN-BASE', '2', 'The base accountancy belgium plan', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (439, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '10', '1351', 'Capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (440, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '100', '439', 'Capital souscrit ou capital personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (441, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1000', '440', 'Capital non amorti', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (442, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1001', '440', 'Capital amorti', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (443, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '101', '439', 'Capital non appelé', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (444, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '109', '439', 'Compte de l''exploitant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (445, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1090', '444', 'Opérations courantes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (446, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1091', '444', 'Impôts personnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (447, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1092', '444', 'Rémunérations et autres avantages', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (448, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '11', '1351', 'Primes d''émission', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (449, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '12', '1351', 'Plus-values de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (450, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '120', '449', 'Plus-values de réévaluation sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (451, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1200', '450', 'Plus-values de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (452, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1201', '450', 'Reprises de réductions de valeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (453, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '121', '449', 'Plus-values de réévaluation sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (454, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1210', '453', 'Plus-values de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (455, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1211', '453', 'Reprises de réductions de valeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (456, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '122', '449', 'Plus-values de réévaluation sur immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (457, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1220', '456', 'Plus-values de réévaluation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (458, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1221', '456', 'Reprises de réductions de valeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (459, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '123', '449', 'Plus-values de réévaluation sur stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (460, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '124', '449', 'Reprises de réductions de valeur sur placements de trésorerie', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (461, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '13', '1351', 'Réserve', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (462, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '130', '461', 'Réserve légale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (463, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '131', '461', 'Réserves indisponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (464, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1310', '463', 'Réserve pour actions propres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (465, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1311', '463', 'Autres réserves indisponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (466, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '132', '461', 'Réserves immunisées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (467, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '133', '461', 'Réserves disponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (468, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1330', '467', 'Réserve pour régularisation de dividendes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (469, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1331', '467', 'Réserve pour renouvellement des immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (470, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1332', '467', 'Réserve pour installations en faveur du personnel 1333 Réserves libres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (471, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '14', '1351', 'Bénéfice reporté (ou perte reportée)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (472, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '15', '1351', 'Subsides en capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (473, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '150', '472', 'Montants obtenus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (474, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '151', '472', 'Montants transférés aux résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (475, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '16', '1351', 'Provisions pour risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (476, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '160', '475', 'Provisions pour pensions et obligations similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (477, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '161', '475', 'Provisions pour charges fiscales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (478, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '162', '475', 'Provisions pour grosses réparations et gros entretiens', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (479, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '163', '475', 'à 169 Provisions pour autres risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (480, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '164', '475', 'Provisions pour sûretés personnelles ou réelles constituées à l''appui de dettes et d''engagements de tiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (481, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '165', '475', 'Provisions pour engagements relatifs à l''acquisition ou à la cession d''immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (482, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '166', '475', 'Provisions pour exécution de commandes passées ou reçues', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (483, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '167', '475', 'Provisions pour positions et marchés à terme en devises ou positions et marchés à terme en marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (484, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '168', '475', 'Provisions pour garanties techniques attachées aux ventes et prestations déjà effectuées par l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (485, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '169', '475', 'Provisions pour autres risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (486, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1690', '485', 'Pour litiges en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (487, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1691', '485', 'Pour amendes, doubles droits et pénalités', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (488, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1692', '485', 'Pour propre assureur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (489, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1693', '485', 'Pour risques inhérents aux opérations de crédits à moyen ou long terme', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (490, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1695', '485', 'Provision pour charge de liquidation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (491, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1696', '485', 'Provision pour départ de personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (492, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1699', '485', 'Pour risques divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (493, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17', '1351', 'Dettes à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (494, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '170', '493', 'Emprunts subordonnés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (495, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1700', '494', 'Convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (496, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1701', '494', 'Non convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (497, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '171', '493', 'Emprunts obligataires non subordonnés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (498, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1710', '498', 'Convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (499, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1711', '498', 'Non convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (500, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '172', '493', 'Dettes de location-financement et assimilés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (501, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1720', '500', 'Dettes de location-financement de biens immobiliers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (502, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1721', '500', 'Dettes de location-financement de biens mobiliers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (503, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1722', '500', 'Dettes sur droits réels sur immeubles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (504, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '173', '493', 'Etablissements de crédit', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (505, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1730', '504', 'Dettes en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (506, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17300', '505', 'Banque A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (507, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17301', '505', 'Banque B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (508, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17302', '505', 'Banque C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (509, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17303', '505', 'Banque D', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (510, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1731', '504', 'Promesses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (511, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17310', '510', 'Banque A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (512, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17311', '510', 'Banque B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (513, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17312', '510', 'Banque C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (514, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17313', '510', 'Banque D', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (515, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1732', '504', 'Crédits d''acceptation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (516, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17320', '515', 'Banque A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (517, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17321', '515', 'Banque B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (518, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17322', '515', 'Banque C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (519, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17323', '515', 'Banque D', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (520, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '174', '493', 'Autres emprunts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (521, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175', '493', 'Dettes commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (522, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1750', '521', 'Fournisseurs : dettes en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (523, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17500', '522', 'Entreprises apparentées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (524, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175000', '523', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (525, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175001', '523', 'Entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (526, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17501', '522', 'Fournisseurs ordinaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (527, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175010', '526', 'Fournisseurs belges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (528, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175011', '526', 'Fournisseurs C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (529, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175012', '526', 'Fournisseurs importation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (530, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1751', '521', 'Effets à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (531, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17510', '530', 'Entreprises apparentées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (532, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175100', '531', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (533, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175101', '531', 'Entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (534, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '17511', '530', 'Fournisseurs ordinaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (535, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175110', '534', 'Fournisseurs belges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (536, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175111', '534', 'Fournisseurs C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (537, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '175112', '534', 'Fournisseurs importation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (538, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '176', '493', 'Acomptes reçus sur commandes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (539, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '178', '493', 'Cautionnements reçus en numéraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (540, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '179', '493', 'Dettes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (541, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1790', '540', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (542, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1791', '540', 'Autres entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (543, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1792', '540', 'Administrateurs, gérants et associés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (544, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1794', '540', 'Rentes viagères capitalisées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (545, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1798', '540', 'Dettes envers les coparticipants des associations momentanées et en participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (546, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1799', '540', 'Autres dettes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (547, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '18', '1351', 'Comptes de liaison des établissements et succursales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (548, 'PCMN-BASE', 'IMMO', 'XXXXXX', '20', '1352', 'Frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (549, 'PCMN-BASE', 'IMMO', 'XXXXXX', '200', '548', 'Frais de constitution et d''augmentation de capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (550, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2000', '549', 'Frais de constitution et d''augmentation de capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (551, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2009', '549', 'Amortissements sur frais de constitution et d''augmentation de capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (552, 'PCMN-BASE', 'IMMO', 'XXXXXX', '201', '548', 'Frais d''émission d''emprunts et primes de remboursement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (553, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2010', '552', 'Agios sur emprunts et frais d''émission d''emprunts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (554, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2019', '552', 'Amortissements sur agios sur emprunts et frais d''émission d''emprunts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (555, 'PCMN-BASE', 'IMMO', 'XXXXXX', '202', '548', 'Autres frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (556, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2020', '555', 'Autres frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (557, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2029', '555', 'Amortissements sur autres frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (558, 'PCMN-BASE', 'IMMO', 'XXXXXX', '203', '548', 'Intérêts intercalaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (559, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2030', '558', 'Intérêts intercalaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (560, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2039', '558', 'Amortissements sur intérêts intercalaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (561, 'PCMN-BASE', 'IMMO', 'XXXXXX', '204', '548', 'Frais de restructuration', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (562, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2040', '561', 'Coût des frais de restructuration', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (563, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2049', '561', 'Amortissements sur frais de restructuration', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (564, 'PCMN-BASE', 'IMMO', 'XXXXXX', '21', '1352', 'Immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (565, 'PCMN-BASE', 'IMMO', 'XXXXXX', '210', '564', 'Frais de recherche et de développement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (566, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2100', '565', 'Frais de recherche et de mise au point', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (567, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2108', '565', 'Plus-values actées sur frais de recherche et de mise au point', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (568, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2109', '565', 'Amortissements sur frais de recherche et de mise au point', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (569, 'PCMN-BASE', 'IMMO', 'XXXXXX', '211', '564', 'Concessions, brevets, licences, savoir-faire, marque et droits similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (570, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2110', '569', 'Concessions, brevets, licences, marques, etc', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (571, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2118', '569', 'Plus-values actées sur concessions, etc', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (572, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2119', '569', 'Amortissements sur concessions, etc', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (573, 'PCMN-BASE', 'IMMO', 'XXXXXX', '212', '564', 'Goodwill', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (574, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2120', '573', 'Coût d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (575, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2128', '573', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (576, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2129', '573', 'Amortissements sur goodwill', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (577, 'PCMN-BASE', 'IMMO', 'XXXXXX', '213', '564', 'Acomptes versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (578, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22', '1352', 'Terrains et constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (579, 'PCMN-BASE', 'IMMO', 'XXXXXX', '220', '578', 'Terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (580, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2200', '579', 'Terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (581, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2201', '579', 'Frais d''acquisition sur terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (582, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2208', '579', 'Plus-values actées sur terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (583, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2209', '579', 'Amortissements et réductions de valeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (584, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22090', '583', 'Amortissements sur frais d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (585, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22091', '583', 'Réductions de valeur sur terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (586, 'PCMN-BASE', 'IMMO', 'XXXXXX', '221', '578', 'Constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (587, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2210', '586', 'Bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (588, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2211', '586', 'Bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (589, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2212', '586', 'Autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (590, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2213', '586', 'Voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (591, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2215', '586', 'Constructions sur sol d''autrui', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (592, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2216', '586', 'Frais d''acquisition sur constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (593, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2218', '586', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (594, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22180', '593', 'Sur bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (595, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22181', '593', 'Sur bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (596, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22182', '593', 'Sur autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (597, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22184', '593', 'Sur voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (598, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2219', '586', 'Amortissements sur constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (599, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22190', '598', 'Sur bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (600, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22191', '598', 'Sur bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (601, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22192', '598', 'Sur autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (602, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22194', '598', 'Sur voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (603, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22195', '598', 'Sur constructions sur sol d''autrui', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (604, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22196', '598', 'Sur frais d''acquisition sur constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (605, 'PCMN-BASE', 'IMMO', 'XXXXXX', '222', '578', 'Terrains bâtis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (606, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2220', '605', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (607, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22200', '606', 'Bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (608, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22201', '606', 'Bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (609, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22202', '606', 'Autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (610, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22203', '606', 'Voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (611, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22204', '606', 'Frais d''acquisition des terrains à bâtir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (612, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2228', '605', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (613, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22280', '612', 'Sur bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (614, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22281', '612', 'Sur bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (615, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22282', '612', 'Sur autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (616, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22283', '612', 'Sur voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (617, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2229', '605', 'Amortissements sur terrains bâtis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (618, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22290', '617', 'Sur bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (619, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22291', '617', 'Sur bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (620, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22292', '617', 'Sur autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (621, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22293', '617', 'Sur voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (622, 'PCMN-BASE', 'IMMO', 'XXXXXX', '22294', '617', 'Sur frais d''acquisition des terrains bâtis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (623, 'PCMN-BASE', 'IMMO', 'XXXXXX', '223', '578', 'Autres droits réels sur des immeubles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (624, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2230', '623', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (625, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2238', '623', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (626, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2239', '623', 'Amortissements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (627, 'PCMN-BASE', 'IMMO', 'XXXXXX', '23', '1352', 'Installations, machines et outillages', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (628, 'PCMN-BASE', 'IMMO', 'XXXXXX', '230', '627', 'Installations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (629, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2300', '628', 'Installations bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (630, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2301', '628', 'Installations bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (631, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2302', '628', 'Installations bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (632, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2303', '628', 'Installations voies de transport et ouvrages d''art', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (633, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2300', '628', 'Installation d''eau', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (634, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2301', '628', 'Installation d''électricité', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (635, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2302', '628', 'Installation de vapeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (636, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2303', '628', 'Installation de gaz', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (637, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2304', '628', 'Installation de chauffage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (638, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2305', '628', 'Installation de conditionnement d''air', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (639, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2306', '628', 'Installation de chargement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (640, 'PCMN-BASE', 'IMMO', 'XXXXXX', '231', '627', 'Machines', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (641, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2310', '640', 'Division A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (642, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2311', '640', 'Division B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (643, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2312', '640', 'Division C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (644, 'PCMN-BASE', 'IMMO', 'XXXXXX', '237', '627', 'Outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (645, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2370', '644', 'Division A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (646, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2371', '644', 'Division B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (647, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2372', '644', 'Division C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (648, 'PCMN-BASE', 'IMMO', 'XXXXXX', '238', '627', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (649, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2380', '648', 'Sur installations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (650, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2381', '648', 'Sur machines', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (651, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2382', '648', 'Sur outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (652, 'PCMN-BASE', 'IMMO', 'XXXXXX', '239', '627', 'Amortissements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (653, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2390', '652', 'Sur installations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (654, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2391', '652', 'Sur machines', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (655, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2392', '652', 'Sur outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (656, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24', '1352', 'Mobilier et matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (657, 'PCMN-BASE', 'IMMO', 'XXXXXX', '240', '656', 'Mobilier', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (658, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2400', '656', 'Mobilier', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (659, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24000', '658', 'Mobilier des bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (660, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24001', '658', 'Mobilier des bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (661, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24002', '658', 'Mobilier des autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (662, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24003', '658', 'Mobilier oeuvres sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (663, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2401', '657', 'Matériel de bureau et de service social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (664, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24010', '663', 'Des bâtiments industriels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (665, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24011', '663', 'Des bâtiments administratifs et commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (666, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24012', '663', 'Des autres bâtiments d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (667, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24013', '663', 'Des oeuvres sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (668, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2408', '657', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (669, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24080', '668', 'Plus-values actées sur mobilier', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (670, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24081', '668', 'Plus-values actées sur matériel de bureau et service social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (671, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2409', '657', 'Amortissements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (672, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24090', '671', 'Amortissements sur mobilier', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (673, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24091', '671', 'Amortissements sur matériel de bureau et service social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (674, 'PCMN-BASE', 'IMMO', 'XXXXXX', '241', '656', 'Matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (675, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2410', '674', 'Matériel automobile', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (676, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24100', '675', 'Voitures', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (677, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24105', '675', 'Camions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (678, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2411', '674', 'Matériel ferroviaire', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (679, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2412', '674', 'Matériel fluvial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (680, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2413', '674', 'Matériel naval', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (681, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2414', '674', 'Matériel aérien', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (682, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2418', '674', 'Plus-values sur matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (683, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24180', '682', 'Plus-values sur matériel automobile', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (684, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24181', '682', 'Idem sur matériel ferroviaire', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (685, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24182', '682', 'Idem sur matériel fluvial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (686, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24183', '682', 'Idem sur matériel naval', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (687, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24184', '682', 'Idem sur matériel aérien', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (688, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2419', '674', 'Amortissements sur matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (689, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24190', '688', 'Amortissements sur matériel automobile', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (690, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24191', '688', 'Idem sur matériel ferroviaire', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (691, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24192', '688', 'Idem sur matériel fluvial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (692, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24193', '688', 'Idem sur matériel naval', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (693, 'PCMN-BASE', 'IMMO', 'XXXXXX', '24194', '688', 'Idem sur matériel aérien', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (694, 'PCMN-BASE', 'IMMO', 'XXXXXX', '25', '1352', 'Immobilisation détenues en location-financement et droits similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (695, 'PCMN-BASE', 'IMMO', 'XXXXXX', '250', '694', 'Terrains et constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (696, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2500', '695', 'Terrains', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (697, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2501', '695', 'Constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (698, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2508', '695', 'Plus-values sur emphytéose, leasing et droits similaires : terrains et constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (699, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2509', '695', 'Amortissements et réductions de valeur sur terrains et constructions en leasing', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (700, 'PCMN-BASE', 'IMMO', 'XXXXXX', '251', '694', 'Installations, machines et outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (701, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2510', '700', 'Installations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (702, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2511', '700', 'Machines', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (703, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2512', '700', 'Outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (704, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2518', '700', 'Plus-values actées sur installations machines et outillage pris en leasing', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (705, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2519', '700', 'Amortissements sur installations machines et outillage pris en leasing', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (706, 'PCMN-BASE', 'IMMO', 'XXXXXX', '252', '694', 'Mobilier et matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (707, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2520', '706', 'Mobilier', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (708, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2521', '706', 'Matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (709, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2528', '706', 'Plus-values actées sur mobilier et matériel roulant en leasing', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (710, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2529', '706', 'Amortissements sur mobilier et matériel roulant en leasing', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (711, 'PCMN-BASE', 'IMMO', 'XXXXXX', '26', '1352', 'Autres immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (712, 'PCMN-BASE', 'IMMO', 'XXXXXX', '260', '711', 'Frais d''aménagements de locaux pris en location', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (713, 'PCMN-BASE', 'IMMO', 'XXXXXX', '261', '711', 'Maison d''habitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (714, 'PCMN-BASE', 'IMMO', 'XXXXXX', '262', '711', 'Réserve immobilière', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (715, 'PCMN-BASE', 'IMMO', 'XXXXXX', '263', '711', 'Matériel d''emballage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (716, 'PCMN-BASE', 'IMMO', 'XXXXXX', '264', '711', 'Emballages récupérables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (717, 'PCMN-BASE', 'IMMO', 'XXXXXX', '268', '711', 'Plus-values actées sur autres immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (718, 'PCMN-BASE', 'IMMO', 'XXXXXX', '269', '711', 'Amortissements sur autres immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (719, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2690', '718', 'Amortissements sur frais d''aménagement des locaux pris en location', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (720, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2691', '718', 'Amortissements sur maison d''habitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (721, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2692', '718', 'Amortissements sur réserve immobilière', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (722, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2693', '718', 'Amortissements sur matériel d''emballage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (723, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2694', '718', 'Amortissements sur emballages récupérables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (724, 'PCMN-BASE', 'IMMO', 'XXXXXX', '27', '1352', 'Immobilisations corporelles en cours et acomptes versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (725, 'PCMN-BASE', 'IMMO', 'XXXXXX', '270', '724', 'Immobilisations en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (726, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2700', '725', 'Constructions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (727, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2701', '725', 'Installations machines et outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (728, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2702', '725', 'Mobilier et matériel roulant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (729, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2703', '725', 'Autres immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (730, 'PCMN-BASE', 'IMMO', 'XXXXXX', '271', '724', 'Avances et acomptes versés sur immobilisations en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (731, 'PCMN-BASE', 'IMMO', 'XXXXXX', '28', '1352', 'Immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (732, 'PCMN-BASE', 'IMMO', 'XXXXXX', '280', '731', 'Participations dans des entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (733, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2800', '732', 'Valeur d''acquisition (peut être subdivisé par participation)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (734, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2801', '732', 'Montants non appelés (idem)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (735, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2808', '732', 'Plus-values actées (idem)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (736, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2809', '732', 'Réductions de valeurs actées (idem)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (737, 'PCMN-BASE', 'IMMO', 'XXXXXX', '281', '731', 'Créances sur des entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (738, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2810', '737', 'Créances en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (739, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2811', '737', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (740, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2812', '737', 'Titres à revenu fixes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (741, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2817', '737', 'Créances douteuses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (742, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2819', '737', 'Réductions de valeurs actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (743, 'PCMN-BASE', 'IMMO', 'XXXXXX', '282', '731', 'Participations dans des entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (744, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2820', '743', 'Valeur d''acquisition (peut être subdivisé par participation)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (745, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2821', '743', 'Montants non appelés (idem)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (746, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2828', '743', 'Plus-values actées (idem)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (747, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2829', '743', 'Réductions de valeurs actées (idem)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (748, 'PCMN-BASE', 'IMMO', 'XXXXXX', '283', '731', 'Créances sur des entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (749, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2830', '748', 'Créances en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (750, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2831', '748', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (751, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2832', '748', 'Titres à revenu fixe', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (752, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2837', '748', 'Créances douteuses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (753, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2839', '748', 'Réductions de valeurs actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (754, 'PCMN-BASE', 'IMMO', 'XXXXXX', '284', '731', 'Autres actions et parts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (755, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2840', '754', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (756, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2841', '754', 'Montants non appelés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (757, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2848', '754', 'Plus-values actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (758, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2849', '754', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (759, 'PCMN-BASE', 'IMMO', 'XXXXXX', '285', '731', 'Autres créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (760, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2850', '759', 'Créances en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (761, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2851', '759', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (762, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2852', '759', 'Titres à revenu fixe', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (763, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2857', '759', 'Créances douteuses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (764, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2859', '759', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (765, 'PCMN-BASE', 'IMMO', 'XXXXXX', '288', '731', 'Cautionnements versés en numéraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (766, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2880', '765', 'Téléphone, téléfax, télex', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (767, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2881', '765', 'Gaz', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (768, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2882', '765', 'Eau', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (769, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2883', '765', 'Electricité', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (770, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2887', '765', 'Autres cautionnements versés en numéraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (771, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29', '1352', 'Créances à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (772, 'PCMN-BASE', 'IMMO', 'XXXXXX', '290', '771', 'Créances commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (773, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2900', '772', 'Clients', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (774, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29000', '773', 'Créances en compte sur entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (775, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29001', '773', 'Sur entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (776, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29002', '773', 'Sur clients Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (777, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29003', '773', 'Sur clients C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (778, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29004', '773', 'Sur clients exportation hors C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (779, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29005', '773', 'Créances sur les coparticipants (associations momentanées)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (780, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2901', '772', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (781, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29010', '780', 'Sur entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (782, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29011', '780', 'Sur entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (783, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29012', '780', 'Sur clients Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (784, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29013', '780', 'Sur clients C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (785, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29014', '780', 'Sur clients exportation hors C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (786, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2905', '772', 'Retenues sur garanties', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (787, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2906', '772', 'Acomptes versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (788, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2907', '772', 'Créances douteuses (à ventiler comme clients 2900)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (789, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2909', '772', 'Réductions de valeur actées (à ventiler comme clients 2900)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (790, 'PCMN-BASE', 'IMMO', 'XXXXXX', '291', '771', 'Autres créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (791, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2910', '790', 'Créances en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (792, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29100', '791', 'Sur entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (793, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29101', '791', 'Sur entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (794, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29102', '791', 'Sur autres débiteurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (795, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2911', '790', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (796, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29110', '795', 'Sur entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (797, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29111', '795', 'Sur entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (798, 'PCMN-BASE', 'IMMO', 'XXXXXX', '29112', '795', 'Sur autres débiteurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (799, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2912', '790', 'Créances résultant de la cession d''immobilisations données en leasing', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (800, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2917', '790', 'Créances douteuses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (801, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2919', '790', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (802, 'PCMN-BASE', 'STOCK', 'XXXXXX', '30', '1353', 'Approvisionnements - matières premières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (803, 'PCMN-BASE', 'STOCK', 'XXXXXX', '300', '802', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (804, 'PCMN-BASE', 'STOCK', 'XXXXXX', '309', '802', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (805, 'PCMN-BASE', 'STOCK', 'XXXXXX', '31', '1353', 'Approvsionnements et fournitures', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (806, 'PCMN-BASE', 'STOCK', 'XXXXXX', '310', '805', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (807, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3100', '806', 'Matières d''approvisionnement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (808, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3101', '806', 'Energie, charbon, coke, mazout, essence, propane', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (809, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3102', '806', 'Produits d''entretien', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (810, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3103', '806', 'Fournitures diverses et petit outillage', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (811, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3104', '806', 'Imprimés et fournitures de bureau', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (812, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3105', '806', 'Fournitures de services sociaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (813, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3106', '806', 'Emballages commerciaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (814, 'PCMN-BASE', 'STOCK', 'XXXXXX', '31060', '813', 'Emballages perdus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (815, 'PCMN-BASE', 'STOCK', 'XXXXXX', '31061', '813', 'Emballages récupérables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (816, 'PCMN-BASE', 'STOCK', 'XXXXXX', '319', '805', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (817, 'PCMN-BASE', 'STOCK', 'XXXXXX', '32', '1353', 'En cours de fabrication', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (818, 'PCMN-BASE', 'STOCK', 'XXXXXX', '320', '817', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (819, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3200', '818', 'Produits semi-ouvrés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (820, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3201', '818', 'Produits en cours de fabrication', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (821, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3202', '818', 'Travaux en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (822, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3205', '818', 'Déchets', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (823, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3206', '818', 'Rebuts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (824, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3209', '818', 'Travaux en association momentanée', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (825, 'PCMN-BASE', 'STOCK', 'XXXXXX', '329', '817', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (826, 'PCMN-BASE', 'STOCK', 'XXXXXX', '33', '1353', 'Produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (827, 'PCMN-BASE', 'STOCK', 'XXXXXX', '330', '826', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (828, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3300', '827', 'Produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (829, 'PCMN-BASE', 'STOCK', 'XXXXXX', '339', '826', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (830, 'PCMN-BASE', 'STOCK', 'XXXXXX', '34', '1353', 'Marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (831, 'PCMN-BASE', 'STOCK', 'XXXXXX', '340', '830', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (832, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3400', '831', 'Groupe A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (833, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3401', '831', 'Groupe B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (834, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3402', '831', 'Groupe C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (835, 'PCMN-BASE', 'STOCK', 'XXXXXX', '349', '830', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (836, 'PCMN-BASE', 'STOCK', 'XXXXXX', '35', '1353', 'Immeubles destinés à la vente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (837, 'PCMN-BASE', 'STOCK', 'XXXXXX', '350', '836', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (838, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3500', '837', 'Immeuble A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (839, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3501', '837', 'Immeuble B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (840, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3502', '837', 'Immeuble C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (841, 'PCMN-BASE', 'STOCK', 'XXXXXX', '351', '836', 'Immeubles construits en vue de leur revente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (842, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3510', '841', 'Immeuble A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (843, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3511', '841', 'Immeuble B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (844, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3512', '841', 'Immeuble C', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (845, 'PCMN-BASE', 'STOCK', 'XXXXXX', '359', '836', 'Réductions de valeurs actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (846, 'PCMN-BASE', 'STOCK', 'XXXXXX', '36', '1353', 'Acomptes versés sur achats pour stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (847, 'PCMN-BASE', 'STOCK', 'XXXXXX', '360', '846', 'Acomptes versés (à ventiler éventuellement par catégorie)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (848, 'PCMN-BASE', 'STOCK', 'XXXXXX', '369', '846', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (849, 'PCMN-BASE', 'STOCK', 'XXXXXX', '37', '1353', 'Commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (850, 'PCMN-BASE', 'STOCK', 'XXXXXX', '370', '849', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (851, 'PCMN-BASE', 'STOCK', 'XXXXXX', '371', '849', 'Bénéfice pris en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (852, 'PCMN-BASE', 'STOCK', 'XXXXXX', '379', '849', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (853, 'PCMN-BASE', 'TIERS', 'XXXXXX', '40', '1354', 'Créances commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (854, 'PCMN-BASE', 'TIERS', 'XXXXXX', '400', '853', 'Clients', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (855, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4007', '854', 'Rabais, remises et ristournes à accorder et autres notes de crédit à établir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (856, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4008', '854', 'Créances résultant de livraisons de biens (associations momentanées)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (857, 'PCMN-BASE', 'TIERS', 'XXXXXX', '401', '853', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (858, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4010', '857', 'Effets à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (859, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4013', '857', 'Effets à l''encaissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (860, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4015', '857', 'Effets à l''escompte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (861, 'PCMN-BASE', 'TIERS', 'XXXXXX', '402', '853', 'Clients, créances courantes, entreprises apparentées, administrateurs et gérants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (862, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4020', '861', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (863, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4021', '861', 'Autres entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (864, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4022', '861', 'Administrateurs et gérants d''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (865, 'PCMN-BASE', 'TIERS', 'XXXXXX', '403', '853', 'Effets à recevoir sur entreprises apparentées et administrateurs et gérants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (866, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4030', '865', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (867, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4031', '865', 'Autres entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (868, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4032', '865', 'Administrateurs et gérants de l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (869, 'PCMN-BASE', 'TIERS', 'XXXXXX', '404', '853', 'Produits à recevoir (factures à établir)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (870, 'PCMN-BASE', 'TIERS', 'XXXXXX', '405', '853', 'Clients : retenues sur garanties', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (871, 'PCMN-BASE', 'TIERS', 'XXXXXX', '406', '853', 'Acomptes versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (872, 'PCMN-BASE', 'TIERS', 'XXXXXX', '407', '853', 'Créances douteuses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (873, 'PCMN-BASE', 'TIERS', 'XXXXXX', '408', '853', 'Compensation clients', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (874, 'PCMN-BASE', 'TIERS', 'XXXXXX', '409', '853', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (875, 'PCMN-BASE', 'TIERS', 'XXXXXX', '41', '1354', 'Autres créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (876, 'PCMN-BASE', 'TIERS', 'XXXXXX', '410', '875', 'Capital appelé, non versé', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (877, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4100', '876', 'Appels de fonds', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (878, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4101', '876', 'Actionnaires défaillants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (879, 'PCMN-BASE', 'TIERS', 'XXXXXX', '411', '875', 'T.V.A. à récupérer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (880, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4110', '879', 'T.V.A. due', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (881, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4111', '879', 'T.V.A. déductible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (882, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4112', '879', 'Compte courant administration T.V.A.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (883, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4118', '879', 'Taxe d''égalisation due', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (884, 'PCMN-BASE', 'TIERS', 'XXXXXX', '412', '875', 'Impôts et versements fiscaux à récupérer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (885, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4120', '884', 'Impôts belges sur le résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (886, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4125', '884', 'Autres impôts belges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (887, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4128', '884', 'Impôts étrangers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (888, 'PCMN-BASE', 'TIERS', 'XXXXXX', '414', '875', 'Produits à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (889, 'PCMN-BASE', 'TIERS', 'XXXXXX', '416', '875', 'Créances diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (890, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4160', '889', 'Associés (compte d''apport en société)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (891, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4161', '889', 'Avances et prêts au personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (892, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4162', '889', 'Compte courant des associés en S.P.R.L.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (893, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4163', '889', 'Compte courant des administrateurs et gérants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (894, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4164', '889', 'Créances sur sociétés apparentées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (895, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4166', '889', 'Emballages et matériel à rendre', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (896, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4167', '889', 'Etat et établissements publics', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (897, 'PCMN-BASE', 'TIERS', 'XXXXXX', '41670', '896', 'Subsides à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (898, 'PCMN-BASE', 'TIERS', 'XXXXXX', '41671', '896', 'Autres créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (899, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4168', '889', 'Rabais, ristournes et remises à obtenir et autres avoirs non encore reçus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (900, 'PCMN-BASE', 'TIERS', 'XXXXXX', '417', '875', 'Créances douteuses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (901, 'PCMN-BASE', 'TIERS', 'XXXXXX', '418', '875', 'Cautionnements versés en numéraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (902, 'PCMN-BASE', 'TIERS', 'XXXXXX', '419', '875', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (903, 'PCMN-BASE', 'TIERS', 'XXXXXX', '42', '1354', 'Dettes à plus d''un an échéant dans l''année', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (904, 'PCMN-BASE', 'TIERS', 'XXXXXX', '420', '903', 'Emprunts subordonnés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (905, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4200', '904', 'Convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (906, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4201', '904', 'Non convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (907, 'PCMN-BASE', 'TIERS', 'XXXXXX', '421', '903', 'Emprunts obligataires non subordonnés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (908, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4210', '907', 'Convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (909, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4211', '907', 'Non convertibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (910, 'PCMN-BASE', 'TIERS', 'XXXXXX', '422', '903', 'Dettes de location-financement et assimilées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (911, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4220', '910', 'Financement de biens immobiliers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (912, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4221', '910', 'Financement de biens mobiliers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (913, 'PCMN-BASE', 'TIERS', 'XXXXXX', '423', '903', 'Etablissements de crédit', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (914, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4230', '913', 'Dettes en compte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (915, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4231', '913', 'Promesses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (916, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4232', '913', 'Crédits d''acceptation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (917, 'PCMN-BASE', 'TIERS', 'XXXXXX', '424', '903', 'Autres emprunts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (918, 'PCMN-BASE', 'TIERS', 'XXXXXX', '425', '903', 'Dettes commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (919, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4250', '918', 'Fournisseurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (920, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4251', '918', 'Effets à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (921, 'PCMN-BASE', 'TIERS', 'XXXXXX', '426', '903', 'Cautionnements reçus en numéraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (922, 'PCMN-BASE', 'TIERS', 'XXXXXX', '429', '903', 'Dettes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (923, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4290', '922', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (924, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4291', '922', 'Entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (925, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4292', '922', 'Administrateurs, gérants, associés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (926, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4299', '922', 'Autres dettes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (927, 'PCMN-BASE', 'TIERS', 'XXXXXX', '43', '1354', 'Dettes financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (928, 'PCMN-BASE', 'TIERS', 'XXXXXX', '430', '927', 'Etablissements de crédit. Emprunts en compte à terme fixe', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (929, 'PCMN-BASE', 'TIERS', 'XXXXXX', '431', '927', 'Etablissements de crédit. Promesses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (930, 'PCMN-BASE', 'TIERS', 'XXXXXX', '432', '927', 'Etablissements de crédit. Crédits d''acceptation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (931, 'PCMN-BASE', 'TIERS', 'XXXXXX', '433', '927', 'Etablissements de crédit. Dettes en compte courant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (932, 'PCMN-BASE', 'TIERS', 'XXXXXX', '439', '927', 'Autres emprunts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (933, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44', '1354', 'Dettes commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (934, 'PCMN-BASE', 'TIERS', 'XXXXXX', '440', '933', 'Fournisseurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (935, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4400', '934', 'Entreprises apparentées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (936, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44000', '935', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (937, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44001', '935', 'Entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (938, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4401', '934', 'Fournisseurs ordinaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (939, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44010', '938', 'Fournisseurs belges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (940, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44011', '938', 'Fournisseurs CEE', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (941, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44012', '938', 'Fournisseurs importation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (942, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4402', '934', 'Dettes envers les coparticipants (associations momentanées)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (943, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4403', '934', 'Fournisseurs - retenues de garanties', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (944, 'PCMN-BASE', 'TIERS', 'XXXXXX', '441', '933', 'Effets à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (945, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4410', '944', 'Entreprises apparentées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (946, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44100', '945', 'Entreprises liées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (947, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44101', '945', 'Entreprises avec lesquelles il existe un lien de participation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (948, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4411', '944', 'Fournisseurs ordinaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (949, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44110', '948', 'Fournisseurs belges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (950, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44111', '948', 'Fournisseurs CEE', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (951, 'PCMN-BASE', 'TIERS', 'XXXXXX', '44112', '948', 'Fournisseurs importation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (952, 'PCMN-BASE', 'TIERS', 'XXXXXX', '444', '933', 'Factures à recevoir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (953, 'PCMN-BASE', 'TIERS', 'XXXXXX', '446', '933', 'Acomptes reçus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (954, 'PCMN-BASE', 'TIERS', 'XXXXXX', '448', '933', 'Compensations fournisseurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (955, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45', '1354', 'Dettes fiscales, salariales et sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (956, 'PCMN-BASE', 'TIERS', 'XXXXXX', '450', '955', 'Dettes fiscales estimées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (957, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4501', '956', 'Impôts sur le résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (958, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4505', '956', 'Autres impôts en Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (959, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4508', '956', 'Impôts à l''étranger', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (960, 'PCMN-BASE', 'TIERS', 'XXXXXX', '451', '955', 'T.V.A. à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (961, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4510', '960', 'T.V.A. due', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (962, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4511', '960', 'T.V.A. déductible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (963, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4512', '960', 'Compte courant administration T.V.A.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (964, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4518', '960', 'Taxe d''égalisation due', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (965, 'PCMN-BASE', 'TIERS', 'XXXXXX', '452', '955', 'Impôts et taxes à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (966, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4520', '965', 'Autres impôts sur le résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (967, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4525', '965', 'Autres impôts et taxes en Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (968, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45250', '967', 'Précompte immobilier', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (969, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45251', '967', 'Impôts communaux à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (970, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45252', '967', 'Impôts provinciaux à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (971, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45253', '967', 'Autres impôts et taxes à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (972, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4528', '965', 'Impôts et taxes à l''étranger', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (973, 'PCMN-BASE', 'TIERS', 'XXXXXX', '453', '955', 'Précomptes retenus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (974, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4530', '973', 'Précompte professionnel retenu sur rémunérations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (975, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4531', '973', 'Précompte professionnel retenu sur tantièmes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (976, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4532', '973', 'Précompte mobilier retenu sur dividendes attribués', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (977, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4533', '973', 'Précompte mobilier retenu sur intérêts payés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (978, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4538', '973', 'Autres précomptes retenus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (979, 'PCMN-BASE', 'TIERS', 'XXXXXX', '454', '955', 'Office National de la Sécurité Sociale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (980, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4540', '979', 'Arriérés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (981, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4541', '979', '1er trimestre', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (982, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4542', '979', '2ème trimestre', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (983, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4543', '979', '3ème trimestre', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (984, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4544', '979', '4ème trimestre', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (985, 'PCMN-BASE', 'TIERS', 'XXXXXX', '455', '955', 'Rémunérations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (986, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4550', '985', 'Administrateurs, gérants et commissaires (non réviseurs)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (987, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4551', '985', 'Direction', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (988, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4552', '985', 'Employés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (989, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4553', '985', 'Ouvriers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (990, 'PCMN-BASE', 'TIERS', 'XXXXXX', '456', '955', 'Pécules de vacances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (991, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4560', '990', 'Direction', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (992, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4561', '990', 'Employés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (993, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4562', '990', 'Ouvriers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (994, 'PCMN-BASE', 'TIERS', 'XXXXXX', '459', '955', 'Autres dettes sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (995, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4590', '994', 'Provision pour gratifications de fin d''année', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (996, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4591', '994', 'Départs de personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (997, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4592', '994', 'Oppositions sur rémunérations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (998, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4593', '994', 'Assurances relatives au personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (999, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45930', '998', 'Assurance loi', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1000, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45931', '998', 'Assurance salaire garanti', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1001, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45932', '998', 'Assurance groupe', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1002, 'PCMN-BASE', 'TIERS', 'XXXXXX', '45933', '998', 'Assurances individuelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1003, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4594', '994', 'Caisse d''assurances sociales pour travailleurs indépendants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1004, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4597', '994', 'Dettes et provisions sociales diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1005, 'PCMN-BASE', 'TIERS', 'XXXXXX', '46', '1354', 'Acomptes reçus sur commande', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1006, 'PCMN-BASE', 'TIERS', 'XXXXXX', '47', '1354', 'Dettes découlant de l''affectation des résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1007, 'PCMN-BASE', 'TIERS', 'XXXXXX', '470', '1006', 'Dividendes et tantièmes d''exercices antérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1008, 'PCMN-BASE', 'TIERS', 'XXXXXX', '471', '1006', 'Dividendes de l''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1009, 'PCMN-BASE', 'TIERS', 'XXXXXX', '472', '1006', 'Tantièmes de l''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1010, 'PCMN-BASE', 'TIERS', 'XXXXXX', '473', '1006', 'Autres allocataires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1011, 'PCMN-BASE', 'TIERS', 'XXXXXX', '48', '4', 'Dettes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1012, 'PCMN-BASE', 'TIERS', 'XXXXXX', '480', '1011', 'Obligations et coupons échus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1013, 'PCMN-BASE', 'TIERS', 'XXXXXX', '481', '1011', 'Actionnaires - capital à rembourser', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1014, 'PCMN-BASE', 'TIERS', 'XXXXXX', '482', '1011', 'Participation du personnel à payer', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1015, 'PCMN-BASE', 'TIERS', 'XXXXXX', '483', '1011', 'Acomptes reçus d''autres tiers à moins d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1016, 'PCMN-BASE', 'TIERS', 'XXXXXX', '486', '1011', 'Emballages et matériel consignés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1017, 'PCMN-BASE', 'TIERS', 'XXXXXX', '488', '1011', 'Cautionnements reçus en numéraires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1018, 'PCMN-BASE', 'TIERS', 'XXXXXX', '489', '1011', 'Autres dettes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1019, 'PCMN-BASE', 'TIERS', 'XXXXXX', '49', '1354', 'Comptes de régularisation et compte d''attente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1020, 'PCMN-BASE', 'TIERS', 'XXXXXX', '490', '1019', 'Charges à reporter (à subdiviser par catégorie de charges)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1021, 'PCMN-BASE', 'TIERS', 'XXXXXX', '491', '1019', 'Produits acquis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1022, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4910', '1021', 'Produits d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1023, 'PCMN-BASE', 'TIERS', 'XXXXXX', '49100', '1022', 'Ristournes et rabais à obtenir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1024, 'PCMN-BASE', 'TIERS', 'XXXXXX', '49101', '1022', 'Commissions à obtenir', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1025, 'PCMN-BASE', 'TIERS', 'XXXXXX', '49102', '1022', 'Autres produits d''exploitation (redevances par exemple)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1026, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4911', '1021', 'Produits financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1027, 'PCMN-BASE', 'TIERS', 'XXXXXX', '49110', '1026', 'Intérêts courus et non échus sur prêts et débits', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1028, 'PCMN-BASE', 'TIERS', 'XXXXXX', '49111', '1026', 'Autres produits financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1029, 'PCMN-BASE', 'TIERS', 'XXXXXX', '492', '1019', 'Charges à imputer (à subdiviser par catégorie de charges)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1030, 'PCMN-BASE', 'TIERS', 'XXXXXX', '493', '1019', 'Produits à reporter', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1031, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4930', '1030', 'Produits d''exploitation à reporter', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1032, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4931', '1030', 'Produits financiers à reporter', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1033, 'PCMN-BASE', 'TIERS', 'XXXXXX', '499', '1019', 'Comptes d''attente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1034, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4990', '1033', 'Compte d''attente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1035, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4991', '1033', 'Compte de répartition périodique des charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1036, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4999', '1033', 'Transferts d''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1037, 'PCMN-BASE', 'FINAN', 'XXXXXX', '50', '1355', 'Actions propres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1038, 'PCMN-BASE', 'FINAN', 'XXXXXX', '51', '1355', 'Actions et parts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1039, 'PCMN-BASE', 'FINAN', 'XXXXXX', '510', '1038', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1040, 'PCMN-BASE', 'FINAN', 'XXXXXX', '511', '1038', 'Montants non appelés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1041, 'PCMN-BASE', 'FINAN', 'XXXXXX', '519', '1038', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1042, 'PCMN-BASE', 'FINAN', 'XXXXXX', '52', '1355', 'Titres à revenus fixes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1043, 'PCMN-BASE', 'FINAN', 'XXXXXX', '520', '1042', 'Valeur d''acquisition', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1044, 'PCMN-BASE', 'FINAN', 'XXXXXX', '529', '1042', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1045, 'PCMN-BASE', 'FINAN', 'XXXXXX', '53', '1355', 'Dépots à terme', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1046, 'PCMN-BASE', 'FINAN', 'XXXXXX', '530', '1045', 'De plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1047, 'PCMN-BASE', 'FINAN', 'XXXXXX', '531', '1045', 'De plus d''un mois et à un an au plus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1048, 'PCMN-BASE', 'FINAN', 'XXXXXX', '532', '1045', 'd''un mois au plus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1049, 'PCMN-BASE', 'FINAN', 'XXXXXX', '539', '1045', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1050, 'PCMN-BASE', 'FINAN', 'XXXXXX', '54', '1355', 'Valeurs échues à l''encaissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1051, 'PCMN-BASE', 'FINAN', 'XXXXXX', '540', '1050', 'Chèques à encaisser', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1052, 'PCMN-BASE', 'FINAN', 'XXXXXX', '541', '1050', 'Coupons à encaisser', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1053, 'PCMN-BASE', 'FINAN', 'XXXXXX', '55', '1355', 'Etablissements de crédit - Comptes ouverts auprès des divers établissements.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1054, 'PCMN-BASE', 'FINAN', 'XXXXXX', '550', '1053', 'Comptes courants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1055, 'PCMN-BASE', 'FINAN', 'XXXXXX', '551', '1053', 'Chèques émis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1056, 'PCMN-BASE', 'FINAN', 'XXXXXX', '559', '1053', 'Réductions de valeur actées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1057, 'PCMN-BASE', 'FINAN', 'XXXXXX', '56', '1355', 'Office des chèques postaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1058, 'PCMN-BASE', 'FINAN', 'XXXXXX', '560', '1057', 'Compte courant', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1059, 'PCMN-BASE', 'FINAN', 'XXXXXX', '561', '1057', 'Chèques émis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1060, 'PCMN-BASE', 'FINAN', 'XXXXXX', '57', '1355', 'Caisses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1061, 'PCMN-BASE', 'FINAN', 'XXXXXX', '570', '1060', 'à 577 Caisses - espèces ( 0 - centrale ; 7 - succursales et agences)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1062, 'PCMN-BASE', 'FINAN', 'XXXXXX', '578', '1060', 'Caisses - timbres ( 0 - fiscaux ; 1 - postaux)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1063, 'PCMN-BASE', 'FINAN', 'XXXXXX', '58', '1355', 'Virements internes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1064, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '60', '1356', 'Approvisionnements et marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1065, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '600', '1064', 'Achats de matières premières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1066, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '601', '1064', 'Achats de fournitures', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1067, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '602', '1064', 'Achats de services, travaux et études', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1068, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '603', '1064', 'Sous-traitances générales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1069, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '604', '1064', 'Achats de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1070, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '605', '1064', 'Achats d''immeubles destinés à la revente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1071, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '608', '1064', 'Remises , ristournes et rabais obtenus sur achats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1072, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '609', '1064', 'Variations de stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1073, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6090', '1072', 'De matières premières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1074, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6091', '1072', 'De fournitures', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1075, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6094', '1072', 'De marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1076, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6095', '1072', 'd''immeubles destinés à la vente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1077, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61', '1356', 'Services et biens divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1078, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '610', '1077', 'Loyers et charges locatives', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1079, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6100', '1078', 'Loyers divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1080, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6101', '1078', 'Charges locatives (assurances, frais de confort,etc)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1081, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '611', '1077', 'Entretien et réparation (fournitures et prestations)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1082, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '612', '1077', 'Fournitures faites à l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1083, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6120', '1082', 'Eau, gaz, électricité, vapeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1084, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61200', '1083', 'Eau', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1085, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61201', '1083', 'Gaz', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1086, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61202', '1083', 'Electricité', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1087, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61203', '1083', 'Vapeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1088, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6121', '1082', 'Téléphone, télégrammes, télex, téléfax, frais postaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1089, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61210', '1088', 'Téléphone', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1090, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61211', '1088', 'Télégrammes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1091, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61212', '1088', 'Télex et téléfax', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1092, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61213', '1088', 'Frais postaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1093, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6122', '1082', 'Livres, bibliothèque', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1094, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6123', '1082', 'Imprimés et fournitures de bureau (si non comptabilisé au 601)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1095, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '613', '1077', 'Rétributions de tiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1096, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6130', '1095', 'Redevances et royalties', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1097, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61300', '1096', 'Redevances pour brevets, licences, marques et accessoires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1098, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61301', '1096', 'Autres redevances (procédés de fabrication)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1099, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6131', '1095', 'Assurances non relatives au personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1100, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61310', '1099', 'Assurance incendie', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1101, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61311', '1099', 'Assurance vol', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1102, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61312', '1099', 'Assurance autos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1103, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61313', '1099', 'Assurance crédit', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1104, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61314', '1099', 'Assurances frais généraux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1105, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6132', '1095', 'Divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1106, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61320', '1105', 'Commissions aux tiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1107, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61321', '1105', 'Honoraires d''avocats, d''experts, etc', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1108, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61322', '1105', 'Cotisations aux groupements professionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1109, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61323', '1105', 'Dons, libéralités, etc', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1110, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61324', '1105', 'Frais de contentieux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1111, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61325', '1105', 'Publications légales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1112, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6133', '1095', 'Transports et déplacements', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1113, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61330', '1112', 'Transports de personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1114, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '61331', '1112', 'Voyages, déplacements et représentations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1115, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6134', '1095', 'Personnel intérimaire', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1116, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '614', '1077', 'Annonces, publicité, propagande et documentation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1117, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6140', '1116', 'Annonces et insertions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1118, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6141', '1116', 'Catalogues et imprimés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1119, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6142', '1116', 'Echantillons', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1120, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6143', '1116', 'Foires et expositions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1121, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6144', '1116', 'Primes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1122, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6145', '1116', 'Cadeaux à la clientèle', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1123, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6146', '1116', 'Missions et réceptions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1124, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6147', '1116', 'Documentation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1125, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '615', '1077', 'Sous-traitants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1126, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6150', '1125', 'Sous-traitants pour activités propres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1127, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6151', '1125', 'Sous-traitants d''associations momentanées (coparticipants)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1128, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6152', '1125', 'Quote-part bénéficiaire des coparticipants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1129, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '617', '1077', 'Personnel intérimaire et personnes mises à la disposition de l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1130, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '618', '1077', 'Rémunérations, primes pour assurances extralégales, pensions de retraite et de survie des administrateurs, gérants et associés actifs qui ne sont pas attribuées en vertu d''un contrat de travail', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1131, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62', '1356', 'Rémunérations, charges sociales et pensions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1132, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '620', '1131', 'Rémunérations et avantages sociaux directs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1133, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6200', '1132', 'Administrateurs ou gérants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1134, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6201', '1132', 'Personnel de direction', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1135, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6202', '1132', 'Employés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1136, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6203', '1132', 'Ouvriers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1137, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6204', '1132', 'Autres membres du personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1138, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '621', '1131', 'Cotisations patronales d''assurances sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1139, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6210', '1138', 'Sur salaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1140, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6211', '1138', 'Sur appointements et commissions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1141, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '622', '1131', 'Primes patronales pour assurances extralégales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1142, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '623', '1131', 'Autres frais de personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1143, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6230', '1142', 'Assurances du personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1144, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62300', '1143', 'Assurances loi, responsabilité civile, chemin du travail', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1145, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62301', '1143', 'Assurance salaire garanti', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1146, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62302', '1143', 'Assurances individuelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1147, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6231', '1142', 'Charges sociales diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1148, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62310', '1147', 'Jours fériés payés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1149, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62311', '1147', 'Salaire hebdomadaire garanti', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1150, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62312', '1147', 'Allocations familiales complémentaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1151, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6232', '1142', 'Charges sociales des administrateurs, gérants et commissaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1152, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62320', '1151', 'Allocations familiales complémentaires pour non salariés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1153, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62321', '1151', 'Lois sociales pour indépendants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1154, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '62322', '1151', 'Divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1155, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '624', '1131', 'Pensions de retraite et de survie', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1156, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6240', '1155', 'Administrateurs et gérants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1157, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6241', '1155', 'Personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1158, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '625', '1131', 'Provision pour pécule de vacances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1159, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6250', '1158', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1160, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6251', '1158', 'Utilisations et reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1161, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '63', '1356', 'Amortissements, réductions de valeur et provisions pour risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1162, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '630', '1161', 'Dotations aux amortissements et aux réductions de valeur sur immobilisations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1163, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6300', '1162', 'Dotations aux amortissements sur frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1164, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6301', '1162', 'Dotations aux amortissements sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1165, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6302', '1162', 'Dotations aux amortissements sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1166, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6308', '1162', 'Dotations aux réductions de valeur sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1167, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6309', '1162', 'Dotations aux réductions de valeur sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1168, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '631', '1161', 'Réductions de valeur sur stocks', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1169, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6310', '1168', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1170, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6311', '1168', 'Reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1171, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '632', '1161', 'Réductions de valeur sur commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1172, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6320', '1171', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1173, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6321', '1171', 'Reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1174, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '633', '1161', 'Réductions de valeur sur créances commerciales à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1175, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6330', '1174', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1176, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6331', '1174', 'Reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1177, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '634', '1161', 'Réductions de valeur sur créances commerciales à un an au plus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1178, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6340', '1177', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1179, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6341', '1177', 'Reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1180, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '635', '1161', 'Provisions pour pensions et obligations similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1181, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6350', '1180', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1182, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6351', '1180', 'Utilisations et reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1183, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '636', '11613', 'Provisions pour grosses réparations et gros entretiens', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1184, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6360', '1183', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1185, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6361', '1183', 'Utilisations et reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1186, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '637', '1161', 'Provisions pour autres risques et charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1187, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6370', '1186', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1188, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6371', '1186', 'Utilisations et reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1189, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64', '1356', 'Autres charges d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1190, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '640', '1189', 'Charges fiscales d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1191, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6400', '1190', 'Taxes et impôts directs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1192, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64000', '1191', 'Taxes sur autos et camions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1193, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6401', '1190', 'Taxes et impôts indirects', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1194, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64010', '1193', 'Timbres fiscaux pris en charge par la firme', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1195, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64011', '1193', 'Droits d''enregistrement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1196, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64012', '1193', 'T.V.A. non déductible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1197, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6402', '1190', 'Impôts provinciaux et communaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1198, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64020', '1197', 'Taxe sur la force motrice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1199, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '64021', '1197', 'Taxe sur le personnel occupé', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1200, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6403', '1190', 'Taxes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1201, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '641', '1189', 'Moins-values sur réalisations courantes d''immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1202, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '642', '1189', 'Moins-values sur réalisations de créances commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1203, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '643', '1189', 'à 648 Charges d''exploitations diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1204, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '649', '1189', 'Charges d''exploitation portées à l''actif au titre de restructuration', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1205, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '65', '1356', 'Charges financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1206, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '650', '1205', 'Charges des dettes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1207, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6500', '1206', 'Intérêts, commissions et frais afférents aux dettes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1208, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6501', '1206', 'Amortissements des agios et frais d''émission d''emprunts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1209, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6502', '1206', 'Autres charges de dettes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1210, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6503', '1206', 'Intérêts intercalaires portés à l''actif', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1211, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '651', '1205', 'Réductions de valeur sur actifs circulants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1212, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6510', '1211', 'Dotations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1213, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6511', '1211', 'Reprises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1214, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '652', '1205', 'Moins-values sur réalisation d''actifs circulants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1215, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '653', '1205', 'Charges d''escompte de créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1216, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '654', '1205', 'Différences de change', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1217, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '655', '1205', 'Ecarts de conversion des devises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1218, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '656', '1205', 'Frais de banques, de chèques postaux', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1219, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '657', '1205', 'Commissions sur ouvertures de crédit, cautions et avals', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1220, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '658', '1205', 'Frais de vente des titres', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1221, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '66', '1356', 'Charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1222, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '660', '1221', 'Amortissements et réductions de valeur exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1223, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6600', '1222', 'Sur frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1224, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6601', '1222', 'Sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1225, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6602', '1222', 'Sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1226, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '661', '1221', 'Réductions de valeur sur immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1227, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '662', '1221', 'Provisions pour risques et charges exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1228, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '663', '1221', 'Moins-values sur réalisation d''actifs immobilisés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1229, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6630', '1228', 'Sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1230, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6631', '1228', 'Sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1231, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6632', '1228', 'Sur immobilisations détenues en location-financement et droits similaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1232, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6633', '1228', 'Sur immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1233, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6634', '1228', 'Sur immeubles acquis ou construits en vue de la revente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1234, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '664', '1221', 'à 668 Autres charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1235, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '664', '1221', 'Pénalités et amendes diverses', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1236, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '665', '1221', 'Différence de charge', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1237, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '669', '1221', 'Charges exceptionnelles transférées à l''actif en frais de restructuration', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1238, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '67', '1356', 'Impôts sur le résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1239, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '670', '1238', 'Impôts belges sur le résultat de l''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1240, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6700', '1239', 'Impôts et précomptes dus ou versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1241, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6701', '1239', 'Excédent de versements d''impôts et précomptes porté à l''actif', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1242, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6702', '1239', 'Charges fiscales estimées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1243, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '671', '1238', 'Impôts belges sur le résultat d''exercices antérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1244, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6710', '1243', 'Suppléments d''impôts dus ou versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1245, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6711', '1243', 'Suppléments d''impôts estimés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1246, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6712', '1243', 'Provisions fiscales constituées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1247, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '672', '1238', 'Impôts étrangers sur le résultat de l''exercice', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1248, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '673', '1238', 'Impôts étrangers sur le résultat d''exercices antérieurs', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1249, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '68', '1356', 'Transferts aux réserves immunisées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1250, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '69', '1356', 'Affectation des résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1251, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '690', '1250', 'Perte reportée de l''exercice précédent', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1252, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '691', '1250', 'Dotation à la réserve légale', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1253, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '692', '1250', 'Dotation aux autres réserves', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1254, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '693', '1250', 'Bénéfice à reporter', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1255, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '694', '1250', 'Rémunération du capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1256, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '695', '1250', 'Administrateurs ou gérants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1257, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '696', '1250', 'Autres allocataires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1258, 'PCMN-BASE', 'PROD', 'XXXXXX', '70', '1357', 'Chiffre d''affaires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1260, 'PCMN-BASE', 'PROD', 'XXXXXX', '700', '1258', 'Ventes de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1261, 'PCMN-BASE', 'PROD', 'XXXXXX', '7000', '1260', 'Ventes en Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1262, 'PCMN-BASE', 'PROD', 'XXXXXX', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1263, 'PCMN-BASE', 'PROD', 'XXXXXX', '7002', '1260', 'Ventes à l''exportation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1264, 'PCMN-BASE', 'PROD', 'XXXXXX', '701', '1258', 'Ventes de produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1265, 'PCMN-BASE', 'PROD', 'XXXXXX', '7010', '1264', 'Ventes en Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1266, 'PCMN-BASE', 'PROD', 'XXXXXX', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1267, 'PCMN-BASE', 'PROD', 'XXXXXX', '7012', '1264', 'Ventes à l''exportation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1268, 'PCMN-BASE', 'PROD', 'XXXXXX', '702', '1258', 'Ventes de déchets et rebuts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1269, 'PCMN-BASE', 'PROD', 'XXXXXX', '7020', '1268', 'Ventes en Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1270, 'PCMN-BASE', 'PROD', 'XXXXXX', '7021', '1268', 'Ventes dans les pays membres de la C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1271, 'PCMN-BASE', 'PROD', 'XXXXXX', '7022', '1268', 'Ventes à l''exportation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1272, 'PCMN-BASE', 'PROD', 'XXXXXX', '703', '1258', 'Ventes d''emballages récupérables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1273, 'PCMN-BASE', 'PROD', 'XXXXXX', '704', '1258', 'Facturations des travaux en cours (associations momentanées)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1274, 'PCMN-BASE', 'PROD', 'XXXXXX', '705', '1258', 'Prestations de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1275, 'PCMN-BASE', 'PROD', 'XXXXXX', '7050', '1274', 'Prestations de services en Belgique', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1276, 'PCMN-BASE', 'PROD', 'XXXXXX', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1277, 'PCMN-BASE', 'PROD', 'XXXXXX', '7052', '1274', 'Prestations de services en vue de l''exportation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1278, 'PCMN-BASE', 'PROD', 'XXXXXX', '706', '1258', 'Pénalités et dédits obtenus par l''entreprise', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1279, 'PCMN-BASE', 'PROD', 'XXXXXX', '708', '1258', 'Remises, ristournes et rabais accordés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1280, 'PCMN-BASE', 'PROD', 'XXXXXX', '7080', '1279', 'Sur ventes de marchandises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1281, 'PCMN-BASE', 'PROD', 'XXXXXX', '7081', '1279', 'Sur ventes de produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1282, 'PCMN-BASE', 'PROD', 'XXXXXX', '7082', '1279', 'Sur ventes de déchets et rebuts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1283, 'PCMN-BASE', 'PROD', 'XXXXXX', '7083', '1279', 'Sur prestations de services', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1284, 'PCMN-BASE', 'PROD', 'XXXXXX', '7084', '1279', 'Mali sur travaux facturés aux associations momentanées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1285, 'PCMN-BASE', 'PROD', 'XXXXXX', '71', '1357', 'Variation des stocks et des commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1286, 'PCMN-BASE', 'PROD', 'XXXXXX', '712', '1285', 'Des en cours de fabrication', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1287, 'PCMN-BASE', 'PROD', 'XXXXXX', '713', '1285', 'Des produits finis', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1288, 'PCMN-BASE', 'PROD', 'XXXXXX', '715', '1285', 'Des immeubles construits destinés à la vente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1289, 'PCMN-BASE', 'PROD', 'XXXXXX', '717', '1285', 'Des commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1290, 'PCMN-BASE', 'PROD', 'XXXXXX', '7170', '1289', 'Commandes en cours - Coût de revient', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1291, 'PCMN-BASE', 'PROD', 'XXXXXX', '71700', '1290', 'Coût des commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1292, 'PCMN-BASE', 'PROD', 'XXXXXX', '71701', '1290', 'Coût des travaux en cours des associations momentanées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1293, 'PCMN-BASE', 'PROD', 'XXXXXX', '7171', '1289', 'Bénéfices portés en compte sur commandes en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1294, 'PCMN-BASE', 'PROD', 'XXXXXX', '71710', '1293', 'Sur commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1295, 'PCMN-BASE', 'PROD', 'XXXXXX', '71711', '1293', 'Sur travaux en cours des associations momentanées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1296, 'PCMN-BASE', 'PROD', 'XXXXXX', '72', '1357', 'Production immobilisée', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1297, 'PCMN-BASE', 'PROD', 'XXXXXX', '720', '1296', 'En frais d''établissement', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1298, 'PCMN-BASE', 'PROD', 'XXXXXX', '721', '1296', 'En immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1299, 'PCMN-BASE', 'PROD', 'XXXXXX', '722', '1296', 'En immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1300, 'PCMN-BASE', 'PROD', 'XXXXXX', '723', '1296', 'En immobilisations en cours', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1301, 'PCMN-BASE', 'PROD', 'XXXXXX', '74', '1357', 'Autres produits d''exploitation', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1302, 'PCMN-BASE', 'PROD', 'XXXXXX', '740', '1301', 'Subsides d''exploitation et montants compensatoires', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1303, 'PCMN-BASE', 'PROD', 'XXXXXX', '741', '1301', 'Plus-values sur réalisations courantes d''immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1304, 'PCMN-BASE', 'PROD', 'XXXXXX', '742', '1301', 'Plus-values sur réalisations de créances commerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1305, 'PCMN-BASE', 'PROD', 'XXXXXX', '743', '1301', 'à 749 Produits d''exploitation divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1306, 'PCMN-BASE', 'PROD', 'XXXXXX', '743', '1301', 'Produits de services exploités dans l''intérêt du personnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1307, 'PCMN-BASE', 'PROD', 'XXXXXX', '744', '1301', 'Commissions et courtages', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1308, 'PCMN-BASE', 'PROD', 'XXXXXX', '745', '1301', 'Redevances pour brevets et licences', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1309, 'PCMN-BASE', 'PROD', 'XXXXXX', '746', '1301', 'Prestations de services (transports, études, etc)', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1310, 'PCMN-BASE', 'PROD', 'XXXXXX', '747', '1301', 'Revenus des immeubles affectés aux activités non professionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1311, 'PCMN-BASE', 'PROD', 'XXXXXX', '748', '1301', 'Locations diverses à caractère professionnel', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1312, 'PCMN-BASE', 'PROD', 'XXXXXX', '749', '1301', 'Produits divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1313, 'PCMN-BASE', 'PROD', 'XXXXXX', '7490', '1312', 'Bonis sur reprises d''emballages consignés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1314, 'PCMN-BASE', 'PROD', 'XXXXXX', '7491', '1312', 'Bonis sur travaux en associations momentanées', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1315, 'PCMN-BASE', 'PROD', 'XXXXXX', '75', '1357', 'Produits financiers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1316, 'PCMN-BASE', 'PROD', 'XXXXXX', '750', '1315', 'Produits des immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1317, 'PCMN-BASE', 'PROD', 'XXXXXX', '7500', '1316', 'Revenus des actions', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1318, 'PCMN-BASE', 'PROD', 'XXXXXX', '7501', '1316', 'Revenus des obligations', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1319, 'PCMN-BASE', 'PROD', 'XXXXXX', '7502', '1316', 'Revenus des créances à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1320, 'PCMN-BASE', 'PROD', 'XXXXXX', '751', '1315', 'Produits des actifs circulants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1321, 'PCMN-BASE', 'PROD', 'XXXXXX', '752', '1315', 'Plus-values sur réalisations d''actifs circulants', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1322, 'PCMN-BASE', 'PROD', 'XXXXXX', '753', '1315', 'Subsides en capital et en intérêts', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1323, 'PCMN-BASE', 'PROD', 'XXXXXX', '754', '1315', 'Différences de change', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1324, 'PCMN-BASE', 'PROD', 'XXXXXX', '755', '1315', 'Ecarts de conversion des devises', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1325, 'PCMN-BASE', 'PROD', 'XXXXXX', '756', '1315', 'à 759 Produits financiers divers', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1326, 'PCMN-BASE', 'PROD', 'XXXXXX', '756', '1315', 'Produits des autres créances', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1327, 'PCMN-BASE', 'PROD', 'XXXXXX', '757', '1315', 'Escomptes obtenus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1328, 'PCMN-BASE', 'PROD', 'XXXXXX', '76', '1357', 'Produits exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1329, 'PCMN-BASE', 'PROD', 'XXXXXX', '760', '1328', 'Reprises d''amortissements et de réductions de valeur', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1330, 'PCMN-BASE', 'PROD', 'XXXXXX', '7600', '1329', 'Sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1331, 'PCMN-BASE', 'PROD', 'XXXXXX', '7601', '1329', 'Sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1332, 'PCMN-BASE', 'PROD', 'XXXXXX', '761', '1328', 'Reprises de réductions de valeur sur immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1333, 'PCMN-BASE', 'PROD', 'XXXXXX', '762', '1328', 'Reprises de provisions pour risques et charges exceptionnelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1334, 'PCMN-BASE', 'PROD', 'XXXXXX', '763', '1328', 'Plus-values sur réalisation d''actifs immobilisés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1335, 'PCMN-BASE', 'PROD', 'XXXXXX', '7630', '1334', 'Sur immobilisations incorporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1336, 'PCMN-BASE', 'PROD', 'XXXXXX', '7631', '1334', 'Sur immobilisations corporelles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1337, 'PCMN-BASE', 'PROD', 'XXXXXX', '7632', '1334', 'Sur immobilisations financières', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1338, 'PCMN-BASE', 'PROD', 'XXXXXX', '764', '1328', 'Autres produits exceptionnels', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1339, 'PCMN-BASE', 'PROD', 'XXXXXX', '77', '1357', 'Régularisations d''impôts et reprises de provisions fiscales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1340, 'PCMN-BASE', 'PROD', 'XXXXXX', '771', '1339', 'Impôts belges sur le résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1341, 'PCMN-BASE', 'PROD', 'XXXXXX', '7710', '1340', 'Régularisations d''impôts dus ou versés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1342, 'PCMN-BASE', 'PROD', 'XXXXXX', '7711', '1340', 'Régularisations d''impôts estimés', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1343, 'PCMN-BASE', 'PROD', 'XXXXXX', '7712', '1340', 'Reprises de provisions fiscales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1344, 'PCMN-BASE', 'PROD', 'XXXXXX', '773', '1339', 'Impôts étrangers sur le résultat', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1345, 'PCMN-BASE', 'PROD', 'XXXXXX', '79', '1357', 'Affectation aux résultats', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1346, 'PCMN-BASE', 'PROD', 'XXXXXX', '790', '1345', 'Bénéfice reporté de l''exercice précédent', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1347, 'PCMN-BASE', 'PROD', 'XXXXXX', '791', '1345', 'Prélèvement sur le capital et les primes d''émission', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1348, 'PCMN-BASE', 'PROD', 'XXXXXX', '792', '1345', 'Prélèvement sur les réserves', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1349, 'PCMN-BASE', 'PROD', 'XXXXXX', '793', '1345', 'Perte à reporter', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1350, 'PCMN-BASE', 'PROD', 'XXXXXX', '794', '1345', 'Intervention d''associés (ou du propriétaire) dans la perte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1351, 'PCMN-BASE', 'CAPIT', 'XXXXXX', '1', '', 'Fonds propres, provisions pour risques et charges et dettes à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1352, 'PCMN-BASE', 'IMMO', 'XXXXXX', '2', '', 'Frais d''établissement. Actifs immobilisés et créances à plus d''un an', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1353, 'PCMN-BASE', 'STOCK', 'XXXXXX', '3', '', 'Stock et commandes en cours d''exécution', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1354, 'PCMN-BASE', 'TIERS', 'XXXXXX', '4', '', 'Créances et dettes à un an au plus', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1355, 'PCMN-BASE', 'FINAN', 'XXXXXX', '5', '', 'Placement de trésorerie et de valeurs disponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1356, 'PCMN-BASE', 'CHARGE', 'XXXXXX', '6', '', 'Charges', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (1357, 'PCMN-BASE', 'PROD', 'XXXXXX', '7', '', 'Produits', '1'); -- -- Descriptif des plans comptables ES PCG08-PYME -- INSERT INTO llx_accounting_system (rowid, pcg_version, fk_pays, label, active) VALUES (4, 'PCG08-PYME', '4', 'The PYME accountancy spanish plan', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4001,'PCG08-PYME','FINANCIACION', 'XXXXXX', '1', '', 'Financiación básica', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4002,'PCG08-PYME','ACTIVO', 'XXXXXX', '2', '', 'Activo no corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4003,'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '3', '', 'Existencias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4004,'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4', '', 'Acreedores y deudores por operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4005,'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5', '', 'Cuentas financieras', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4006,'PCG08-PYME','COMPRAS_GASTOS','XXXXXX', '6', '', 'Compras y gastos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4007,'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7', '', 'Ventas e ingresos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4008, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '10', '4001', 'CAPITAL', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4009, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '100', '4008', 'Capital social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4010, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '101', '4008', 'Fondo social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4011, 'PCG08-PYME','FINANCIACION', 'CAPITAL', '102', '4008', 'Capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4012, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '103', '4008', 'Socios por desembolsos no exigidos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4013, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1030', '4012', 'Socios por desembolsos no exigidos capital social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4014, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1034', '4012', 'Socios por desembolsos no exigidos capital pendiente de inscripción', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4015, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '104', '4008', 'Socios por aportaciones no dineradas pendientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4016, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1040', '4015', 'Socios por aportaciones no dineradas pendientes capital social', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4017, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1044', '4015', 'Socios por aportaciones no dineradas pendientes capital pendiente de inscripción', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4018, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '108', '4008', 'Acciones o participaciones propias en situaciones especiales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4019, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '109', '4008', 'Acciones o participaciones propias para reducción de capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4020, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '11', '4001', 'Reservas y otros instrumentos de patrimonio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4021, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '110', '4020', 'Prima de emisión o asunción', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4022, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '111', '4020', 'Otros instrumentos de patrimonio neto', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4023, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1110', '4022', 'Patrimonio neto por emisión de instrumentos financieros compuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4024, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1111', '4022', 'Resto de instrumentos de patrimoio neto', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4025, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '112', '4020', 'Reserva legal', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4026, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '113', '4020', 'Reservas voluntarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4027, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '114', '4020', 'Reservas especiales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4028, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1140', '4027', 'Reservas para acciones o participaciones de la sociedad dominante', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4029, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1141', '4027', 'Reservas estatutarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4030, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1142', '4027', 'Reservas por capital amortizado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4031, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1143', '4027', 'Reservas por fondo de comercio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4032, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1144', '4028', 'Reservas por acciones propias aceptadas en garantía', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4033, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '115', '4020', 'Reservas por pérdidas y ganancias actuariales y otros ajustes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4034, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '118', '4020', 'Aportaciones de socios o propietarios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4035, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '119', '4020', 'Diferencias por ajuste del capital a euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4036, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '12', '4001', 'Resultados pendientes de aplicación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4037, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '120', '4036', 'Remanente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4038, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '121', '4036', 'Resultados negativos de ejercicios anteriores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4039, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '129', '4036', 'Resultado del ejercicio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4040, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '13', '4001', 'Subvenciones, donaciones y ajustes por cambio de valor', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4041, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '130', '4040', 'Subvenciones oficiales de capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4042, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '131', '4040', 'Donaciones y legados de capital', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4043, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '132', '4040', 'Otras subvenciones, donaciones y legados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4044, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '133', '4040', 'Ajustes por valoración en activos financieros disponibles para la venta', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4045, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '134', '4040', 'Operaciones de cobertura', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4046, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1340', '4045', 'Cobertura de flujos de efectivo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4047, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1341', '4045', 'Cobertura de una inversión neta en un negocio extranjero', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4048, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '135', '4040', 'Diferencias de conversión', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4049, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '136', '4040', 'Ajustes por valoración en activos no corrientes y grupos enajenables de elementos mantenidos para la venta', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4050, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '137', '4040', 'Ingresos fiscales a distribuir en varios ejercicios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4051, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1370', '4050', 'Ingresos fiscales por diferencias permanentes a distribuir en varios ejercicios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4052, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1371', '4050', 'Ingresos fiscales por deducciones y bonificaciones a distribuir en varios ejercicios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4053, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '14', '4001', 'Provisiones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4054, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '141', '4053', 'Provisión para impuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4055, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '142', '4053', 'Provisión para otras responsabilidades', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4056, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '143', '4053', 'Provisión por desmantelamiento, retiro o rehabilitación del inmovilizado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4057, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '145', '4053', 'Provisión para actuaciones medioambientales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4058, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '15', '4001', 'Deudas a largo plazo con características especiales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4059, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '150', '4058', 'Acciones o participaciones a largo plazo consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4060, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '153', '4058', 'Desembolsos no exigidos por acciones o participaciones consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4061, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1533', '4060', 'Desembolsos no exigidos empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4062, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1534', '4060', 'Desembolsos no exigidos empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4063, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1535', '4060', 'Desembolsos no exigidos otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4064, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1536', '4060', 'Otros desembolsos no exigidos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4065, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '154', '4058', 'Aportaciones no dinerarias pendientes por acciones o participaciones consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4066, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1543', '4065', 'Aportaciones no dinerarias pendientes empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4067, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1544', '4065', 'Aportaciones no dinerarias pendientes empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4068, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1545', '4065', 'Aportaciones no dinerarias pendientes otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4069, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1546', '4065', 'Otras aportaciones no dinerarias pendientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4070, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '16', '4001', 'Deudas a largo plazo con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4071, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '160', '4070', 'Deudas a largo plazo con entidades de crédito vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4072, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1603', '4071', 'Deudas a largo plazo con entidades de crédito empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4073, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1604', '4071', 'Deudas a largo plazo con entidades de crédito empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4074, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1605', '4071', 'Deudas a largo plazo con otras entidades de crédito vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4075, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '161', '4070', 'Proveedores de inmovilizado a largo plazo partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4076, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1613', '4075', 'Proveedores de inmovilizado a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4077, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1614', '4075', 'Proveedores de inmovilizado a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4078, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1615', '4075', 'Proveedores de inmovilizado a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4079, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '162', '4070', 'Acreedores por arrendamiento financiero a largo plazo partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4080, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1623', '4079', 'Acreedores por arrendamiento financiero a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4081, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1624', '4080', 'Acreedores por arrendamiento financiero a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4082, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1625', '4080', 'Acreedores por arrendamiento financiero a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4083, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '163', '4070', 'Otras deudas a largo plazo con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4084, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1633', '4083', 'Otras deudas a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4085, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1634', '4083', 'Otras deudas a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4086, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '1635', '4083', 'Otras deudas a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4087, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '17', '4001', 'Deudas a largo plazo por préstamos recibidos empresitos y otros conceptos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4088, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '170', '4087', 'Deudas a largo plazo con entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4089, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '171', '4087', 'Deudas a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4090, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '172', '4087', 'Deudas a largo plazo transformables en suvbenciones donaciones y legados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4091, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '173', '4087', 'Proveedores de inmovilizado a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4092, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '174', '4087', 'Acreedores por arrendamiento financiero a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4093, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '175', '4087', 'Efectos a pagar a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4094, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '176', '4087', 'Pasivos por derivados financieros a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4095, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '177', '4087', 'Obligaciones y bonos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4096, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '179', '4087', 'Deudas representadas en otros valores negociables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4097, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '18', '4001', 'Pasivos por fianzas garantias y otros conceptos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4098, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '180', '4097', 'Fianzas recibidas a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4099, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '181', '4097', 'Anticipos recibidos por ventas o prestaciones de servicios a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4100, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '185', '4097', 'Depositos recibidos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4101, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '19', '4001', 'Situaciones transitorias de financiación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4102, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '190', '4101', 'Acciones o participaciones emitidas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4103, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '192', '4101', 'Suscriptores de acciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4104, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '194', '4101', 'Capital emitido pendiente de inscripción', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4105, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '195', '4101', 'Acciones o participaciones emitidas consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4106, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '197', '4101', 'Suscriptores de acciones consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4107, 'PCG08-PYME','FINANCIACION', 'XXXXXX', '199', '4101', 'Acciones o participaciones emitidas consideradas como pasivos financieros pendientes de inscripción', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4108, 'PCG08-PYME','ACTIVO', 'XXXXXX', '20', '4002', 'Inmovilizaciones intangibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4109, 'PCG08-PYME','ACTIVO', 'XXXXXX', '200', '4108', 'Investigación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4110, 'PCG08-PYME','ACTIVO', 'XXXXXX', '201', '4108', 'Desarrollo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4111, 'PCG08-PYME','ACTIVO', 'XXXXXX', '202', '4108', 'Concesiones administrativas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4112, 'PCG08-PYME','ACTIVO', 'XXXXXX', '203', '4108', 'Propiedad industrial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4113, 'PCG08-PYME','ACTIVO', 'XXXXXX', '205', '4108', 'Derechos de transpaso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4114, 'PCG08-PYME','ACTIVO', 'XXXXXX', '206', '4108', 'Aplicaciones informáticas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4115, 'PCG08-PYME','ACTIVO', 'XXXXXX', '209', '4108', 'Anticipos para inmovilizaciones intangibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4116, 'PCG08-PYME','ACTIVO', 'XXXXXX', '21', '4002', 'Inmovilizaciones materiales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4117, 'PCG08-PYME','ACTIVO', 'XXXXXX', '210', '4116', 'Terrenos y bienes naturales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4118, 'PCG08-PYME','ACTIVO', 'XXXXXX', '211', '4116', 'Construcciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4119, 'PCG08-PYME','ACTIVO', 'XXXXXX', '212', '4116', 'Instalaciones técnicas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4120, 'PCG08-PYME','ACTIVO', 'XXXXXX', '213', '4116', 'Maquinaria', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4121, 'PCG08-PYME','ACTIVO', 'XXXXXX', '214', '4116', 'Utillaje', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4122, 'PCG08-PYME','ACTIVO', 'XXXXXX', '215', '4116', 'Otras instalaciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4123, 'PCG08-PYME','ACTIVO', 'XXXXXX', '216', '4116', 'Mobiliario', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4124, 'PCG08-PYME','ACTIVO', 'XXXXXX', '217', '4116', 'Equipos para procesos de información', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4125, 'PCG08-PYME','ACTIVO', 'XXXXXX', '218', '4116', 'Elementos de transporte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4126, 'PCG08-PYME','ACTIVO', 'XXXXXX', '219', '4116', 'Otro inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4127, 'PCG08-PYME','ACTIVO', 'XXXXXX', '22', '4002', 'Inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4128, 'PCG08-PYME','ACTIVO', 'XXXXXX', '220', '4127', 'Inversiones en terreons y bienes naturales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4129, 'PCG08-PYME','ACTIVO', 'XXXXXX', '221', '4127', 'Inversiones en construcciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4130, 'PCG08-PYME','ACTIVO', 'XXXXXX', '23', '4002', 'Inmovilizaciones materiales en curso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4131, 'PCG08-PYME','ACTIVO', 'XXXXXX', '230', '4130', 'Adaptación de terrenos y bienes naturales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4132, 'PCG08-PYME','ACTIVO', 'XXXXXX', '231', '4130', 'Construcciones en curso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4133, 'PCG08-PYME','ACTIVO', 'XXXXXX', '232', '4130', 'Instalaciones técnicas en montaje', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4134, 'PCG08-PYME','ACTIVO', 'XXXXXX', '233', '4130', 'Maquinaria en montaje', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4135, 'PCG08-PYME','ACTIVO', 'XXXXXX', '237', '4130', 'Equipos para procesos de información en montaje', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4136, 'PCG08-PYME','ACTIVO', 'XXXXXX', '239', '4130', 'Anticipos para inmovilizaciones materiales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4137, 'PCG08-PYME','ACTIVO', 'XXXXXX', '24', '4002', 'Inversiones financieras a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4138, 'PCG08-PYME','ACTIVO', 'XXXXXX', '240', '4137', 'Participaciones a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4139, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2403', '4138', 'Participaciones a largo plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4140, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2404', '4138', 'Participaciones a largo plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4141, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2405', '4138', 'Participaciones a largo plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4142, 'PCG08-PYME','ACTIVO', 'XXXXXX', '241', '4137', 'Valores representativos de deuda a largo plazo de partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4143, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2413', '4142', 'Valores representativos de deuda a largo plazo de empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4144, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2414', '4142', 'Valores representativos de deuda a largo plazo de empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4145, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2415', '4142', 'Valores representativos de deuda a largo plazo de otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4146, 'PCG08-PYME','ACTIVO', 'XXXXXX', '242', '4137', 'Créditos a largo plazo a partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4147, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2423', '4146', 'Créditos a largo plazo a empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4148, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2424', '4146', 'Créditos a largo plazo a empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4149, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2425', '4146', 'Créditos a largo plazo a otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4150, 'PCG08-PYME','ACTIVO', 'XXXXXX', '249', '4137', 'Desembolsos pendientes sobre participaciones a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4151, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2493', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4152, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2494', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4153, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2495', '4150', 'Desembolsos pendientes sobre participaciones a largo plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4154, 'PCG08-PYME','ACTIVO', 'XXXXXX', '25', '4002', 'Otras inversiones financieras a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4155, 'PCG08-PYME','ACTIVO', 'XXXXXX', '250', '4154', 'Inversiones financieras a largo plazo en instrumentos de patrimonio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4156, 'PCG08-PYME','ACTIVO', 'XXXXXX', '251', '4154', 'Valores representativos de deuda a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4157, 'PCG08-PYME','ACTIVO', 'XXXXXX', '252', '4154', 'Créditos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4158, 'PCG08-PYME','ACTIVO', 'XXXXXX', '253', '4154', 'Créditos a largo plazo por enajenación de inmovilizado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4159, 'PCG08-PYME','ACTIVO', 'XXXXXX', '254', '4154', 'Créditos a largo plazo al personal', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4160, 'PCG08-PYME','ACTIVO', 'XXXXXX', '255', '4154', 'Activos por derivados financieros a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4161, 'PCG08-PYME','ACTIVO', 'XXXXXX', '258', '4154', 'Imposiciones a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4162, 'PCG08-PYME','ACTIVO', 'XXXXXX', '259', '4154', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4163, 'PCG08-PYME','ACTIVO', 'XXXXXX', '26', '4002', 'Fianzas y depósitos constituidos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4164, 'PCG08-PYME','ACTIVO', 'XXXXXX', '260', '4163', 'Fianzas constituidas a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4165, 'PCG08-PYME','ACTIVO', 'XXXXXX', '261', '4163', 'Depósitos constituidos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4166, 'PCG08-PYME','ACTIVO', 'XXXXXX', '28', '4002', 'Amortización acumulada del inmovilizado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4167, 'PCG08-PYME','ACTIVO', 'XXXXXX', '280', '4166', 'Amortización acumulado del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4168, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2800', '4167', 'Amortización acumulada de investigación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4169, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2801', '4167', 'Amortización acumulada de desarrollo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4170, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2802', '4167', 'Amortización acumulada de concesiones administrativas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4171, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2803', '4167', 'Amortización acumulada de propiedad industrial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4172, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2805', '4167', 'Amortización acumulada de derechos de transpaso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4173, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2806', '4167', 'Amortización acumulada de aplicaciones informáticas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4174, 'PCG08-PYME','ACTIVO', 'XXXXXX', '281', '4166', 'Amortización acumulado del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4175, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2811', '4174', 'Amortización acumulada de construcciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4176, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2812', '4174', 'Amortización acumulada de instalaciones técnicas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4177, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2813', '4174', 'Amortización acumulada de maquinaria', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4178, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2814', '4174', 'Amortización acumulada de utillaje', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4179, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2815', '4174', 'Amortización acumulada de otras instalaciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4180, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2816', '4174', 'Amortización acumulada de mobiliario', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4181, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2817', '4174', 'Amortización acumulada de equipos para proceso de información', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4182, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2818', '4174', 'Amortización acumulada de elementos de transporte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4183, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2819', '4175', 'Amortización acumulada de otro inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4184, 'PCG08-PYME','ACTIVO', 'XXXXXX', '282', '4166', 'Amortización acumulada de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4185, 'PCG08-PYME','ACTIVO', 'XXXXXX', '29', '4002', 'Deterioro de valor de activos no corrientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4186, 'PCG08-PYME','ACTIVO', 'XXXXXX', '290', '4185', 'Deterioro de valor del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4187, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2900', '4186', 'Deterioro de valor de investigación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4188, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2901', '4186', 'Deterioro de valor de desarrollo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4189, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2902', '4186', 'Deterioro de valor de concesiones administrativas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4190, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2903', '4186', 'Deterioro de valor de propiedad industrial', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4191, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2905', '4186', 'Deterioro de valor de derechos de transpaso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4192, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2906', '4186', 'Deterioro de valor de aplicaciones informáticas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4193, 'PCG08-PYME','ACTIVO', 'XXXXXX', '291', '4185', 'Deterioro de valor del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4194, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2910', '4193', 'Deterioro de valor de terrenos y bienes naturales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4195, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2911', '4193', 'Deterioro de valor de construcciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4196, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2912', '4193', 'Deterioro de valor de instalaciones técnicas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4197, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2913', '4193', 'Deterioro de valor de maquinaria', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4198, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2914', '4193', 'Deterioro de valor de utillajes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4199, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2915', '4194', 'Deterioro de valor de otras instalaciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4200, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2916', '4194', 'Deterioro de valor de mobiliario', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4201, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2917', '4194', 'Deterioro de valor de equipos para proceso de información', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4202, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2918', '4194', 'Deterioro de valor de elementos de transporte', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4203, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2919', '4194', 'Deterioro de valor de otro inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4204, 'PCG08-PYME','ACTIVO', 'XXXXXX', '292', '4185', 'Deterioro de valor de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4205, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2920', '4204', 'Deterioro de valor de terrenos y bienes naturales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4206, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2921', '4204', 'Deterioro de valor de construcciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4207, 'PCG08-PYME','ACTIVO', 'XXXXXX', '293', '4185', 'Deterioro de valor de participaciones a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4208, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2933', '4207', 'Deterioro de valor de participaciones a largo plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4209, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2934', '4207', 'Deterioro de valor de sobre participaciones a largo plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4210, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2935', '4207', 'Deterioro de valor de sobre participaciones a largo plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4211, 'PCG08-PYME','ACTIVO', 'XXXXXX', '294', '4185', 'Deterioro de valor de valores representativos de deuda a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4212, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2943', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4213, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2944', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4214, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2945', '4211', 'Deterioro de valor de valores representativos de deuda a largo plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4215, 'PCG08-PYME','ACTIVO', 'XXXXXX', '295', '4185', 'Deterioro de valor de créditos a largo plazo a partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4216, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2953', '4215', 'Deterioro de valor de créditos a largo plazo a empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4217, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2954', '4215', 'Deterioro de valor de créditos a largo plazo a empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4218, 'PCG08-PYME','ACTIVO', 'XXXXXX', '2955', '4215', 'Deterioro de valor de créditos a largo plazo a otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4219, 'PCG08-PYME','ACTIVO', 'XXXXXX', '296', '4185', 'Deterioro de valor de participaciones en el patrimonio netoa largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4220, 'PCG08-PYME','ACTIVO', 'XXXXXX', '297', '4185', 'Deterioro de valor de valores representativos de deuda a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4221, 'PCG08-PYME','ACTIVO', 'XXXXXX', '298', '4185', 'Deterioro de valor de créditos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4222, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '30', '4003', 'Comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4223, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '300', '4222', 'Mercaderías A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4224, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '301', '4222', 'Mercaderías B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4225, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '31', '4003', 'Materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4226, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '310', '4225', 'Materias primas A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4227, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '311', '4225', 'Materias primas B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4228, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '32', '4003', 'Otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4229, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '320', '4228', 'Elementos y conjuntos incorporables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4230, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '321', '4228', 'Combustibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4231, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '322', '4228', 'Repuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4232, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '325', '4228', 'Materiales diversos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4233, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '326', '4228', 'Embalajes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4234, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '327', '4228', 'Envases', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4235, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '328', '4229', 'Material de oficina', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4236, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '33', '4003', 'Productos en curso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4237, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '330', '4236', 'Productos en curos A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4238, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '331', '4236', 'Productos en curso B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4239, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '34', '4003', 'Productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4240, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '340', '4239', 'Productos semiterminados A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4241, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '341', '4239', 'Productos semiterminados B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4242, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '35', '4003', 'Productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4243, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '350', '4242', 'Productos terminados A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4244, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '351', '4242', 'Productos terminados B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4245, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '36', '4003', 'Subproductos, residuos y materiales recuperados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4246, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '360', '4245', 'Subproductos A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4247, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '361', '4245', 'Subproductos B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4248, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '365', '4245', 'Residuos A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4249, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '366', '4245', 'Residuos B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4250, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '368', '4245', 'Materiales recuperados A', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4251, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '369', '4245', 'Materiales recuperados B', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4252, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '39', '4003', 'Deterioro de valor de las existencias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4253, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '390', '4252', 'Deterioro de valor de las mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4254, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '391', '4252', 'Deterioro de valor de las materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4255, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '392', '4252', 'Deterioro de valor de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4256, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '393', '4252', 'Deterioro de valor de los productos en curso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4257, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '394', '4252', 'Deterioro de valor de los productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4258, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '395', '4252', 'Deterioro de valor de los productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4259, 'PCG08-PYME','EXISTENCIAS', 'XXXXXX', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4260, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4261, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4262, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4000', '4261', 'Proveedores euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4263, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4004', '4261', 'Proveedores moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4264, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4265, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '401', '4260', 'Proveedores efectos comerciales a pagar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4266, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '403', '4260', 'Proveedores empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4267, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4030', '4266', 'Proveedores empresas del grupo euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4268, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4031', '4266', 'Efectos comerciales a pagar empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4269, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4034', '4266', 'Proveedores empresas del grupo moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4270, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4036', '4266', 'Envases y embalajes a devolver a proveedores empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4271, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4039', '4266', 'Proveedores empresas del grupo facturas pendientes de recibir o de formalizar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4272, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '404', '4260', 'Proveedores empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4273, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '405', '4260', 'Proveedores otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4274, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '406', '4260', 'Envases y embalajes a devolver a proveedores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4275, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '407', '4260', 'Anticipos a proveedores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4276, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '41', '4004', 'Acreedores varios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4277, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '410', '4276', 'Acreedores por prestaciones de servicios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4278, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4100', '4277', 'Acreedores por prestaciones de servicios euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4279, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4104', '4277', 'Acreedores por prestaciones de servicios moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4280, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4281, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '411', '4276', 'Acreedores efectos comerciales a pagar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4282, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '419', '4276', 'Acreedores por operaciones en común', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4283, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4284, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4285, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4300', '4284', 'Clientes euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4286, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4304', '4284', 'Clientes moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4287, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4309', '4284', 'Clientes facturas pendientes de formalizar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4288, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '431', '4283', 'Clientes efectos comerciales a cobrar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4289, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4310', '4288', 'Efectos comerciales en cartera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4290, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4311', '4288', 'Efectos comerciales descontados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4291, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4312', '4288', 'Efectos comerciales en gestión de cobro', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4292, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4315', '4288', 'Efectos comerciales impagados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4293, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '432', '4283', 'Clientes operaciones de factoring', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4294, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '433', '4283', 'Clientes empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4295, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4330', '4294', 'Clientes empresas del grupo euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4296, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4331', '4294', 'Efectos comerciales a cobrar empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4297, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4332', '4294', 'Clientes empresas del grupo operaciones de factoring', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4298, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4334', '4294', 'Clientes empresas del grupo moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4299, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4336', '4294', 'Clientes empresas del grupo dudoso cobro', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4300, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4337', '4294', 'Envases y embalajes a devolver a clientes empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4301, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4339', '4294', 'Clientes empresas del grupo facturas pendientes de formalizar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4302, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '434', '4283', 'Clientes empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4303, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '435', '4283', 'Clientes otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4304, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '436', '4283', 'Clientes de dudoso cobro', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4305, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '437', '4283', 'Envases y embalajes a devolver por clientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4306, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '438', '4283', 'Anticipos de clientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4307, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '44', '4004', 'Deudores varios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4308, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '440', '4307', 'Deudores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4309, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4400', '4308', 'Deudores euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4310, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4404', '4308', 'Deudores moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4311, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4409', '4308', 'Deudores facturas pendientes de formalizar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4312, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '441', '4307', 'Deudores efectos comerciales a cobrar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4313, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4410', '4312', 'Deudores efectos comerciales en cartera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4314, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4411', '4312', 'Deudores efectos comerciales descontados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4315, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4412', '4312', 'Deudores efectos comerciales en gestión de cobro', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4316, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4415', '4312', 'Deudores efectos comerciales impagados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4317, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '446', '4307', 'Deudores de dusoso cobro', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4318, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '449', '4307', 'Deudores por operaciones en común', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4319, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '46', '4004', 'Personal', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4320, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '460', '4319', 'Anticipos de renumeraciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4321, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '465', '4319', 'Renumeraciones pendientes de pago', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4322, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '47', '4004', 'Administraciones Públicas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4323, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '470', '4322', 'Hacienda Pública deudora por diversos conceptos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4324, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4700', '4323', 'Hacienda Pública deudora por IVA', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4325, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4708', '4323', 'Hacienda Pública deudora por subvenciones concedidas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4326, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4709', '4323', 'Hacienda Pública deudora por devolución de impuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4327, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '471', '4322', 'Organismos de la Seguridad Social deudores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4328, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '472', '4322', 'Hacienda Pública IVA soportado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4329, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '473', '4322', 'Hacienda Pública retenciones y pagos a cuenta', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4330, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '474', '4322', 'Activos por impuesto diferido', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4331, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4740', '4330', 'Activos por diferencias temporarias deducibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4332, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4742', '4330', 'Derechos por deducciones y bonificaciones pendientes de aplicar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4333, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4745', '4330', 'Crédito por pérdidasa compensar del ejercicio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4334, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '475', '4322', 'Hacienda Pública acreedora por conceptos fiscales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4335, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4750', '4334', 'Hacienda Pública acreedora por IVA', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4336, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4751', '4334', 'Hacienda Pública acreedora por retenciones practicadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4337, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4752', '4334', 'Hacienda Pública acreedora por impuesto sobre sociedades', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4338, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4758', '4334', 'Hacienda Pública acreedora por subvenciones a integrar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4339, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '476', '4322', 'Organismos de la Seguridad Social acreedores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4340, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '477', '4322', 'Hacienda Pública IVA repercutido', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4341, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '479', '4322', 'Pasivos por diferencias temporarias imponibles', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4342, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '48', '4004', 'Ajustes por periodificación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4343, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '480', '4342', 'Gastos anticipados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4344, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '485', '4342', 'Ingresos anticipados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4345, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '49', '4004', 'Deterioro de valor de créditos comerciales y provisiones a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4346, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '490', '4345', 'Deterioro de valor de créditos por operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4347, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '493', '4345', 'Deterioro de valor de créditos por operaciones comerciales con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4348, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4933', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4349, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4934', '4347', 'Deterioro de valor de créditos por operaciones comerciales con empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4350, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4935', '4347', 'Deterioro de valor de créditos por operaciones comerciales con otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4351, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '499', '4345', 'Provisiones por operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4352, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4994', '4351', 'Provisión para contratos anerosos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4353, 'PCG08-PYME','ACREEDORES_DEUDORES', 'XXXXXX', '4999', '4351', 'Provisión para otras operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4354, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '50', '4005', 'Emprésitos deudas con características especiales y otras emisiones análogas a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4355, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '500', '4354', 'Obligaciones y bonos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4356, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '502', '4354', 'Acciones o participaciones a corto plazo consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4357, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '505', '4354', 'Deudas representadas en otros valores negociables a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4358, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '506', '4354', 'Intereses a corto plazo de emprésitos y otras emisiones analógicas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4359, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '507', '4354', 'Dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4360, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '509', '4354', 'Valores negociables amortizados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4361, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5090', '4360', 'Obligaciones y bonos amortizados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4362, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5095', '4360', 'Otros valores negociables amortizados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4363, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '51', '4005', 'Deudas a corto plazo con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4364, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '510', '4363', 'Deudas a corto plazo con entidades de crédito vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4365, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5103', '4364', 'Deudas a corto plazo con entidades de crédito empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4366, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5104', '4364', 'Deudas a corto plazo con entidades de crédito empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4367, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5105', '4364', 'Deudas a corto plazo con otras entidades de crédito vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4368, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '511', '4363', 'Proveedores de inmovilizado a corto plazo partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4369, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5113', '4368', 'Proveedores de inmovilizado a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4370, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5114', '4368', 'Proveedores de inmovilizado a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4371, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5115', '4368', 'Proveedores de inmovilizado a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4372, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '512', '4363', 'Acreedores por arrendamiento financiero a corto plazo partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4373, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5123', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4374, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5124', '4372', 'Acreedores por arrendamiento financiero a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4375, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5125', '4372', 'Acreedores por arrendamiento financiero a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4376, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '513', '4363', 'Otras deudas a corto plazo con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4377, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5133', '4376', 'Otras deudas a corto plazo con empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4378, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5134', '4376', 'Otras deudas a corto plazo con empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4379, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5135', '4376', 'Otras deudas a corto plazo con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4380, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '514', '4363', 'Intereses a corto plazo con partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4381, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5143', '4380', 'Intereses a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4382, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5144', '4380', 'Intereses a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4383, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5145', '4380', 'Intereses deudas a corto plazo partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4384, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '52', '4005', 'Deudas a corto plazo por préstamos recibidos y otros conceptos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4385, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '520', '4384', 'Deudas a corto plazo con entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4386, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5200', '4385', 'Préstamos a corto plazo de entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4387, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5201', '4385', 'Deudas a corto plazo por crédito dispuesto', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4388, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5208', '4385', 'Deudas por efectos descontados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4389, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5209', '4385', 'Deudas por operaciones de factoring', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4390, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '521', '4384', 'Deudas a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4391, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '522', '4384', 'Deudas a corto plazo transformables en subvenciones donaciones y legados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4392, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '523', '4384', 'Proveedores de inmovilizado a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4393, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '526', '4384', 'Dividendo activo a pagar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4394, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '527', '4384', 'Intereses a corto plazo de deudas con entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4395, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '528', '4384', 'Intereses a corto plazo de deudas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4396, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '529', '4384', 'Provisiones a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4397, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5291', '4396', 'Provisión a corto plazo para impuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4398, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5292', '4396', 'Provisión a corto plazo para otras responsabilidades', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4399, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5293', '4396', 'Provisión a corto plazo por desmantelamiento retiro o rehabilitación del inmovilizado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4400, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5295', '4396', 'Provisión a corto plazo para actuaciones medioambientales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4401, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '53', '4005', 'Inversiones financieras a corto plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4402, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '530', '4401', 'Participaciones a corto plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4403, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5303', '4402', 'Participaciones a corto plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4404, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5304', '4402', 'Participaciones a corto plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4405, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5305', '4402', 'Participaciones a corto plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4406, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '531', '4401', 'Valores representativos de deuda a corto plazo de partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4407, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5313', '4406', 'Valores representativos de deuda a corto plazo de empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4408, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5314', '4406', 'Valores representativos de deuda a corto plazo de empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4409, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5315', '4406', 'Valores representativos de deuda a corto plazo de otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4410, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '532', '4401', 'Créditos a corto plazo a partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4411, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5323', '4410', 'Créditos a corto plazo a empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4412, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5324', '4410', 'Créditos a corto plazo a empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4413, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5325', '4410', 'Créditos a corto plazo a otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4414, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '533', '4401', 'Intereses a corto plazo de valores representativos de deuda de partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4415, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5333', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4416, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5334', '4414', 'Intereses a corto plazo de valores representativos de deuda en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4417, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5335', '4414', 'Intereses a corto plazo de valores representativos de deuda en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4418, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '534', '4401', 'Intereses a corto plazo de créditos a partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4419, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5343', '4418', 'Intereses a corto plazo de créditos a empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4420, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5344', '4418', 'Intereses a corto plazo de créditos a empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4421, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5345', '4418', 'Intereses a corto plazo de créditos a otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4422, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '535', '4401', 'Dividendo a cobrar de inversiones financieras en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4423, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5353', '4422', 'Dividendo a cobrar de empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4424, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5354', '4422', 'Dividendo a cobrar de empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4425, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5355', '4422', 'Dividendo a cobrar de otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4426, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '539', '4401', 'Desembolsos pendientes sobre participaciones a corto plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4427, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5393', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4428, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5394', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4429, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5395', '4426', 'Desembolsos pendientes sobre participaciones a corto plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4430, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '54', '4005', 'Otras inversiones financieras a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4431, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '540', '4430', 'Inversiones financieras a corto plazo en instrumentos de patrimonio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4432, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '541', '4430', 'Valores representativos de deuda a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4433, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '542', '4430', 'Créditos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4434, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '543', '4430', 'Créditos a corto plazo por enejenación de inmovilizado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4435, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '544', '4430', 'Créditos a corto plazo al personal', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4436, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '545', '4430', 'Dividendo a cobrar', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4437, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '546', '4430', 'Intereses a corto plazo de valores reprsentativos de deuda', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4438, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '547', '4430', 'Intereses a corto plazo de créditos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4439, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '548', '4430', 'Imposiciones a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4440, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '549', '4430', 'Desembolsos pendientes sobre participaciones en el patrimonio neto a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4441, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '55', '4005', 'Otras cuentas no bancarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4442, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '550', '4441', 'Titular de la explotación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4443, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '551', '4441', 'Cuenta corriente con socios y administradores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4444, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '552', '4441', 'Cuenta corriente otras personas y entidades vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4445, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5523', '4444', 'Cuenta corriente con empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4446, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5524', '4444', 'Cuenta corriente con empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4447, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5525', '4444', 'Cuenta corriente con otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4448, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '554', '4441', 'Cuenta corriente con uniones temporales de empresas y comunidades de bienes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4449, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '555', '4441', 'Partidas pendientes de aplicación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4450, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '556', '4441', 'Desembolsos exigidos sobre participaciones en el patrimonio neto', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4451, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5563', '4450', 'Desembolsos exigidos sobre participaciones empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4452, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5564', '4450', 'Desembolsos exigidos sobre participaciones empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4453, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5565', '4450', 'Desembolsos exigidos sobre participaciones otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4454, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5566', '4450', 'Desembolsos exigidos sobre participaciones otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4455, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '557', '4441', 'Dividendo activo a cuenta', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4456, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '558', '4441', 'Socios por desembolsos exigidos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4457, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5580', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones ordinarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4458, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5585', '4456', 'Socios por desembolsos exigidos sobre acciones o participaciones consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4459, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '559', '4441', 'Derivados financieros a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4460, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5590', '4459', 'Activos por derivados financieros a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4461, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5595', '4459', 'Pasivos por derivados financieros a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4462, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '56', '4005', 'Finanzas y depósitos recibidos y constituidos a corto plazo y ajustes por periodificación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4463, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '560', '4462', 'Finanzas recibidas a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4464, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '561', '4462', 'Depósitos recibidos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4465, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '565', '4462', 'Finanzas constituidas a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4466, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '566', '4462', 'Depósitos constituidos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4467, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '567', '4462', 'Intereses pagados por anticipado', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4468, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '568', '4462', 'Intereses cobrados a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4469, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '57', '4005', 'Tesorería', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4470, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'CAJA', '570', '4469', 'Caja euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4471, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '571', '4469', 'Caja moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4472, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4473, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4474, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4475, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4476, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '576', '4469', 'Inversiones a corto plazo de gran liquidez', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4477, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '59', '4005', 'Deterioro del valor de las inversiones financieras a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4478, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '593', '4477', 'Deterioro del valor de participaciones a corto plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4479, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5933', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4480, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5934', '4478', 'Deterioro del valor de participaciones a corto plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4481, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5935', '4478', 'Deterioro del valor de participaciones a corto plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4482, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '594', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4483, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5943', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4484, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5944', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4485, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5945', '4482', 'Deterioro del valor de valores representativos de deuda a corto plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4486, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '595', '4477', 'Deterioro del valor de créditos a corto plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4487, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5953', '4486', 'Deterioro del valor de créditos a corto plazo en empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4488, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5954', '4486', 'Deterioro del valor de créditos a corto plazo en empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4489, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '5955', '4486', 'Deterioro del valor de créditos a corto plazo en otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4490, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '596', '4477', 'Deterioro del valor de participaciones a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4491, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '597', '4477', 'Deterioro del valor de valores representativos de deuda a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4492, 'PCG08-PYME','CUENTAS_FINANCIERAS', 'XXXXXX', '598', '4477', 'Deterioro de valor de créditos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4493, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '60', '4006', 'Compras', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4494, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '600', '4493', 'Compras de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4495, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '601', '4493', 'Compras de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4496, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '602', '4493', 'Compras de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4497, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '606', '4493', 'Descuentos sobre compras por pronto pago', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4498, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6060', '4497', 'Descuentos sobre compras por pronto pago de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4499, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6061', '4497', 'Descuentos sobre compras por pronto pago de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4500, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6062', '4497', 'Descuentos sobre compras por pronto pago de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4501, 'PCG08-PYME','COMPRAS_GASTOS', 'COMPRAS', '607', '4493', 'Trabajos realizados por otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4502, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '608', '4493', 'Devoluciones de compras y operaciones similares', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4503, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6080', '4502', 'Devoluciones de compras de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4504, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6081', '4502', 'Devoluciones de compras de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4505, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6082', '4502', 'Devoluciones de compras de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4506, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '609', '4493', 'Rappels por compras', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4507, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6090', '4506', 'Rappels por compras de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4508, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6091', '4506', 'Rappels por compras de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4509, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6092', '4506', 'Rappels por compras de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4510, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '61', '4006', 'Variación de existencias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4511, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '610', '4510', 'Variación de existencias de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4512, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '611', '4510', 'Variación de existencias de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4513, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '612', '4510', 'Variación de existencias de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4514, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '62', '4006', 'Servicios exteriores', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4515, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '620', '4514', 'Gastos en investigación y desarrollo del ejercicio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4516, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '621', '4514', 'Arrendamientos y cánones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4517, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '622', '4514', 'Reparaciones y conservación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4518, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '623', '4514', 'Servicios profesionales independientes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4519, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '624', '4514', 'Transportes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4520, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '625', '4514', 'Primas de seguros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4521, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '626', '4514', 'Servicios bancarios y similares', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4522, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '627', '4514', 'Publicidad, propaganda y relaciones públicas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4523, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '628', '4514', 'Suministros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4524, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '629', '4514', 'Otros servicios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4525, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '63', '4006', 'Tributos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4526, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '630', '4525', 'Impuesto sobre benecifios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4527, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6300', '4526', 'Impuesto corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4528, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6301', '4526', 'Impuesto diferido', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4529, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '631', '4525', 'Otros tributos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4530, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '633', '4525', 'Ajustes negativos en la imposición sobre beneficios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4531, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '634', '4525', 'Ajustes negativos en la imposición indirecta', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4532, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6341', '4531', 'Ajustes negativos en IVA de activo corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4533, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6342', '4531', 'Ajustes negativos en IVA de inversiones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4534, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '636', '4525', 'Devolución de impuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4535, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '638', '4525', 'Ajustes positivos en la imposición sobre beneficios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4536, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '639', '4525', 'Ajustes positivos en la imposición directa', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4537, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6391', '4536', 'Ajustes positivos en IVA de activo corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4538, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6392', '4536', 'Ajustes positivos en IVA de inversiones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4539, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '64', '4006', 'Gastos de personal', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4540, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '640', '4539', 'Sueldos y salarios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4541, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '641', '4539', 'Indemnizaciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4542, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '642', '4539', 'Seguridad social a cargo de la empresa', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4543, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '649', '4539', 'Otros gastos sociales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4544, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '65', '4006', 'Otros gastos de gestión', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4545, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '650', '4544', 'Pérdidas de créditos comerciales incobrables', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4546, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '651', '4544', 'Resultados de operaciones en común', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4547, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6510', '4546', 'Beneficio transferido gestor', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4548, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6511', '4546', 'Pérdida soportada participe o asociado no gestor', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4549, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '659', '4544', 'Otras pérdidas en gestión corriente', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4550, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '66', '4006', 'Gastos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4551, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '660', '4550', 'Gastos financieros por actualización de provisiones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4552, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '661', '4550', 'Intereses de obligaciones y bonos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4553, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6610', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4554, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6611', '4452', 'Intereses de obligaciones y bonos a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4555, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6612', '4452', 'Intereses de obligaciones y bonos a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4556, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6613', '4452', 'Intereses de obligaciones y bonos a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4557, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6615', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4558, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6616', '4452', 'Intereses de obligaciones y bonos a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4559, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6617', '4452', 'Intereses de obligaciones y bonos a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4560, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6618', '4452', 'Intereses de obligaciones y bonos a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4561, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '662', '4550', 'Intereses de deudas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4562, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6620', '4561', 'Intereses de deudas empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4563, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6621', '4561', 'Intereses de deudas empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4564, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6622', '4561', 'Intereses de deudas otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4565, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6623', '4561', 'Intereses de deudas con entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4566, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6624', '4561', 'Intereses de deudas otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4567, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '663', '4550', 'Pérdidas por valorización de activos y pasivos financieros por su valor razonable', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4568, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '664', '4550', 'Gastos por dividendos de acciones o participaciones consideradas como pasivos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4569, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6640', '4568', 'Dividendos de pasivos empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4570, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6641', '4568', 'Dividendos de pasivos empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4571, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6642', '4568', 'Dividendos de pasivos otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4572, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6643', '4568', 'Dividendos de pasivos otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4573, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '665', '4550', 'Intereses por descuento de efectos y operaciones de factoring', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4574, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6650', '4573', 'Intereses por descuento de efectos en entidades de crédito del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4575, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6651', '4573', 'Intereses por descuento de efectos en entidades de crédito asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4576, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6652', '4573', 'Intereses por descuento de efectos en entidades de crédito vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4577, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6653', '4573', 'Intereses por descuento de efectos en otras entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4578, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6654', '4573', 'Intereses por operaciones de factoring con entidades de crédito del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4579, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6655', '4573', 'Intereses por operaciones de factoring con entidades de crédito asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4580, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6656', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4581, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6657', '4573', 'Intereses por operaciones de factoring con otras entidades de crédito', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4582, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '666', '4550', 'Pérdidas en participaciones y valores representativos de deuda', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4583, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6660', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4584, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6661', '4582', 'Pérdidas en valores representativos de deuda a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4585, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6662', '4582', 'Pérdidas en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4586, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6663', '4582', 'Pérdidas en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4587, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6665', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4588, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6666', '4582', 'Pérdidas en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4589, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6667', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4590, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6668', '4582', 'Pérdidas en valores representativos de deuda a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4591, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '667', '4550', 'Pérdidas de créditos no comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4592, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6670', '4591', 'Pérdidas de créditos a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4593, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6671', '4591', 'Pérdidas de créditos a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4594, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6672', '4591', 'Pérdidas de créditos a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4595, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6673', '4591', 'Pérdidas de créditos a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4596, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6675', '4591', 'Pérdidas de créditos a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4597, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6676', '4591', 'Pérdidas de créditos a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4598, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6677', '4591', 'Pérdidas de créditos a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4599, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6678', '4591', 'Pérdidas de créditos a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4600, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '668', '4550', 'Diferencias negativas de cambio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4601, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '669', '4550', 'Otros gastos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4602, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '67', '4006', 'Pérdidas procedentes de activos no corrientes y gastos excepcionales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4603, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '670', '4602', 'Pérdidas procedentes del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4604, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '671', '4602', 'Pérdidas procedentes del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4605, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '672', '4602', 'Pérdidas procedentes de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4607, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '673', '4602', 'Pérdidas procedentes de participaciones a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4608, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6733', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4609, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6734', '4607', 'Pérdidas procedentes de participaciones a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4610, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6735', '4607', 'Pérdidas procedentes de participaciones a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4611, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '675', '4602', 'Pérdidas por operaciones con obligaciones propias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4612, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '678', '4602', 'Gastos excepcionales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4613, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '68', '4006', 'Dotaciones para amortizaciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4614, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '680', '4613', 'Amortización del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4615, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '681', '4613', 'Amortización del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4616, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '682', '4613', 'Amortización de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4617, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '69', '4006', 'Pérdidas por deterioro y otras dotaciones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4618, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '690', '4617', 'Pérdidas por deterioro del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4619, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '691', '4617', 'Pérdidas por deterioro del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4620, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '692', '4617', 'Pérdidas por deterioro de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4621, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '693', '4617', 'Pérdidas por deterioro de existencias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4622, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6930', '4621', 'Pérdidas por deterioro de productos terminados y en curso de fabricación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4623, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6931', '4621', 'Pérdidas por deterioro de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4624, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6932', '4621', 'Pérdidas por deterioro de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4625, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6933', '4621', 'Pérdidas por deterioro de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4626, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '694', '4617', 'Pérdidas por deterioro de créditos por operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4627, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '695', '4617', 'Dotación a la provisión por operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4628, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6954', '4627', 'Dotación a la provisión por contratos onerosos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4629, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6959', '4628', 'Dotación a la provisión para otras operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4630, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '696', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4631, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6960', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4632, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6961', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4633, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6962', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4634, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6963', '4630', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4635, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6965', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4636, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6966', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4637, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6967', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4638, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6968', '4630', 'Pérdidas por deterioro en valores representativos de deuda a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4639, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '697', '4617', 'Pérdidas por deterioro de créditos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4640, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6970', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4641, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6971', '4639', 'Pérdidas por deterioro de créditos a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4642, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6972', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4643, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6973', '4639', 'Pérdidas por deterioro de créditos a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4644, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '698', '4617', 'Pérdidas por deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4645, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6980', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4646, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6981', '4644', 'Pérdidas por deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4647, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6985', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4648, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6986', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4649, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6988', '4644', 'Pérdidas por deterioro en valores representativos de deuda a corto plazo de otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4650, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '699', '4617', 'Pérdidas por deterioro de crédito a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4651, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6990', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4652, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6991', '4650', 'Pérdidas por deterioro de crédito a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4653, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6992', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4654, 'PCG08-PYME','COMPRAS_GASTOS', 'XXXXXX', '6993', '4650', 'Pérdidas por deterioro de crédito a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4655, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '70', '4007', 'Ventas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4656, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '700', '4655', 'Ventas de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4657, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '701', '4655', 'Ventas de productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4658, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '702', '4655', 'Ventas de productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4659, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '703', '4655', 'Ventas de subproductos y residuos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4660, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '704', '4655', 'Ventas de envases y embalajes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4661, 'PCG08-PYME','VENTAS_E_INGRESOS', 'VENTAS', '705', '4655', 'Prestaciones de servicios', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4662, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '706', '4655', 'Descuentos sobre ventas por pronto pago', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4663, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7060', '4662', 'Descuentos sobre ventas por pronto pago de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4664, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7061', '4662', 'Descuentos sobre ventas por pronto pago de productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4665, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7062', '4662', 'Descuentos sobre ventas por pronto pago de productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4666, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7063', '4662', 'Descuentos sobre ventas por pronto pago de subproductos y residuos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4667, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '708', '4655', 'Devoluciones de ventas y operacioes similares', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4668, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7080', '4667', 'Devoluciones de ventas de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4669, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7081', '4667', 'Devoluciones de ventas de productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4670, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7082', '4667', 'Devoluciones de ventas de productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4671, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7083', '4667', 'Devoluciones de ventas de subproductos y residuos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4672, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7084', '4667', 'Devoluciones de ventas de envases y embalajes', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4673, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '71', '4007', 'Variación de existencias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4674, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '710', '4673', 'Variación de existencias de productos en curso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4675, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '711', '4673', 'Variación de existencias de productos semiterminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4676, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '712', '4673', 'Variación de existencias de productos terminados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4677, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '713', '4673', 'Variación de existencias de subproductos, residuos y materiales recuperados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4678, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '73', '4007', 'Trabajos realizados para la empresa', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4679, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '730', '4678', 'Trabajos realizados para el inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4680, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '731', '4678', 'Trabajos realizados para el inmovilizado tangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4681, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '732', '4678', 'Trabajos realizados en inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4682, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '733', '4678', 'Trabajos realizados para el inmovilizado material en curso', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4683, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '74', '4007', 'Subvenciones, donaciones y legados', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4684, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '740', '4683', 'Subvenciones, donaciones y legados a la explotación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4685, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '746', '4683', 'Subvenciones, donaciones y legados de capital transferidos al resultado del ejercicio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4686, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '747', '4683', 'Otras subvenciones, donaciones y legados transferidos al resultado del ejercicio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4687, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '75', '4007', 'Otros ingresos de gestión', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4688, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '751', '4687', 'Resultados de operaciones en común', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4689, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7510', '4688', 'Pérdida transferida gestor', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4690, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7511', '4688', 'Beneficio atribuido participe o asociado no gestor', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4691, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '752', '4687', 'Ingreso por arrendamiento', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4692, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '753', '4687', 'Ingresos de propiedad industrial cedida en explotación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4693, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '754', '4687', 'Ingresos por comisiones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4694, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '755', '4687', 'Ingresos por servicios al personal', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4695, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '759', '4687', 'Ingresos por servicios diversos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4696, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76', '4007', 'Ingresos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4697, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '760', '4696', 'Ingresos de participaciones en instrumentos de patrimonio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4698, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7600', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4699, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7601', '4697', 'Ingresos de participaciones en instrumentos de patrimonio empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4700, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7602', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras partes asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4701, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7603', '4697', 'Ingresos de participaciones en instrumentos de patrimonio otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4702, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '761', '4696', 'Ingresos de valores representativos de deuda', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4703, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7610', '4702', 'Ingresos de valores representativos de deuda empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4704, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7611', '4702', 'Ingresos de valores representativos de deuda empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4705, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7612', '4702', 'Ingresos de valores representativos de deuda otras partes asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4706, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7613', '4702', 'Ingresos de valores representativos de deuda otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4707, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '762', '4696', 'Ingresos de créditos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4708, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7620', '4707', 'Ingresos de créditos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4709, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76200', '4708', 'Ingresos de crédito a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4710, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76201', '4708', 'Ingresos de crédito a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4711, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76202', '4708', 'Ingresos de crédito a largo plazo otras partes asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4712, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76203', '4708', 'Ingresos de crédito a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4713, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7621', '4707', 'Ingresos de créditos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4714, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76210', '4713', 'Ingresos de crédito a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4715, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76211', '4713', 'Ingresos de crédito a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4716, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76212', '4713', 'Ingresos de crédito a corto plazo otras partes asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4717, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '76213', '4713', 'Ingresos de crédito a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4718, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '763', '4696', 'Beneficios por valorización de activos y pasivos financieros por su valor razonable', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4719, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '766', '4696', 'Beneficios en participaciones y valores representativos de deuda', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4720, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7660', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4721, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7661', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4722, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7662', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras partes asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4723, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7663', '4719', 'Beneficios en participaciones y valores representativos de deuda a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4724, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7665', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4725, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7666', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4726, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7667', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras partes asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4727, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7668', '4719', 'Beneficios en participaciones y valores representativos de deuda a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4728, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '768', '4696', 'Diferencias positivas de cambio', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4729, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '769', '4696', 'Otros ingresos financieros', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4730, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '77', '4007', 'Beneficios procedentes de activos no corrientes e ingresos excepcionales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4731, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '770', '4730', 'Beneficios procedentes del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4732, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '771', '4730', 'Beneficios procedentes del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4733, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '772', '4730', 'Beneficios procedentes de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4734, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '773', '4730', 'Beneficios procedentes de participaciones a largo plazo en partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4735, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7733', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4736, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7734', '4734', 'Beneficios procedentes de participaciones a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4737, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7735', '4734', 'Beneficios procedentes de participaciones a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4738, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '775', '4730', 'Beneficios por operaciones con obligaciones propias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4739, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '778', '4730', 'Ingresos excepcionales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4741, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79', '4007', 'Excesos y aplicaciones de provisiones y pérdidas por deterioro', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4742, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '790', '4741', 'Revisión del deterioro del inmovilizado intangible', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4743, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '791', '4741', 'Revisión del deterioro del inmovilizado material', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4744, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '792', '4741', 'Revisión del deterioro de las inversiones inmobiliarias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4745, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '793', '4741', 'Revisión del deterioro de las existencias', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4746, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7930', '4745', 'Revisión del deterioro de productos terminados y en curso de fabricación', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4747, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7931', '4745', 'Revisión del deterioro de mercaderías', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4748, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7932', '4745', 'Revisión del deterioro de materias primas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4749, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7933', '4745', 'Revisión del deterioro de otros aprovisionamientos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4750, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '794', '4741', 'Revisión del deterioro de créditos por operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4751, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '795', '4741', 'Exceso de provisiones', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4752, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7951', '4751', 'Exceso de provisión para impuestos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4753, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7952', '4751', 'Exceso de provisión para otras responsabilidades', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4755, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7954', '4751', 'Exceso de provisión para operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4756, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79544', '4755', 'Exceso de provisión por contratos onerosos', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4757, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '79549', '4755', 'Exceso de provisión para otras operaciones comerciales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4758, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7955', '4751', 'Exceso de provisión para actuaciones medioambienteales', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4759, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '796', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4760, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7960', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4761, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7961', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4762, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7962', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4763, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7963', '4759', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4764, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7965', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4765, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7966', '4759', 'Revisión del deterioro de valores representativos a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4766, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7967', '4759', 'Revisión del deterioro de valores representativos a largo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4767, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7968', '4759', 'Revisión del deterioro de valores representativos a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4768, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '797', '4741', 'Revisión del deterioro de créditos a largo plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4769, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7970', '4768', 'Revisión del deterioro de créditos a largo plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4770, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7971', '4768', 'Revisión del deterioro de créditos a largo plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4771, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7972', '4768', 'Revisión del deterioro de créditos a largo plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4772, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7973', '4768', 'Revisión del deterioro de créditos a largo plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4773, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '798', '4741', 'Revisión del deterioro de participaciones y valores representativos de deuda a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4774, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7980', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4775, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7981', '4773', 'Revisión del deterioro de participaciones en instrumentos de patrimonio neto a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4776, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7985', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4777, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7986', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4778, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7987', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4779, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7988', '4773', 'Revisión del deterioro de valores representativos de deuda a corto plazo otras empresas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4780, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '799', '4741', 'Revisión del deterioro de créditos a corto plazo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4781, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7990', '4780', 'Revisión del deterioro de créditos a corto plazo empresas del grupo', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', '1'); INSERT INTO llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','VENTAS_E_INGRESOS', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', '1');
gpl-3.0
jmysona/testing2
src/draft/tools/atomicMaker/AtomicMaker.cpp
898
#include "AtomicMaker.h" #include <string> void AtomicMaker::readParam(std::istream& in) { read<Boundary>(in, "boundary", boundary_); readParamComposite(in, random_); read<int>(in, "nMolecule", nMolecule_); } void AtomicMaker::writeConfig(std::ostream& out) { Vector r; Vector v; int iMol; out << "BOUNDARY" << std::endl; out << std::endl; out << boundary_ << std::endl; out << std::endl; out << "MOLECULES" << std::endl; out << std::endl; out << "species " << 0 << std::endl; out << "nMolecule " << nMolecule_ << std::endl; out << std::endl; for (iMol = 0; iMol < nMolecule_; ++iMol) { out << "molecule " << iMol << std::endl; boundary_.randomPosition(random_, r); out << r << std::endl; out << std::endl; } } int main() { AtomicMaker obj; obj.readParam(std::cin); obj.writeConfig(std::cout); }
gpl-3.0
vineodd/PIMSim
GEM5Simulation/gem5/src/dev/net/etherdump.cc
3646
/* * Copyright (c) 2002-2005 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer; * redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution; * neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Nathan Binkert */ /* @file * Simple object for creating a simple pcap style packet trace */ #include "dev/net/etherdump.hh" #include <sys/time.h> #include <algorithm> #include <string> #include "base/logging.hh" #include "base/output.hh" #include "sim/core.hh" using std::string; EtherDump::EtherDump(const Params *p) : SimObject(p), stream(simout.create(p->file, true)->stream()), maxlen(p->maxlen) { } #define DLT_EN10MB 1 // Ethernet (10Mb) #define TCPDUMP_MAGIC 0xa1b2c3d4 #define PCAP_VERSION_MAJOR 2 #define PCAP_VERSION_MINOR 4 struct pcap_file_header { uint32_t magic; uint16_t version_major; uint16_t version_minor; int32_t thiszone; // gmt to local correction uint32_t sigfigs; // accuracy of timestamps uint32_t snaplen; // max length saved portion of each pkt uint32_t linktype; // data link type (DLT_*) }; struct pcap_pkthdr { uint32_t seconds; uint32_t microseconds; uint32_t caplen; // length of portion present uint32_t len; // length this packet (off wire) }; void EtherDump::init() { struct pcap_file_header hdr; hdr.magic = TCPDUMP_MAGIC; hdr.version_major = PCAP_VERSION_MAJOR; hdr.version_minor = PCAP_VERSION_MINOR; hdr.thiszone = 0; hdr.snaplen = 1500; hdr.sigfigs = 0; hdr.linktype = DLT_EN10MB; stream->write(reinterpret_cast<char *>(&hdr), sizeof(hdr)); stream->flush(); } void EtherDump::dumpPacket(EthPacketPtr &packet) { pcap_pkthdr pkthdr; pkthdr.seconds = curTick() / SimClock::Int::s; pkthdr.microseconds = (curTick() / SimClock::Int::us) % ULL(1000000); pkthdr.caplen = std::min(packet->length, maxlen); pkthdr.len = packet->length; stream->write(reinterpret_cast<char *>(&pkthdr), sizeof(pkthdr)); stream->write(reinterpret_cast<char *>(packet->data), pkthdr.caplen); stream->flush(); } EtherDump * EtherDumpParams::create() { return new EtherDump(this); }
gpl-3.0
ShuttleworthFoundation/tuxlab-Cookbook
libs/saxon/doc/api/com/icl/saxon/exslt/Math.html
27831
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_06) on Thu Nov 24 12:17:51 GMT 2005 --> <TITLE> Math </TITLE> <META NAME="keywords" CONTENT="com.icl.saxon.exslt.Math class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Math"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../com/icl/saxon/exslt/Date.html" title="class in com.icl.saxon.exslt"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../com/icl/saxon/exslt/Sets.html" title="class in com.icl.saxon.exslt"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Math.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.icl.saxon.exslt</FONT> <BR> Class Math</H2> <PRE> java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>com.icl.saxon.exslt.Math</B> </PRE> <HR> <DL> <DT>public abstract class <B>Math</B><DT>extends java.lang.Object</DL> <P> This class implements extension functions in the http://exslt.org/math namespace. <p> <P> <P> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#Math()">Math</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#abs(double)">abs</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the absolute value of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#acos(double)">acos</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the arccosine of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#asin(double)">asin</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the arcsine of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#atan(double)">atan</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the arctangent of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#atan2(double, double)">atan2</A></B>(double&nbsp;x, double&nbsp;y)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts rectangular coordinates to polar (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#constant(java.lang.String, double)">constant</A></B>(java.lang.String&nbsp;name, double&nbsp;precision)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a named constant to a given precision (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#cos(double)">cos</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the cosine of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#exp(double)">exp</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the exponential of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../com/icl/saxon/expr/NodeSetValue.html" title="class in com.icl.saxon.expr">NodeSetValue</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#highest(com.icl.saxon.Context, com.icl.saxon.om.NodeEnumeration)">highest</A></B>(<A HREF="../../../../com/icl/saxon/Context.html" title="class in com.icl.saxon">Context</A>&nbsp;c, <A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the nodes with maximum numeric value of the string-value of each of a set of nodes</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#log(double)">log</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the logarithm of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;<A HREF="../../../../com/icl/saxon/expr/NodeSetValue.html" title="class in com.icl.saxon.expr">NodeSetValue</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#lowest(com.icl.saxon.Context, com.icl.saxon.om.NodeEnumeration)">lowest</A></B>(<A HREF="../../../../com/icl/saxon/Context.html" title="class in com.icl.saxon">Context</A>&nbsp;c, <A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the node with minimum numeric value of the string-value of each of a set of nodes</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#max(com.icl.saxon.om.NodeEnumeration)">max</A></B>(<A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the maximum numeric value of the string-value of each of a set of nodes</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#min(com.icl.saxon.om.NodeEnumeration)">min</A></B>(<A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the minimum numeric value of the string-value of each of a set of nodes</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#power(double, double)">power</A></B>(double&nbsp;x, double&nbsp;y)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the power of two numeric values (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#random()">random</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a random numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#sin(double)">sin</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the sine of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#sqrt(double)">sqrt</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the square root of a numeric value (SStL)</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static&nbsp;double</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/icl/saxon/exslt/Math.html#tan(double)">tan</A></B>(double&nbsp;x)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the tangent of a numeric value (SStL)</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.Object</B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="Math()"><!-- --></A><H3> Math</H3> <PRE> public <B>Math</B>()</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="max(com.icl.saxon.om.NodeEnumeration)"><!-- --></A><H3> max</H3> <PRE> public static double <B>max</B>(<A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the maximum numeric value of the string-value of each of a set of nodes <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="min(com.icl.saxon.om.NodeEnumeration)"><!-- --></A><H3> min</H3> <PRE> public static double <B>min</B>(<A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the minimum numeric value of the string-value of each of a set of nodes <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="highest(com.icl.saxon.Context, com.icl.saxon.om.NodeEnumeration)"><!-- --></A><H3> highest</H3> <PRE> public static <A HREF="../../../../com/icl/saxon/expr/NodeSetValue.html" title="class in com.icl.saxon.expr">NodeSetValue</A> <B>highest</B>(<A HREF="../../../../com/icl/saxon/Context.html" title="class in com.icl.saxon">Context</A>&nbsp;c, <A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the nodes with maximum numeric value of the string-value of each of a set of nodes <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="lowest(com.icl.saxon.Context, com.icl.saxon.om.NodeEnumeration)"><!-- --></A><H3> lowest</H3> <PRE> public static <A HREF="../../../../com/icl/saxon/expr/NodeSetValue.html" title="class in com.icl.saxon.expr">NodeSetValue</A> <B>lowest</B>(<A HREF="../../../../com/icl/saxon/Context.html" title="class in com.icl.saxon">Context</A>&nbsp;c, <A HREF="../../../../com/icl/saxon/om/NodeEnumeration.html" title="interface in com.icl.saxon.om">NodeEnumeration</A>&nbsp;nsv) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the node with minimum numeric value of the string-value of each of a set of nodes <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="abs(double)"><!-- --></A><H3> abs</H3> <PRE> public static double <B>abs</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the absolute value of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="sqrt(double)"><!-- --></A><H3> sqrt</H3> <PRE> public static double <B>sqrt</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the square root of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="power(double, double)"><!-- --></A><H3> power</H3> <PRE> public static double <B>power</B>(double&nbsp;x, double&nbsp;y) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the power of two numeric values (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="constant(java.lang.String, double)"><!-- --></A><H3> constant</H3> <PRE> public static double <B>constant</B>(java.lang.String&nbsp;name, double&nbsp;precision) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get a named constant to a given precision (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="log(double)"><!-- --></A><H3> log</H3> <PRE> public static double <B>log</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the logarithm of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="random()"><!-- --></A><H3> random</H3> <PRE> public static double <B>random</B>() throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get a random numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="sin(double)"><!-- --></A><H3> sin</H3> <PRE> public static double <B>sin</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the sine of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="cos(double)"><!-- --></A><H3> cos</H3> <PRE> public static double <B>cos</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the cosine of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="tan(double)"><!-- --></A><H3> tan</H3> <PRE> public static double <B>tan</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the tangent of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="asin(double)"><!-- --></A><H3> asin</H3> <PRE> public static double <B>asin</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the arcsine of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="acos(double)"><!-- --></A><H3> acos</H3> <PRE> public static double <B>acos</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the arccosine of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="atan(double)"><!-- --></A><H3> atan</H3> <PRE> public static double <B>atan</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the arctangent of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="atan2(double, double)"><!-- --></A><H3> atan2</H3> <PRE> public static double <B>atan2</B>(double&nbsp;x, double&nbsp;y) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Converts rectangular coordinates to polar (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <HR> <A NAME="exp(double)"><!-- --></A><H3> exp</H3> <PRE> public static double <B>exp</B>(double&nbsp;x) throws <A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></PRE> <DL> <DD>Get the exponential of a numeric value (SStL) <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../com/icl/saxon/expr/XPathException.html" title="class in com.icl.saxon.expr">XPathException</A></CODE></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../com/icl/saxon/exslt/Date.html" title="class in com.icl.saxon.exslt"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../com/icl/saxon/exslt/Sets.html" title="class in com.icl.saxon.exslt"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Math.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
gpl-3.0
flyinglemonfpv/betaflight
src/main/target/MATEKF405/target.h
4225
/* * This file is part of Cleanflight. * * Cleanflight is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Cleanflight is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #define TARGET_BOARD_IDENTIFIER "MKF4" //#define CONFIG_START_FLASH_ADDRESS (0x08080000) #define USBD_PRODUCT_STRING "MatekF4" #define LED0 PB9 #define LED1 PA14 #define BEEPER PC13 #define BEEPER_INVERTED // *************** Gyro & ACC ********************** #define USE_SPI #define USE_SPI_DEVICE_1 #define SPI1_SCK_PIN PA5 #define SPI1_MISO_PIN PA6 #define SPI1_MOSI_PIN PA7 #define MPU6500_CS_PIN PC2 #define MPU6500_SPI_INSTANCE SPI1 #define USE_EXTI #define MPU_INT_EXTI PC3 #define USE_MPU_DATA_READY_SIGNAL #define GYRO #define USE_GYRO_SPI_MPU6500 #define GYRO_MPU6500_ALIGN CW180_DEG #define ACC #define USE_ACC_SPI_MPU6500 #define ACC_MPU6500_ALIGN CW180_DEG // *************** SD Card ************************** #define USE_SDCARD #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT #define USE_SPI_DEVICE_3 #define SPI3_SCK_PIN PB3 #define SPI3_MISO_PIN PB4 #define SPI3_MOSI_PIN PB5 #define SDCARD_SPI_INSTANCE SPI3 #define SDCARD_SPI_CS_PIN PC1 // SPI3 is on the APB1 bus whose clock runs at 84MHz. Divide to under 400kHz for init: #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz // Divide to under 25MHz for normal operation: #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz #define SDCARD_DMA_CHANNEL_TX DMA1_Stream7 #define SDCARD_DMA_CHANNEL_TX_COMPLETE_FLAG DMA_FLAG_TCIF7 #define SDCARD_DMA_CLK RCC_AHB1Periph_DMA1 #define SDCARD_DMA_CHANNEL DMA_Channel_0 // *************** OSD ***************************** #define USE_SPI_DEVICE_2 #define SPI2_SCK_PIN PB13 #define SPI2_MISO_PIN PB14 #define SPI2_MOSI_PIN PB15 #define OSD #define USE_MAX7456 #define MAX7456_SPI_INSTANCE SPI2 #define MAX7456_SPI_CS_PIN PB10 // *************** UART ***************************** #define USE_VCP #define VBUS_SENSING_PIN PB12 #define VBUS_SENSING_ENABLED #define USE_UART1 #define UART1_RX_PIN PA10 #define UART1_TX_PIN PA9 #define USE_UART2 #define UART2_RX_PIN PA3 #define UART2_TX_PIN PA2 #define USE_UART3 #define UART3_RX_PIN PC11 #define UART3_TX_PIN PC10 #define USE_UART4 #define UART4_RX_PIN PA1 #define UART4_TX_PIN PA0 #define USE_UART5 #define UART5_RX_PIN PD2 #define UART5_TX_PIN PC12 #define USE_SOFTSERIAL1 //#define SOFTSERIAL1_RX_PIN PA15 // S5 //#define SOFTSERIAL1_TX_PIN PA8 // S6 #define SERIAL_PORT_COUNT 7 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS #define SERIALRX_UART SERIAL_PORT_USART2 // *************** ADC ***************************** #define USE_ADC #define ADC1_DMA_STREAM DMA2_Stream0 #define VBAT_ADC_PIN PC5 #define CURRENT_METER_ADC_PIN PC4 #define RSSI_ADC_PIN PB1 #define DEFAULT_FEATURES (FEATURE_OSD ) #define LED_STRIP #define SPEKTRUM_BIND #define BIND_PIN PA1 // USART4 RX //#define USE_ESCSERIAL #define USE_SERIAL_4WAY_BLHELI_INTERFACE #define TARGET_IO_PORTA 0xffff #define TARGET_IO_PORTB 0xffff #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) #define USABLE_TIMER_CHANNEL_COUNT 8 #define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(8))
gpl-3.0
trunet/ardupilot
Tools/ArdupilotMegaPlanner/Antenna/Tracker.Designer.cs
15376
namespace ArdupilotMega.Antenna { partial class Tracker { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Tracker)); this.CMB_interface = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.CMB_baudrate = new System.Windows.Forms.ComboBox(); this.CMB_serialport = new System.Windows.Forms.ComboBox(); this.TRK_pantrim = new System.Windows.Forms.TrackBar(); this.TXT_panrange = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.TXT_tiltrange = new System.Windows.Forms.TextBox(); this.TRK_tilttrim = new System.Windows.Forms.TrackBar(); this.label2 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.CHK_revpan = new System.Windows.Forms.CheckBox(); this.CHK_revtilt = new System.Windows.Forms.CheckBox(); this.TXT_pwmrangepan = new System.Windows.Forms.TextBox(); this.TXT_pwmrangetilt = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.BUT_connect = new ArdupilotMega.Controls.MyButton(); this.LBL_pantrim = new System.Windows.Forms.Label(); this.LBL_tilttrim = new System.Windows.Forms.Label(); this.BUT_find = new ArdupilotMega.Controls.MyButton(); this.TXT_centerpan = new System.Windows.Forms.TextBox(); this.TXT_centertilt = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.TRK_pantrim)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.TRK_tilttrim)).BeginInit(); this.SuspendLayout(); // // CMB_interface // this.CMB_interface.FormattingEnabled = true; this.CMB_interface.Items.AddRange(new object[] { resources.GetString("CMB_interface.Items"), resources.GetString("CMB_interface.Items1")}); resources.ApplyResources(this.CMB_interface, "CMB_interface"); this.CMB_interface.Name = "CMB_interface"; this.CMB_interface.SelectedIndexChanged += new System.EventHandler(this.CMB_interface_SelectedIndexChanged); // // label1 // resources.ApplyResources(this.label1, "label1"); this.label1.Name = "label1"; // // CMB_baudrate // this.CMB_baudrate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CMB_baudrate.FormattingEnabled = true; this.CMB_baudrate.Items.AddRange(new object[] { resources.GetString("CMB_baudrate.Items"), resources.GetString("CMB_baudrate.Items1"), resources.GetString("CMB_baudrate.Items2"), resources.GetString("CMB_baudrate.Items3"), resources.GetString("CMB_baudrate.Items4"), resources.GetString("CMB_baudrate.Items5"), resources.GetString("CMB_baudrate.Items6"), resources.GetString("CMB_baudrate.Items7")}); resources.ApplyResources(this.CMB_baudrate, "CMB_baudrate"); this.CMB_baudrate.Name = "CMB_baudrate"; // // CMB_serialport // this.CMB_serialport.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CMB_serialport.FormattingEnabled = true; resources.ApplyResources(this.CMB_serialport, "CMB_serialport"); this.CMB_serialport.Name = "CMB_serialport"; // // TRK_pantrim // resources.ApplyResources(this.TRK_pantrim, "TRK_pantrim"); this.TRK_pantrim.Maximum = 360; this.TRK_pantrim.Minimum = -360; this.TRK_pantrim.Name = "TRK_pantrim"; this.TRK_pantrim.TickFrequency = 5; this.TRK_pantrim.Scroll += new System.EventHandler(this.TRK_pantrim_Scroll); // // TXT_panrange // resources.ApplyResources(this.TXT_panrange, "TXT_panrange"); this.TXT_panrange.Name = "TXT_panrange"; this.TXT_panrange.TextChanged += new System.EventHandler(this.TXT_panrange_TextChanged); // // label3 // resources.ApplyResources(this.label3, "label3"); this.label3.Name = "label3"; // // label4 // resources.ApplyResources(this.label4, "label4"); this.label4.Name = "label4"; // // label5 // resources.ApplyResources(this.label5, "label5"); this.label5.Name = "label5"; // // label6 // resources.ApplyResources(this.label6, "label6"); this.label6.Name = "label6"; // // TXT_tiltrange // resources.ApplyResources(this.TXT_tiltrange, "TXT_tiltrange"); this.TXT_tiltrange.Name = "TXT_tiltrange"; this.TXT_tiltrange.TextChanged += new System.EventHandler(this.TXT_tiltrange_TextChanged); // // TRK_tilttrim // resources.ApplyResources(this.TRK_tilttrim, "TRK_tilttrim"); this.TRK_tilttrim.Maximum = 180; this.TRK_tilttrim.Minimum = -180; this.TRK_tilttrim.Name = "TRK_tilttrim"; this.TRK_tilttrim.TickFrequency = 5; this.TRK_tilttrim.Scroll += new System.EventHandler(this.TRK_tilttrim_Scroll); // // label2 // resources.ApplyResources(this.label2, "label2"); this.label2.Name = "label2"; // // label7 // resources.ApplyResources(this.label7, "label7"); this.label7.Name = "label7"; // // CHK_revpan // resources.ApplyResources(this.CHK_revpan, "CHK_revpan"); this.CHK_revpan.Name = "CHK_revpan"; this.CHK_revpan.UseVisualStyleBackColor = true; this.CHK_revpan.CheckedChanged += new System.EventHandler(this.CHK_revpan_CheckedChanged); // // CHK_revtilt // resources.ApplyResources(this.CHK_revtilt, "CHK_revtilt"); this.CHK_revtilt.Name = "CHK_revtilt"; this.CHK_revtilt.UseVisualStyleBackColor = true; this.CHK_revtilt.CheckedChanged += new System.EventHandler(this.CHK_revtilt_CheckedChanged); // // TXT_pwmrangepan // resources.ApplyResources(this.TXT_pwmrangepan, "TXT_pwmrangepan"); this.TXT_pwmrangepan.Name = "TXT_pwmrangepan"; // // TXT_pwmrangetilt // resources.ApplyResources(this.TXT_pwmrangetilt, "TXT_pwmrangetilt"); this.TXT_pwmrangetilt.Name = "TXT_pwmrangetilt"; // // label8 // resources.ApplyResources(this.label8, "label8"); this.label8.Name = "label8"; // // label9 // resources.ApplyResources(this.label9, "label9"); this.label9.Name = "label9"; // // label10 // resources.ApplyResources(this.label10, "label10"); this.label10.Name = "label10"; // // label11 // resources.ApplyResources(this.label11, "label11"); this.label11.Name = "label11"; // // label12 // resources.ApplyResources(this.label12, "label12"); this.label12.Name = "label12"; // // BUT_connect // resources.ApplyResources(this.BUT_connect, "BUT_connect"); this.BUT_connect.Name = "BUT_connect"; this.BUT_connect.UseVisualStyleBackColor = true; this.BUT_connect.Click += new System.EventHandler(this.BUT_connect_Click); // // LBL_pantrim // resources.ApplyResources(this.LBL_pantrim, "LBL_pantrim"); this.LBL_pantrim.Name = "LBL_pantrim"; // // LBL_tilttrim // resources.ApplyResources(this.LBL_tilttrim, "LBL_tilttrim"); this.LBL_tilttrim.Name = "LBL_tilttrim"; // // BUT_find // resources.ApplyResources(this.BUT_find, "BUT_find"); this.BUT_find.Name = "BUT_find"; this.BUT_find.UseVisualStyleBackColor = true; this.BUT_find.Click += new System.EventHandler(this.BUT_find_Click); // // TXT_centerpan // resources.ApplyResources(this.TXT_centerpan, "TXT_centerpan"); this.TXT_centerpan.Name = "TXT_centerpan"; this.TXT_centerpan.TextChanged += new System.EventHandler(this.TXT_centerpan_TextChanged); // // TXT_centertilt // resources.ApplyResources(this.TXT_centertilt, "TXT_centertilt"); this.TXT_centertilt.Name = "TXT_centertilt"; this.TXT_centertilt.TextChanged += new System.EventHandler(this.TXT_centertilt_TextChanged); // // label13 // resources.ApplyResources(this.label13, "label13"); this.label13.Name = "label13"; // // label14 // resources.ApplyResources(this.label14, "label14"); this.label14.Name = "label14"; // // Tracker // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.label14); this.Controls.Add(this.label13); this.Controls.Add(this.TXT_centertilt); this.Controls.Add(this.TXT_centerpan); this.Controls.Add(this.BUT_find); this.Controls.Add(this.LBL_tilttrim); this.Controls.Add(this.LBL_pantrim); this.Controls.Add(this.label12); this.Controls.Add(this.label10); this.Controls.Add(this.label11); this.Controls.Add(this.label9); this.Controls.Add(this.label8); this.Controls.Add(this.TXT_pwmrangetilt); this.Controls.Add(this.TXT_pwmrangepan); this.Controls.Add(this.CHK_revtilt); this.Controls.Add(this.CHK_revpan); this.Controls.Add(this.label7); this.Controls.Add(this.label2); this.Controls.Add(this.label5); this.Controls.Add(this.label6); this.Controls.Add(this.TXT_tiltrange); this.Controls.Add(this.TRK_tilttrim); this.Controls.Add(this.label4); this.Controls.Add(this.label3); this.Controls.Add(this.TXT_panrange); this.Controls.Add(this.TRK_pantrim); this.Controls.Add(this.CMB_baudrate); this.Controls.Add(this.BUT_connect); this.Controls.Add(this.CMB_serialport); this.Controls.Add(this.label1); this.Controls.Add(this.CMB_interface); this.Name = "Tracker"; ((System.ComponentModel.ISupportInitialize)(this.TRK_pantrim)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.TRK_tilttrim)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.ComboBox CMB_interface; private System.Windows.Forms.Label label1; private System.Windows.Forms.ComboBox CMB_baudrate; private ArdupilotMega.Controls.MyButton BUT_connect; private System.Windows.Forms.ComboBox CMB_serialport; private System.Windows.Forms.TrackBar TRK_pantrim; private System.Windows.Forms.TextBox TXT_panrange; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox TXT_tiltrange; private System.Windows.Forms.TrackBar TRK_tilttrim; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label7; private System.Windows.Forms.CheckBox CHK_revpan; private System.Windows.Forms.CheckBox CHK_revtilt; private System.Windows.Forms.TextBox TXT_pwmrangepan; private System.Windows.Forms.TextBox TXT_pwmrangetilt; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label12; private System.Windows.Forms.Label LBL_pantrim; private System.Windows.Forms.Label LBL_tilttrim; private Controls.MyButton BUT_find; private System.Windows.Forms.TextBox TXT_centerpan; private System.Windows.Forms.TextBox TXT_centertilt; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; } }
gpl-3.0
SuperrSonic/WiiMC-SSLC
source/mplayer/ffmpeg/libavdevice/dshow.c
31085
/* * Directshow capture interface * Copyright (c) 2010 Ramiro Polla * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/parseutils.h" #include "libavutil/opt.h" #include "libavformat/internal.h" #include "avdevice.h" #include "dshow_capture.h" struct dshow_ctx { const AVClass *class; IGraphBuilder *graph; char *device_name[2]; int video_device_number; int audio_device_number; int list_options; int list_devices; IBaseFilter *device_filter[2]; IPin *device_pin[2]; libAVFilter *capture_filter[2]; libAVPin *capture_pin[2]; HANDLE mutex; HANDLE event; AVPacketList *pktl; unsigned int curbufsize; unsigned int video_frame_num; IMediaControl *control; char *video_size; char *framerate; int requested_width; int requested_height; AVRational requested_framerate; int sample_rate; int sample_size; int channels; }; static enum PixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount) { switch(biCompression) { case MKTAG('U', 'Y', 'V', 'Y'): return PIX_FMT_UYVY422; case MKTAG('Y', 'U', 'Y', '2'): return PIX_FMT_YUYV422; case MKTAG('I', '4', '2', '0'): return PIX_FMT_YUV420P; case BI_BITFIELDS: case BI_RGB: switch(biBitCount) { /* 1-8 are untested */ case 1: return PIX_FMT_MONOWHITE; case 4: return PIX_FMT_RGB4; case 8: return PIX_FMT_RGB8; case 16: return PIX_FMT_RGB555; case 24: return PIX_FMT_BGR24; case 32: return PIX_FMT_RGB32; } } return PIX_FMT_NONE; } static enum CodecID dshow_codecid(DWORD biCompression) { switch(biCompression) { case MKTAG('d', 'v', 's', 'd'): return CODEC_ID_DVVIDEO; case MKTAG('M', 'J', 'P', 'G'): case MKTAG('m', 'j', 'p', 'g'): return CODEC_ID_MJPEG; } return CODEC_ID_NONE; } static int dshow_read_close(AVFormatContext *s) { struct dshow_ctx *ctx = s->priv_data; AVPacketList *pktl; if (ctx->control) { IMediaControl_Stop(ctx->control); IMediaControl_Release(ctx->control); } if (ctx->graph) { IEnumFilters *fenum; int r; r = IGraphBuilder_EnumFilters(ctx->graph, &fenum); if (r == S_OK) { IBaseFilter *f; IEnumFilters_Reset(fenum); while (IEnumFilters_Next(fenum, 1, &f, NULL) == S_OK) { if (IGraphBuilder_RemoveFilter(ctx->graph, f) == S_OK) IEnumFilters_Reset(fenum); /* When a filter is removed, * the list must be reset. */ IBaseFilter_Release(f); } IEnumFilters_Release(fenum); } IGraphBuilder_Release(ctx->graph); } if (ctx->capture_pin[VideoDevice]) libAVPin_Release(ctx->capture_pin[VideoDevice]); if (ctx->capture_pin[AudioDevice]) libAVPin_Release(ctx->capture_pin[AudioDevice]); if (ctx->capture_filter[VideoDevice]) libAVFilter_Release(ctx->capture_filter[VideoDevice]); if (ctx->capture_filter[AudioDevice]) libAVFilter_Release(ctx->capture_filter[AudioDevice]); if (ctx->device_pin[VideoDevice]) IPin_Release(ctx->device_pin[VideoDevice]); if (ctx->device_pin[AudioDevice]) IPin_Release(ctx->device_pin[AudioDevice]); if (ctx->device_filter[VideoDevice]) IBaseFilter_Release(ctx->device_filter[VideoDevice]); if (ctx->device_filter[AudioDevice]) IBaseFilter_Release(ctx->device_filter[AudioDevice]); if (ctx->device_name[0]) av_free(ctx->device_name[0]); if (ctx->device_name[1]) av_free(ctx->device_name[1]); if(ctx->mutex) CloseHandle(ctx->mutex); if(ctx->event) CloseHandle(ctx->event); pktl = ctx->pktl; while (pktl) { AVPacketList *next = pktl->next; av_destruct_packet(&pktl->pkt); av_free(pktl); pktl = next; } return 0; } static char *dup_wchar_to_utf8(wchar_t *w) { char *s = NULL; int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0); s = av_malloc(l); if (s) WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0); return s; } static int shall_we_drop(AVFormatContext *s) { struct dshow_ctx *ctx = s->priv_data; const uint8_t dropscore[] = {62, 75, 87, 100}; const int ndropscores = FF_ARRAY_ELEMS(dropscore); unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer; if(dropscore[++ctx->video_frame_num%ndropscores] <= buffer_fullness) { av_log(s, AV_LOG_ERROR, "real-time buffer %d%% full! frame dropped!\n", buffer_fullness); return 1; } return 0; } static void callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time) { AVFormatContext *s = priv_data; struct dshow_ctx *ctx = s->priv_data; AVPacketList **ppktl, *pktl_next; // dump_videohdr(s, vdhdr); if(shall_we_drop(s)) return; WaitForSingleObject(ctx->mutex, INFINITE); pktl_next = av_mallocz(sizeof(AVPacketList)); if(!pktl_next) goto fail; if(av_new_packet(&pktl_next->pkt, buf_size) < 0) { av_free(pktl_next); goto fail; } pktl_next->pkt.stream_index = index; pktl_next->pkt.pts = time; memcpy(pktl_next->pkt.data, buf, buf_size); for(ppktl = &ctx->pktl ; *ppktl ; ppktl = &(*ppktl)->next); *ppktl = pktl_next; ctx->curbufsize += buf_size; SetEvent(ctx->event); ReleaseMutex(ctx->mutex); return; fail: ReleaseMutex(ctx->mutex); return; } /** * Cycle through available devices using the device enumerator devenum, * retrieve the device with type specified by devtype and return the * pointer to the object found in *pfilter. * If pfilter is NULL, list all device names. */ static int dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum, enum dshowDeviceType devtype, IBaseFilter **pfilter) { struct dshow_ctx *ctx = avctx->priv_data; IBaseFilter *device_filter = NULL; IEnumMoniker *classenum = NULL; IMoniker *m = NULL; const char *device_name = ctx->device_name[devtype]; int skip = (devtype == VideoDevice) ? ctx->video_device_number : ctx->audio_device_number; int r; const GUID *device_guid[2] = { &CLSID_VideoInputDeviceCategory, &CLSID_AudioInputDeviceCategory }; const char *devtypename = (devtype == VideoDevice) ? "video" : "audio"; r = ICreateDevEnum_CreateClassEnumerator(devenum, device_guid[devtype], (IEnumMoniker **) &classenum, 0); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not enumerate %s devices.\n", devtypename); return AVERROR(EIO); } while (!device_filter && IEnumMoniker_Next(classenum, 1, &m, NULL) == S_OK) { IPropertyBag *bag = NULL; char *buf = NULL; VARIANT var; r = IMoniker_BindToStorage(m, 0, 0, &IID_IPropertyBag, (void *) &bag); if (r != S_OK) goto fail1; var.vt = VT_BSTR; r = IPropertyBag_Read(bag, L"FriendlyName", &var, NULL); if (r != S_OK) goto fail1; buf = dup_wchar_to_utf8(var.bstrVal); if (pfilter) { if (strcmp(device_name, buf)) goto fail1; if (!skip--) IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) &device_filter); } else { av_log(avctx, AV_LOG_INFO, " \"%s\"\n", buf); } fail1: if (buf) av_free(buf); if (bag) IPropertyBag_Release(bag); IMoniker_Release(m); } IEnumMoniker_Release(classenum); if (pfilter) { if (!device_filter) { av_log(avctx, AV_LOG_ERROR, "Could not find %s device.\n", devtypename); return AVERROR(EIO); } *pfilter = device_filter; } return 0; } /** * Cycle through available formats using the specified pin, * try to set parameters specified through AVOptions and if successful * return 1 in *pformat_set. * If pformat_set is NULL, list all pin capabilities. */ static void dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, IPin *pin, int *pformat_set) { struct dshow_ctx *ctx = avctx->priv_data; IAMStreamConfig *config = NULL; AM_MEDIA_TYPE *type = NULL; int format_set = 0; void *caps = NULL; int i, n, size; if (IPin_QueryInterface(pin, &IID_IAMStreamConfig, (void **) &config) != S_OK) return; if (IAMStreamConfig_GetNumberOfCapabilities(config, &n, &size) != S_OK) goto end; caps = av_malloc(size); if (!caps) goto end; for (i = 0; i < n && !format_set; i++) { IAMStreamConfig_GetStreamCaps(config, i, &type, (void *) caps); #if DSHOWDEBUG ff_print_AM_MEDIA_TYPE(type); #endif if (devtype == VideoDevice) { VIDEO_STREAM_CONFIG_CAPS *vcaps = caps; BITMAPINFOHEADER *bih; int64_t *fr; #if DSHOWDEBUG ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps); #endif if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo)) { VIDEOINFOHEADER *v = (void *) type->pbFormat; fr = &v->AvgTimePerFrame; bih = &v->bmiHeader; } else if (IsEqualGUID(&type->formattype, &FORMAT_VideoInfo2)) { VIDEOINFOHEADER2 *v = (void *) type->pbFormat; fr = &v->AvgTimePerFrame; bih = &v->bmiHeader; } else { goto next; } if (!pformat_set) { av_log(avctx, AV_LOG_INFO, " min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g\n", vcaps->MinOutputSize.cx, vcaps->MinOutputSize.cy, 1e7 / vcaps->MaxFrameInterval, vcaps->MaxOutputSize.cx, vcaps->MaxOutputSize.cy, 1e7 / vcaps->MinFrameInterval); continue; } if (ctx->framerate) { int64_t framerate = ((int64_t) ctx->requested_framerate.den*10000000) / ctx->requested_framerate.num; if (framerate > vcaps->MaxFrameInterval || framerate < vcaps->MinFrameInterval) goto next; *fr = framerate; } if (ctx->video_size) { if (ctx->requested_width > vcaps->MaxOutputSize.cx || ctx->requested_width < vcaps->MinOutputSize.cx || ctx->requested_height > vcaps->MaxOutputSize.cy || ctx->requested_height < vcaps->MinOutputSize.cy) goto next; bih->biWidth = ctx->requested_width; bih->biHeight = ctx->requested_height; } } else { AUDIO_STREAM_CONFIG_CAPS *acaps = caps; WAVEFORMATEX *fx; #if DSHOWDEBUG ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps); #endif if (IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx)) { fx = (void *) type->pbFormat; } else { goto next; } if (!pformat_set) { av_log(avctx, AV_LOG_INFO, " min ch=%lu bits=%lu rate=%6lu max ch=%lu bits=%lu rate=%6lu\n", acaps->MinimumChannels, acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency, acaps->MaximumChannels, acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency); continue; } if (ctx->sample_rate) { if (ctx->sample_rate > acaps->MaximumSampleFrequency || ctx->sample_rate < acaps->MinimumSampleFrequency) goto next; fx->nSamplesPerSec = ctx->sample_rate; } if (ctx->sample_size) { if (ctx->sample_size > acaps->MaximumBitsPerSample || ctx->sample_size < acaps->MinimumBitsPerSample) goto next; fx->wBitsPerSample = ctx->sample_size; } if (ctx->channels) { if (ctx->channels > acaps->MaximumChannels || ctx->channels < acaps->MinimumChannels) goto next; fx->nChannels = ctx->channels; } } if (IAMStreamConfig_SetFormat(config, type) != S_OK) goto next; format_set = 1; next: if (type->pbFormat) CoTaskMemFree(type->pbFormat); CoTaskMemFree(type); } end: IAMStreamConfig_Release(config); if (caps) av_free(caps); if (pformat_set) *pformat_set = format_set; } /** * Cycle through available pins using the device_filter device, of type * devtype, retrieve the first output pin and return the pointer to the * object found in *ppin. * If ppin is NULL, cycle through all pins listing audio/video capabilities. */ static int dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype, IBaseFilter *device_filter, IPin **ppin) { struct dshow_ctx *ctx = avctx->priv_data; IEnumPins *pins = 0; IPin *device_pin = NULL; IPin *pin; int r; const GUID *mediatype[2] = { &MEDIATYPE_Video, &MEDIATYPE_Audio }; const char *devtypename = (devtype == VideoDevice) ? "video" : "audio"; int set_format = (devtype == VideoDevice && (ctx->video_size || ctx->framerate)) || (devtype == AudioDevice && (ctx->channels || ctx->sample_rate)); int format_set = 0; r = IBaseFilter_EnumPins(device_filter, &pins); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not enumerate pins.\n"); return AVERROR(EIO); } if (!ppin) { av_log(avctx, AV_LOG_INFO, "DirectShow %s device options\n", devtypename); } while (!device_pin && IEnumPins_Next(pins, 1, &pin, NULL) == S_OK) { IKsPropertySet *p = NULL; IEnumMediaTypes *types = NULL; PIN_INFO info = {0}; AM_MEDIA_TYPE *type; GUID category; DWORD r2; IPin_QueryPinInfo(pin, &info); IBaseFilter_Release(info.pFilter); if (info.dir != PINDIR_OUTPUT) goto next; if (IPin_QueryInterface(pin, &IID_IKsPropertySet, (void **) &p) != S_OK) goto next; if (IKsPropertySet_Get(p, &AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, &category, sizeof(GUID), &r2) != S_OK) goto next; if (!IsEqualGUID(&category, &PIN_CATEGORY_CAPTURE)) goto next; if (!ppin) { char *buf = dup_wchar_to_utf8(info.achName); av_log(avctx, AV_LOG_INFO, " Pin \"%s\"\n", buf); av_free(buf); dshow_cycle_formats(avctx, devtype, pin, NULL); goto next; } if (set_format) { dshow_cycle_formats(avctx, devtype, pin, &format_set); if (!format_set) { goto next; } } if (IPin_EnumMediaTypes(pin, &types) != S_OK) goto next; IEnumMediaTypes_Reset(types); while (!device_pin && IEnumMediaTypes_Next(types, 1, &type, NULL) == S_OK) { if (IsEqualGUID(&type->majortype, mediatype[devtype])) { device_pin = pin; goto next; } CoTaskMemFree(type); } next: if (types) IEnumMediaTypes_Release(types); if (p) IKsPropertySet_Release(p); if (device_pin != pin) IPin_Release(pin); } IEnumPins_Release(pins); if (ppin) { if (set_format && !format_set) { av_log(avctx, AV_LOG_ERROR, "Could not set %s options\n", devtypename); return AVERROR(EIO); } if (!device_pin) { av_log(avctx, AV_LOG_ERROR, "Could not find output pin from %s capture device.\n", devtypename); return AVERROR(EIO); } *ppin = device_pin; } return 0; } /** * List options for device with type devtype. * * @param devenum device enumerator used for accessing the device */ static int dshow_list_device_options(AVFormatContext *avctx, ICreateDevEnum *devenum, enum dshowDeviceType devtype) { struct dshow_ctx *ctx = avctx->priv_data; IBaseFilter *device_filter = NULL; int r; if ((r = dshow_cycle_devices(avctx, devenum, devtype, &device_filter)) < 0) return r; ctx->device_filter[devtype] = device_filter; if ((r = dshow_cycle_pins(avctx, devtype, device_filter, NULL)) < 0) return r; return 0; } static int dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum, enum dshowDeviceType devtype) { struct dshow_ctx *ctx = avctx->priv_data; IBaseFilter *device_filter = NULL; IGraphBuilder *graph = ctx->graph; IPin *device_pin = NULL; libAVPin *capture_pin = NULL; libAVFilter *capture_filter = NULL; int ret = AVERROR(EIO); int r; const wchar_t *filter_name[2] = { L"Audio capture filter", L"Video capture filter" }; if ((r = dshow_cycle_devices(avctx, devenum, devtype, &device_filter)) < 0) { ret = r; goto error; } ctx->device_filter [devtype] = device_filter; r = IGraphBuilder_AddFilter(graph, device_filter, NULL); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not add device filter to graph.\n"); goto error; } if ((r = dshow_cycle_pins(avctx, devtype, device_filter, &device_pin)) < 0) { ret = r; goto error; } ctx->device_pin[devtype] = device_pin; capture_filter = libAVFilter_Create(avctx, callback, devtype); if (!capture_filter) { av_log(avctx, AV_LOG_ERROR, "Could not create grabber filter.\n"); goto error; } ctx->capture_filter[devtype] = capture_filter; r = IGraphBuilder_AddFilter(graph, (IBaseFilter *) capture_filter, filter_name[devtype]); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not add capture filter to graph\n"); goto error; } libAVPin_AddRef(capture_filter->pin); capture_pin = capture_filter->pin; ctx->capture_pin[devtype] = capture_pin; r = IGraphBuilder_ConnectDirect(graph, device_pin, (IPin *) capture_pin, NULL); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not connect pins\n"); goto error; } ret = 0; error: return ret; } static enum CodecID waveform_codec_id(enum AVSampleFormat sample_fmt) { switch (sample_fmt) { case AV_SAMPLE_FMT_U8: return CODEC_ID_PCM_U8; case AV_SAMPLE_FMT_S16: return CODEC_ID_PCM_S16LE; case AV_SAMPLE_FMT_S32: return CODEC_ID_PCM_S32LE; default: return CODEC_ID_NONE; /* Should never happen. */ } } static enum AVSampleFormat sample_fmt_bits_per_sample(int bits) { switch (bits) { case 8: return AV_SAMPLE_FMT_U8; case 16: return AV_SAMPLE_FMT_S16; case 32: return AV_SAMPLE_FMT_S32; default: return AV_SAMPLE_FMT_NONE; /* Should never happen. */ } } static int dshow_add_device(AVFormatContext *avctx, enum dshowDeviceType devtype) { struct dshow_ctx *ctx = avctx->priv_data; AM_MEDIA_TYPE type; AVCodecContext *codec; AVStream *st; int ret = AVERROR(EIO); st = avformat_new_stream(avctx, NULL); if (!st) { ret = AVERROR(ENOMEM); goto error; } st->id = devtype; ctx->capture_filter[devtype]->stream_index = st->index; libAVPin_ConnectionMediaType(ctx->capture_pin[devtype], &type); codec = st->codec; if (devtype == VideoDevice) { BITMAPINFOHEADER *bih = NULL; AVRational time_base; if (IsEqualGUID(&type.formattype, &FORMAT_VideoInfo)) { VIDEOINFOHEADER *v = (void *) type.pbFormat; time_base = (AVRational) { v->AvgTimePerFrame, 10000000 }; bih = &v->bmiHeader; } else if (IsEqualGUID(&type.formattype, &FORMAT_VideoInfo2)) { VIDEOINFOHEADER2 *v = (void *) type.pbFormat; time_base = (AVRational) { v->AvgTimePerFrame, 10000000 }; bih = &v->bmiHeader; } if (!bih) { av_log(avctx, AV_LOG_ERROR, "Could not get media type.\n"); goto error; } codec->time_base = time_base; codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->width = bih->biWidth; codec->height = bih->biHeight; codec->pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount); if (codec->pix_fmt == PIX_FMT_NONE) { codec->codec_id = dshow_codecid(bih->biCompression); if (codec->codec_id == CODEC_ID_NONE) { av_log(avctx, AV_LOG_ERROR, "Unknown compression type. " "Please report verbose (-v 9) debug information.\n"); dshow_read_close(avctx); return AVERROR_PATCHWELCOME; } codec->bits_per_coded_sample = bih->biBitCount; } else { codec->codec_id = CODEC_ID_RAWVIDEO; if (bih->biCompression == BI_RGB || bih->biCompression == BI_BITFIELDS) { codec->bits_per_coded_sample = bih->biBitCount; codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE); if (codec->extradata) { codec->extradata_size = 9; memcpy(codec->extradata, "BottomUp", 9); } } } } else { WAVEFORMATEX *fx = NULL; if (IsEqualGUID(&type.formattype, &FORMAT_WaveFormatEx)) { fx = (void *) type.pbFormat; } if (!fx) { av_log(avctx, AV_LOG_ERROR, "Could not get media type.\n"); goto error; } codec->codec_type = AVMEDIA_TYPE_AUDIO; codec->sample_fmt = sample_fmt_bits_per_sample(fx->wBitsPerSample); codec->codec_id = waveform_codec_id(codec->sample_fmt); codec->sample_rate = fx->nSamplesPerSec; codec->channels = fx->nChannels; } avpriv_set_pts_info(st, 64, 1, 10000000); ret = 0; error: return ret; } static int parse_device_name(AVFormatContext *avctx) { struct dshow_ctx *ctx = avctx->priv_data; char **device_name = ctx->device_name; char *name = av_strdup(avctx->filename); char *tmp = name; int ret = 1; char *type; while ((type = strtok(tmp, "="))) { char *token = strtok(NULL, ":"); tmp = NULL; if (!strcmp(type, "video")) { device_name[0] = token; } else if (!strcmp(type, "audio")) { device_name[1] = token; } else { device_name[0] = NULL; device_name[1] = NULL; break; } } if (!device_name[0] && !device_name[1]) { ret = 0; } else { if (device_name[0]) device_name[0] = av_strdup(device_name[0]); if (device_name[1]) device_name[1] = av_strdup(device_name[1]); } av_free(name); return ret; } static int dshow_read_header(AVFormatContext *avctx) { struct dshow_ctx *ctx = avctx->priv_data; IGraphBuilder *graph = NULL; ICreateDevEnum *devenum = NULL; IMediaControl *control = NULL; int ret = AVERROR(EIO); int r; if (!ctx->list_devices && !parse_device_name(avctx)) { av_log(avctx, AV_LOG_ERROR, "Malformed dshow input string.\n"); goto error; } if (ctx->video_size) { r = av_parse_video_size(&ctx->requested_width, &ctx->requested_height, ctx->video_size); if (r < 0) { av_log(avctx, AV_LOG_ERROR, "Could not parse video size '%s'.\n", ctx->video_size); goto error; } } if (ctx->framerate) { r = av_parse_video_rate(&ctx->requested_framerate, ctx->framerate); if (r < 0) { av_log(avctx, AV_LOG_ERROR, "Could not parse framerate '%s'.\n", ctx->framerate); goto error; } } CoInitialize(0); r = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (void **) &graph); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not create capture graph.\n"); goto error; } ctx->graph = graph; r = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, &IID_ICreateDevEnum, (void **) &devenum); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not enumerate system devices.\n"); goto error; } if (ctx->list_devices) { av_log(avctx, AV_LOG_INFO, "DirectShow video devices\n"); dshow_cycle_devices(avctx, devenum, VideoDevice, NULL); av_log(avctx, AV_LOG_INFO, "DirectShow audio devices\n"); dshow_cycle_devices(avctx, devenum, AudioDevice, NULL); ret = AVERROR_EXIT; goto error; } if (ctx->list_options) { if (ctx->device_name[VideoDevice]) dshow_list_device_options(avctx, devenum, VideoDevice); if (ctx->device_name[AudioDevice]) dshow_list_device_options(avctx, devenum, AudioDevice); ret = AVERROR_EXIT; goto error; } if (ctx->device_name[VideoDevice]) { ret = dshow_open_device(avctx, devenum, VideoDevice); if (ret < 0) goto error; ret = dshow_add_device(avctx, VideoDevice); if (ret < 0) goto error; } if (ctx->device_name[AudioDevice]) { ret = dshow_open_device(avctx, devenum, AudioDevice); if (ret < 0) goto error; ret = dshow_add_device(avctx, AudioDevice); if (ret < 0) goto error; } ctx->mutex = CreateMutex(NULL, 0, NULL); if (!ctx->mutex) { av_log(avctx, AV_LOG_ERROR, "Could not create Mutex\n"); goto error; } ctx->event = CreateEvent(NULL, 1, 0, NULL); if (!ctx->event) { av_log(avctx, AV_LOG_ERROR, "Could not create Event\n"); goto error; } r = IGraphBuilder_QueryInterface(graph, &IID_IMediaControl, (void **) &control); if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not get media control.\n"); goto error; } ctx->control = control; r = IMediaControl_Run(control); if (r == S_FALSE) { OAFilterState pfs; r = IMediaControl_GetState(control, 0, &pfs); } if (r != S_OK) { av_log(avctx, AV_LOG_ERROR, "Could not run filter\n"); goto error; } ret = 0; error: if (ret < 0) dshow_read_close(avctx); if (devenum) ICreateDevEnum_Release(devenum); return ret; } static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt) { struct dshow_ctx *ctx = s->priv_data; AVPacketList *pktl = NULL; while (!pktl) { WaitForSingleObject(ctx->mutex, INFINITE); pktl = ctx->pktl; if (ctx->pktl) { *pkt = ctx->pktl->pkt; ctx->pktl = ctx->pktl->next; av_free(pktl); } ResetEvent(ctx->event); ReleaseMutex(ctx->mutex); if (!pktl) { if (s->flags & AVFMT_FLAG_NONBLOCK) { return AVERROR(EAGAIN); } else { WaitForSingleObject(ctx->event, INFINITE); } } } ctx->curbufsize -= pkt->size; return pkt->size; } #define OFFSET(x) offsetof(struct dshow_ctx, x) #define DEC AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { { "video_size", "set video size given a string such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, { "sample_rate", "set audio sample rate", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC }, { "sample_size", "set audio sample size", OFFSET(sample_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 16, DEC }, { "channels", "set number of audio channels, such as 1 or 2", OFFSET(channels), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC }, { "list_devices", "list available devices", OFFSET(list_devices), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, DEC, "list_devices" }, { "true", "", 0, AV_OPT_TYPE_CONST, {.dbl=1}, 0, 0, DEC, "list_devices" }, { "false", "", 0, AV_OPT_TYPE_CONST, {.dbl=0}, 0, 0, DEC, "list_devices" }, { "list_options", "list available options for specified device", OFFSET(list_options), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, DEC, "list_options" }, { "true", "", 0, AV_OPT_TYPE_CONST, {.dbl=1}, 0, 0, DEC, "list_options" }, { "false", "", 0, AV_OPT_TYPE_CONST, {.dbl=0}, 0, 0, DEC, "list_options" }, { "video_device_number", "set video device number for devices with same name (starts at 0)", OFFSET(video_device_number), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC }, { "audio_device_number", "set audio device number for devices with same name (starts at 0)", OFFSET(audio_device_number), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, DEC }, { NULL }, }; static const AVClass dshow_class = { .class_name = "DirectShow indev", .item_name = av_default_item_name, .option = options, .version = LIBAVUTIL_VERSION_INT, }; AVInputFormat ff_dshow_demuxer = { .name = "dshow", .long_name = NULL_IF_CONFIG_SMALL("DirectShow capture"), .priv_data_size = sizeof(struct dshow_ctx), .read_header = dshow_read_header, .read_packet = dshow_read_packet, .read_close = dshow_read_close, .flags = AVFMT_NOFILE, .priv_class = &dshow_class, };
gpl-3.0
rgvanwesep/exciting-plus-rgvw-mod
utilities/geometry2dx__mtrx.py
20319
#!/usr/bin/python # # GEOMTERY.OUT to OpenDX # # Created: April 2009 (AVK) # Modified: February 2012 (AVK) # import math import sys def r3minv(a, b): t1 = a[0][2] * (a[1][0] * a[2][1] - a[1][1] * a[2][0]) + \ a[0][1] * (a[1][2] * a[2][0] - a[1][0] * a[2][2]) + \ a[0][0] * (a[1][1] * a[2][2] - a[1][2] * a[2][1]) if math.fabs(t1) < 1e-40: print "r3mv: singular matrix" sys.exit(0) t1 = 1.0/t1 b[0][0] = t1 * (a[1][1] * a[2][2] - a[1][2] * a[2][1]) b[0][1] = t1 * (a[0][2] * a[2][1] - a[0][1] * a[2][2]) b[0][2] = t1 * (a[0][1] * a[1][2] - a[0][2] * a[1][1]) b[1][0] = t1 * (a[1][2] * a[2][0] - a[1][0] * a[2][2]) b[1][1] = t1 * (a[0][0] * a[2][2] - a[0][2] * a[2][0]) b[1][2] = t1 * (a[0][2] * a[1][0] - a[0][0] * a[1][2]) b[2][0] = t1 * (a[1][0] * a[2][1] - a[1][1] * a[2][0]) b[2][1] = t1 * (a[0][1] * a[2][0] - a[0][0] * a[2][1]) b[2][2] = t1 * (a[0][0] * a[1][1] - a[0][1] * a[1][0]) return # # angular part of site-centered orbital # current implementation is for d-orbitals only # class Orbital: def __init__(self,coefs): self.pos=[] self.tri=[] self.coefs=coefs self.make() # real spherical harmonics def Rlm(self,l,m,theta,phi): if l==2 and m==-2: return -math.sqrt(15.0/(16*math.pi))*math.sin(2*phi)*math.sin(theta)**2 if l==2 and m==-1: return -math.sqrt(15.0/(16*math.pi))*math.sin(phi)*math.sin(2*theta) if l==2 and m==0: return math.sqrt(5/(64*math.pi))*(1+3*math.cos(2*theta)) if l==2 and m==1: return -math.sqrt(15.0/(16*math.pi))*math.cos(phi)*math.sin(2*theta) if l==2 and m==2: return math.sqrt(15.0/(16*math.pi))*math.cos(2*phi)*math.sin(theta)**2 def val(self,theta,phi): v=0 for m in range(5): v+=self.coefs[m]*self.Rlm(2,m-2,theta,phi) return v def make(self): raw_pos=[] raw_con=[] n=30 for t in range(n): theta=math.pi*t/(n-1) for p in range(n): phi=2*math.pi*p/(n-1) v=5.5*self.val(theta,phi) x=v*math.sin(theta)*math.cos(phi) y=v*math.sin(theta)*math.sin(phi) z=v*math.cos(theta) raw_pos.append([x,y,z]) for t in range(n): for p in range(n): i1=t i2=(t+1)%n j1=p j2=(p+1)%n n1=i1*n+j1 n2=i1*n+j2 n3=i2*n+j2 n4=i2*n+j1 raw_con.append([n1,n2,n3]) raw_con.append([n1,n3,n4]) # find equal positions eq_pos=[-1 for i in range(n*n)] l=0 for i in range(n*n): if eq_pos[i]==-1: eq_pos[i]=l self.pos.append(raw_pos[i]) for j in range(i+1,n*n): if abs(raw_pos[i][0]-raw_pos[j][0])<1e-10 and \ abs(raw_pos[i][1]-raw_pos[j][1])<1e-10 and \ abs(raw_pos[i][2]-raw_pos[j][2])<1e-10: eq_pos[j]=l l+=1 npos=l # substitute positions in triangles by non-equal positions for i in range(2*n*n): raw_con[i][0]=eq_pos[raw_con[i][0]] raw_con[i][1]=eq_pos[raw_con[i][1]] raw_con[i][2]=eq_pos[raw_con[i][2]] eq_con=[-1 for i in range(2*n*n)] # mark degenerate triangles for i in range(2*n*n): if raw_con[i][0]==raw_con[i][1] or raw_con[i][0]==raw_con[i][2] or \ raw_con[i][1]==raw_con[i][2]: eq_con[i]=-2 # find equal triangles l=0 for i in range(2*n*n): if eq_con[i]==-1: eq_con[i]=l self.tri.append(raw_con[i]) for j in range(i+1,2*n*n): if raw_con[i][0]==raw_con[j][0] and raw_con[i][1]==raw_con[j][1] and \ raw_con[i][2]==raw_con[j][2]: eq_con[j]=l l+=1 # # species-specific variables # class Species: def __init__(self, label): self.label = label self.R = 1.0 self.color = [0.5, 0.5, 0.5] self.visible = True # # atom-specific variables # class Atom: def __init__(self, species, posc, posl): self.species = species self.posc = posc self.posl = posl self.nghbr = [] self.orbital = 0 # # geometry-specific variables # class Geometry: def __init__(self): self.avec = [] self.speciesList = {} self.atomList = [] # read 'GEOMETRY.OUT' self.readGeometry() # make a list of nearest neighbours for each atom self.findNeighbours() # print basic info self.printGeometry() def readGeometry(self): fin = open("GEOMETRY.OUT","r") while True : line = fin.readline() if not line: break line = line.strip(" \n") if line == "avec": for i in range(3): s1 = fin.readline().strip(" \n").split() self.avec.append([float(s1[0]), float(s1[1]), float(s1[2])]) if line == "atoms": # get number of species s1 = fin.readline().strip(" \n").split() nspecies = int(s1[0]) # go over species for i in range(nspecies): # construct label from species file name s1 = fin.readline().strip(" \n").split() label = s1[0][1:s1[0].find(".in")] # crate new species sp = Species(label) # put species to the list self.speciesList[label] = sp # get number of atoms for current species s1 = fin.readline().strip(" \n").split() natoms = int(s1[0]) # go over atoms for j in range(natoms): s1 = fin.readline().strip(" \n").split() posl = [float(s1[0]), float(s1[1]), float(s1[2])] posc = [0, 0, 0] for l in range(3): for x in range(3): posc[x] += posl[l] * self.avec[l][x] # create new atom self.atomList.append(Atom(sp, posc, posl)) fin.close() def printGeometry(self): print "lattice vectors" print " a1 : %12.6f %12.6f %12.6f"%(self.avec[0][0], self.avec[0][1], self.avec[0][2]) print " a2 : %12.6f %12.6f %12.6f"%(self.avec[1][0], self.avec[1][1], self.avec[1][2]) print " a3 : %12.6f %12.6f %12.6f"%(self.avec[2][0], self.avec[2][1], self.avec[2][2]) print "atoms" for i in range(len(self.atomList)): print "%4i (%2s) at position %12.6f %12.6f %12.6f"%\ (i, self.atomList[i].species.label, self.atomList[i].posc[0],\ self.atomList[i].posc[1], self.atomList[i].posc[2]) def findNeighbours(self): for iat in range(len(self.atomList)): xi = self.atomList[iat].posc nn = [] # add nearest neigbours for jat in range(len(self.atomList)): xj = self.atomList[jat].posc for i1 in range(-4,5): for i2 in range(-4,5): for i3 in range(-4,5): t = [0, 0, 0] for x in range(3): t[x] = i1 * self.avec[0][x] + i2 * self.avec[1][x] + i3 * self.avec[2][x] r = [0, 0, 0] for x in range(3): r[x] = xj[x] + t[x] - xi[x] d = math.sqrt(r[0]**2 + r[1]**2 + r[2]**2) if (d <= 10.0): nn.append([jat, r, d]) # sort by distance for i in range(len(nn) - 1): for j in range(i+1, len(nn)): if nn[j][2] < nn[i][2]: nn[i], nn[j] = nn[j], nn[i] self.atomList[iat].nghbr = nn[:] # # cell (not necessarily primitive) with atoms and bonds # class Cell: def __init__(self, geometry, box): self.geometry = geometry self.box = box self.bonds = [] self.atoms = [] self.bondList = [] return def hide(self, label): print " " print "hiding", label self.geometry.speciesList[label].visible = False return def atomSphere(self, label, color, R): self.geometry.speciesList[label].color = color self.geometry.speciesList[label].R = R return def bond(self, label1, label2, length, extend): self.bondList.append([label1, label2, length, extend]) return def atomOrbital(self, ias, fname, iorb): fin = open(fname, "r") f1 = [] for i in range(5): s1 = fin.readline().strip(" \n").split() if i == (iorb - 1): for j in range(5): f1.append(float(s1[j])) self.geometry.atomList[ias].orbital = Orbital(f1) return def write(self): self.fillBox() self.makeBonds() self.writeAtoms() self.writeBonds() #self.writeOrbitals() # def inBox(self, p, box): # n=[0,0,0] # a=box[0] # b=box[1] # c=box[2] # i=0 # # n[0]=a[1]*b[2]-a[2]*b[1] # n[1]=a[2]*b[0]-a[0]*b[2] # n[2]=a[0]*b[1]-a[1]*b[0] # d1=n[0]*p[0]+n[1]*p[1]+n[2]*p[2] # d2=n[0]*(p[0]-c[0])+n[1]*(p[1]-c[1])+n[2]*(p[2]-c[2]) # if cmp(d1,0)*cmp(d2,0)==-1 or abs(d1) < 1e-4 or abs(d2) < 1e-4: # i+=1; # # n[0]=a[1]*c[2]-a[2]*c[1] # n[1]=a[2]*c[0]-a[0]*c[2] # n[2]=a[0]*c[1]-a[1]*c[0] # d1=n[0]*p[0]+n[1]*p[1]+n[2]*p[2] # d2=n[0]*(p[0]-b[0])+n[1]*(p[1]-b[1])+n[2]*(p[2]-b[2]) # if cmp(d1,0)*cmp(d2,0)==-1 or abs(d1) < 1e-4 or abs(d2) < 1e-4: # i+=1; # # n[0]=b[1]*c[2]-b[2]*c[1] # n[1]=b[2]*c[0]-b[0]*c[2] # n[2]=b[0]*c[1]-b[1]*c[0] # d1=n[0]*p[0]+n[1]*p[1]+n[2]*p[2] # d2=n[0]*(p[0]-a[0])+n[1]*(p[1]-a[1])+n[2]*(p[2]-a[2]) # if cmp(d1,0)*cmp(d2,0)==-1 or abs(d1) < 1e-4 or abs(d2) < 1e-4: # i+=1; # # if i==3: return True # else: return False def inBox(self, r, imv): # coorinates in the inits of box vectors rb = [0, 0, 0] for i in range(3): for j in range(3): rb[i] += imv[i][j] * r[j] if (rb[0] >= -0.5 and rb[0] <= 0.5) and \ (rb[1] >= -0.5 and rb[1] <= 0.5) and \ (rb[2] >= -0.5 and rb[2] <= 0.5): return True else: return False def fillBox(self): print " " print "populating the box" print " box parameters" print " center : %12.6f %12.6f %12.6f"%(self.box[0][0], self.box[0][1], self.box[0][2]) print " v1 : %12.6f %12.6f %12.6f"%(self.box[1][0], self.box[1][1], self.box[1][2]) print " v2 : %12.6f %12.6f %12.6f"%(self.box[2][0], self.box[2][1], self.box[2][2]) print " v3 : %12.6f %12.6f %12.6f"%(self.box[3][0], self.box[3][1], self.box[3][2]) mv = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] for i in range(3): for x in range(3): mv[x][i] = self.box[1+i][x] imv = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] r3minv(mv, imv) for ias in range(len(self.geometry.atomList)): if self.geometry.atomList[ias].species.visible: for i1 in range(-4, 5): for i2 in range(-4, 5): for i3 in range(-4, 5): # absolute position (position in the unit cell + translation) r = [0, 0, 0] for x in range(3): r[x] = self.geometry.atomList[ias].posc[x] + \ i1 * self.geometry.avec[0][x] + \ i2 * self.geometry.avec[1][x] + \ i3 * self.geometry.avec[2][x] # position with respect to the center of the box r0 = [0, 0, 0] for x in range(3): r0[x] = r[x] - self.box[0][x] if self.inBox(r0, imv): self.atoms.append([ias, r]) return def writeAtoms(self): print " " print "writing ATOMS.dx" fout = open("ATOMS.dx", "w+") fout.write("object 1 class array type float rank 0 items %i data follows\n"%len(self.atoms)) for i in range(len(self.atoms)): ias = self.atoms[i][0] fout.write("%f\n"%self.geometry.atomList[ias].species.R) fout.write("attribute \"dep\" string \"positions\"\n") fout.write("#\n") fout.write("object 2 class array type float rank 1 shape 3 items %i data follows\n"%len(self.atoms)) for i in range(len(self.atoms)): ias = self.atoms[i][0] color = self.geometry.atomList[ias].species.color fout.write("%f %f %f\n"%(color[0], color[1], color[2])) fout.write("attribute \"dep\" string \"positions\"\n") fout.write("#\n") fout.write("object 3 class array type float rank 1 shape 3 items %i data follows\n"%len(self.atoms)) for i in range(len(self.atoms)): ias = self.atoms[i][0] pos = self.atoms[i][1] fout.write("%f %f %f # %s\n"%(pos[0], pos[1], pos[2], self.geometry.atomList[ias].species.label)) fout.write("attribute \"dep\" string \"positions\"\n") fout.write("#\n") fout.write("object \"atoms\" class field\n") fout.write("component \"data\" value 1\n") fout.write("component \"colors\" value 2\n") fout.write("component \"positions\" value 3\n") fout.write("attribute \"name\" string \"cell\"") fout.close() return def index_in_atoms(self, r): for i in range(len(self.atoms)): if math.fabs(r[0] - self.atoms[i][1][0]) < 1e-10 and \ math.fabs(r[1] - self.atoms[i][1][1]) < 1e-10 and \ math.fabs(r[2] - self.atoms[i][1][2]) < 1e-10: return i return -1 def makeBonds(self): for ibond in range(len(self.bondList)): lbl1 = self.bondList[ibond][0] lbl2 = self.bondList[ibond][1] length = self.bondList[ibond][2] extend = self.bondList[ibond][3] # go over all atoms in the box for i in range(len(self.atoms)): ias = self.atoms[i][0] if self.geometry.atomList[ias].species.label == lbl1: # go over nearest neigbours of atom ias for j in range(len(self.geometry.atomList[ias].nghbr)): jas = self.geometry.atomList[ias].nghbr[j][0] if (self.geometry.atomList[jas].species.label == lbl2) and \ (self.geometry.atomList[ias].nghbr[j][2] <= length): # absolute position of neigbour: position of central atom + connecting vector rj = [0, 0, 0] for x in range(3): rj[x] = self.atoms[i][1][x] + self.geometry.atomList[ias].nghbr[j][1][x] # index of this neigbour in the list of atoms in the box idx = self.index_in_atoms(rj) if idx!=-1: self.bonds.append([i, idx]) elif extend: self.atoms.append([jas, rj]) self.bonds.append([i, len(self.atoms)-1]) return def writeBonds(self): print " " print "writing BONDS.dx" fout = open("BONDS.dx","w+") fout.write("object 1 class array type float rank 1 shape 3 items %i data follows\n"%len(self.atoms)) for i in range(len(self.atoms)): pos = self.atoms[i][1] fout.write("%f %f %f\n"%(pos[0], pos[1], pos[2])) fout.write("#\n") fout.write("object 2 class array type int rank 1 shape 2 items %i data follows\n"%len(self.bonds)) for i in range(len(self.bonds)): fout.write("%i %i\n"%(self.bonds[i][0], self.bonds[i][1])) fout.write("attribute \"element type\" string \"lines\"\n") fout.write("attribute \"ref\" string \"positions\"\n") fout.write("#\n") fout.write("object \"atom_connect\" class field\n") fout.write("component \"positions\" value 1\n") fout.write("component \"connections\" value 2\n") fout.write("end\n") fout.close() return def writeOrbitals(self): print " " print "writing ORBITALS.dx" fout=open("ORBITALS.dx","w+") iorb=0 for iat in range(len(self.atomList)): print self.atomList[iat].orbital if self.atomList[iat].orbital != 0: iorb+=1 r0=self.atomList[iat].posc fout.write("object %i class array type float rank 1 shape 3 items %i data follows\n"%\ ((iorb-1)*2+1,len(self.atomList[iat].orbital.pos))) for i in range(len(self.atomList[iat].orbital.pos)): r=[0,0,0] for x in range(3): r[x]=r0[x]+self.atomList[iat].orbital.pos[i][x] fout.write("%f %f %f\n"%(r[0],r[1],r[2])) fout.write("#\n") fout.write("object %i class array type int rank 1 shape 3 items %i data follows\n"%\ ((iorb-1)*2+2,len(self.atomList[iat].orbital.tri))) for i in range(len(self.atomList[iat].orbital.tri)): fout.write("%i %i %i\n"%(self.atomList[iat].orbital.tri[i][0],\ self.atomList[iat].orbital.tri[i][1],\ self.atomList[iat].orbital.tri[i][2])) fout.write("attribute \"ref\" string \"positions\"\n") fout.write("attribute \"element type\" string \"triangles\"\n") fout.write("attribute \"dep\" string \"connections\"\n") fout.write("#\n") fout.write("object \"orbital%i\" class field\n"%iorb) fout.write("component \"positions\" value %i\n"%((iorb-1)*2+1)) fout.write("component \"connections\" value %i\n"%((iorb-1)*2+2)) fout.write("#\n") norb=iorb fout.write("object \"orbital\" class group\n") for iorb in range(norb): fout.write(" member %i value \"orbital%i\"\n"%(iorb,iorb+1)) fout.write("end\n") fout.close() # # # print " " print "GEOMTERY.OUT to OpenDX" print " " # # get the geometry # geometry = Geometry() # # 3D box (center point + 3 non-collinear vectors) # example: # box=[[0,0,0],[10,0,0],[0,10,0],[0,0,10]] box = [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]] #geometry.avec[0],geometry.avec[1],geometry.avec[2]] # # cell with user-defined shape # cell = Cell(geometry, box) # # cell.hide(label) # hides species with a given label # example: # cell.hide("Ca") #cell.hide("Y") # # cell.atomSphere(label,color,radius) # sets [r,g,b] color and radius of species with a given label # example: red Mn sphere with radius 1.0 # cell.atomSphere("Mn",[1.0,0.0,0.0],1.0) cell.atomSphere("La", [0.0, 1.0, 0.0], 1.0) cell.atomSphere("Cu", [1.0, 0.0, 0.0], 1.0) cell.atomSphere("O", [0.0, 0.0, 1.0], 1.0) # # cell.bond(label1,label2,d,extend) # defines a bond with a maximum length 'd' from species 'label1' to species 'label2' # if extend is True, the bond can go outside the box # example: Mn-O bond # cell.bond("Mn","O",5,True) cell.bond("Cu", "O", 5, True) # # cell.atomOrbital(j, file_name, i) # defines angular part of the site-centered orbital i for atom j; # the orbital coefficients are taken from file file_name # example: #cell.atomOrbital(4, "Cu1_mtrx.txt", 1) # # write to .dx files # cell.write()
gpl-3.0
FabianKnapp/nexmon
buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/share/doc/gcc-arm-none-eabi/html/gccint/Caller-Saves.html
3228
<html lang="en"> <head> <title>Caller Saves - GNU Compiler Collection (GCC) Internals</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="GNU Compiler Collection (GCC) Internals"> <meta name="generator" content="makeinfo 4.11"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Stack-and-Calling.html#Stack-and-Calling" title="Stack and Calling"> <link rel="prev" href="Aggregate-Return.html#Aggregate-Return" title="Aggregate Return"> <link rel="next" href="Function-Entry.html#Function-Entry" title="Function Entry"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1988-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being ``Funding Free Software'', the Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled ``GNU Free Documentation License''. (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.--> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <p> <a name="Caller-Saves"></a> Next:&nbsp;<a rel="next" accesskey="n" href="Function-Entry.html#Function-Entry">Function Entry</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="Aggregate-Return.html#Aggregate-Return">Aggregate Return</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Stack-and-Calling.html#Stack-and-Calling">Stack and Calling</a> <hr> </div> <h4 class="subsection">17.9.10 Caller-Saves Register Allocation</h4> <p>If you enable it, GCC can save registers around function calls. This makes it possible to use call-clobbered registers to hold variables that must live across calls. <div class="defun"> &mdash; Macro: <b>HARD_REGNO_CALLER_SAVE_MODE</b> (<var>regno, nregs</var>)<var><a name="index-HARD_005fREGNO_005fCALLER_005fSAVE_005fMODE-4289"></a></var><br> <blockquote><p>A C expression specifying which mode is required for saving <var>nregs</var> of a pseudo-register in call-clobbered hard register <var>regno</var>. If <var>regno</var> is unsuitable for caller save, <code>VOIDmode</code> should be returned. For most machines this macro need not be defined since GCC will select the smallest suitable mode. </p></blockquote></div> </body></html>
gpl-3.0
scith/htpc-manager_ynh
sources/libs/pySMART/attribute.py
3070
#Copyright (C) 2014 Marc Herndon # #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License, #version 2, as published by the Free Software Foundation. # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software #Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """ This module contains the definition of the `Attribute` class, used to represent individual SMART attributes associated with a `Device`. """ class Attribute(object): """ Contains all of the information associated with a single SMART attribute in a `Device`'s SMART table. This data is intended to exactly mirror that obtained through smartctl. """ def __init__(self, num, name, flags, value, worst, thresh, attr_type, updated, when_failed, raw): self.num = num """**(str):** Attribute's ID as a decimal value (1-255).""" self.name = name """ **(str):** Attribute's name, as reported by smartmontools' drive.db. """ self.flags = flags """**(str):** Attribute flags as a hexadecimal value (ie: 0x0032).""" self.value = value """**(str):** Attribute's current normalized value.""" self.worst = worst """**(str):** Worst recorded normalized value for this attribute.""" self.thresh = thresh """**(str):** Attribute's failure threshold.""" self.type = attr_type """**(str):** Attribute's type, generally 'pre-fail' or 'old-age'.""" self.updated = updated """ **(str):** When is this attribute updated? Generally 'Always' or 'Offline' """ self.when_failed = when_failed """ **(str):** When did this attribute cross below `pySMART.attribute.Attribute.thresh`? Reads '-' when not failed. Generally either 'FAILING_NOW' or 'In_the_Past' otherwise. """ self.raw = raw """**(str):** Attribute's current raw (non-normalized) value.""" def __repr__(self): """Define a basic representation of the class object.""" return "<SMART Attribute %r %s/%s raw:%s>" % ( self.name, self.value, self.thresh, self.raw) def __str__(self): """ Define a formatted string representation of the object's content. In the interest of not overflowing 80-character lines this does not print the value of `pySMART.attribute.Attribute.flags_hex`. """ return "{0:>3} {1:24}{2:4}{3:4}{4:4}{5:9}{6:8}{7:12}{8}".format( self.num, self.name, self.value, self.worst, self.thresh, self.type, self.updated, self.when_failed, self.raw) __all__ = ['Attribute']
gpl-3.0
jeroenbreen/metapolator
app/lib/ui/metapolator/view-rubberband/view-rubberband.js
354
define([ 'angular' , './view-rubberband-controller' , './view-rubberband-directive' ], function( angular , Controller , directive ) { "use strict"; return angular.module('mtk.viewRubberband', []) .controller('ViewRubberbandController', Controller) .directive('mtkViewRubberband', directive) ; });
gpl-3.0
jerbob92/CouchPotatoServer
couchpotato/core/downloaders/sabnzbd/__init__.py
2548
from .main import Sabnzbd def start(): return Sabnzbd() config = [{ 'name': 'sabnzbd', 'groups': [ { 'tab': 'downloaders', 'list': 'download_providers', 'name': 'sabnzbd', 'label': 'Sabnzbd', 'description': 'Use <a href="http://sabnzbd.org/" target="_blank">SABnzbd</a> (0.7+) to download NZBs.', 'wizard': True, 'options': [ { 'name': 'enabled', 'default': 0, 'type': 'enabler', 'radio_group': 'nzb', }, { 'name': 'host', 'default': 'localhost:8080', }, { 'name': 'api_key', 'label': 'Api Key', 'description': 'Used for all calls to Sabnzbd.', }, { 'name': 'category', 'label': 'Category', 'description': 'The category CP places the nzb in. Like <strong>movies</strong> or <strong>couchpotato</strong>', }, { 'name': 'priority', 'label': 'Priority', 'type': 'dropdown', 'default': '0', 'advanced': True, 'values': [('Paused', -2), ('Low', -1), ('Normal', 0), ('High', 1), ('Forced', 2)], 'description': 'Add to the queue with this priority.', }, { 'name': 'manual', 'default': False, 'type': 'bool', 'advanced': True, 'description': 'Disable this downloader for automated searches, but use it when I manually send a release.', }, { 'name': 'remove_complete', 'advanced': True, 'label': 'Remove NZB', 'default': False, 'type': 'bool', 'description': 'Remove the NZB from history after it completed.', }, { 'name': 'delete_failed', 'default': True, 'advanced': True, 'type': 'bool', 'description': 'Delete a release after the download has failed.', }, ], } ], }]
gpl-3.0
vineodd/PIMSim
GEM5Simulation/gem5/src/systemc/tests/systemc/1666-2011-compliance/sync_reset/sync_reset.cpp
11660
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *****************************************************************************/ // sync_reset.cpp -- test for // // Original Author: John Aynsley, Doulos, Inc. // // MODIFICATION LOG - modifiers, enter your name, affiliation, date and // // $Log: sync_reset.cpp,v $ // Revision 1.2 2011/05/08 19:18:46 acg // Andy Goodrich: remove extraneous + prefixes from git diff. // // sync_reset_on/off #define SC_INCLUDE_DYNAMIC_PROCESSES #include <systemc> using namespace sc_core; using std::cout; using std::endl; struct M2: sc_module { M2(sc_module_name _name) { SC_THREAD(ticker); SC_THREAD(calling); SC_THREAD(target1); t1 = sc_get_current_process_handle(); sc_spawn_options opt; opt.spawn_method(); opt.dont_initialize(); opt.set_sensitivity( &t1.reset_event() ); sc_spawn(sc_bind( &M2::reset_handler, this ), "reset_handler", &opt); SC_THREAD(target2); t2 = sc_get_current_process_handle(); SC_METHOD(target3); sensitive << ev; t3 = sc_get_current_process_handle(); count = 1; f0 = f1 = f2 = f3 = f4 = f5 = f6 = f7 = f8 = f9 = 0; f10 = f11 = f12 = f13 = f14 = f15 = f16 = f17 = f18 = f19 = 0; f20 = f21 = f22 = f23 = f24 = f25 = f26 = f27 = f28 = f29 = 0; f30 = f31 = f32 = f33 = f34 = f35 = f36 = f37 = f38 = f39 = 0; f40 = f41 = f42 = f43 = f44 = f45 = f46 = f47 = f48 = f49 = 0; } sc_process_handle t1, t2, t3; sc_event ev; int count; int f0, f1, f2, f3, f4, f5, f6, f7, f8, f9; int f10, f11, f12, f13, f14, f15, f16, f17, f18, f19; int f20, f21, f22, f23, f24, f25, f26, f27, f28, f29; int f30, f31, f32, f33, f34, f35, f36, f37, f38, f39; int f40, f41, f42, f43, f44, f45, f46, f47, f48, f49; void ticker() { for (;;) { wait(10, SC_NS); sc_assert( !sc_is_unwinding() ); ev.notify(); } } void calling() { count = 1; wait(15, SC_NS); // Target runs at 10 NS count = 2; t1.sync_reset_on(); // Target does not run at 15 NS wait(10, SC_NS); // Target is reset at 20 NS count = 3; wait(10, SC_NS); // Target is reset again at 30 NS count = 4; t1.sync_reset_off(); // Target does not run at 35 NS wait(10, SC_NS); // Target runs at 40 NS count = 5; t1.sync_reset_off(); // Double sync_reset_off wait(10, SC_NS); // Target runs at 50 NS count = 6; t1.sync_reset_on(); t1.disable(); wait(10, SC_NS); // Target does not run at 60 NS count = 7; t1.enable(); // Target does not run at 65 NS wait(10, SC_NS); // Target reset at 70 NS count = 8; t1.disable(); wait(10, SC_NS); // Target does not run at 80 NS count = 9; t1.sync_reset_off(); wait(10, SC_NS); // Target still disabled at 90 NS count = 10; t1.enable(); wait(10, SC_NS); // Target runs at 100 NS count = 11; t1.suspend(); wait(10, SC_NS); // Target does not run at 110 NS count = 12; wait(10, SC_NS); // Target still suspended at 120 NS count = 13; t1.resume(); // Target runs at 125 NS wait(1, SC_NS); count = 14; wait(9, SC_NS); // Target runs again at 130 NS count = 15; t1.sync_reset_on(); // Double sync_reset_on wait(10, SC_NS); // Target reset at 140 NS count = 16; t1.sync_reset_off(); wait(10, SC_NS); // Target runs at 150 NS count = 17; t1.sync_reset_off(); wait(10, SC_NS); // Target runs at 160 NS count = 18; t1.sync_reset_on(); wait(10, SC_NS); // Target reset at 170 NS count = 19; t1.reset(); // Target reset at 175 NS wait(SC_ZERO_TIME); count = 20; wait(1, SC_NS); t1.reset(); // Target reset at 176 NS count = 21; t1.reset(); // Target reset at 176 NS wait(1, SC_NS); count = 22; wait(8, SC_NS); // Target reset at 180 NS count = 23; wait(10, SC_NS); // Target reset at 190 NS count = 24; t1.sync_reset_off(); wait(10, SC_NS); // Target runs at 200 NS count = 25; wait(10, SC_NS); // Target runs at 210 NS count = 26; t1.reset(); wait(SC_ZERO_TIME); // Target reset at 215 t1.disable(); // Close it down wait(sc_time(300, SC_NS) - sc_time_stamp()); count = 27; t2.resume(); wait(SC_ZERO_TIME); count = 28; wait(15, SC_NS); count = 29; t2.sync_reset_on(); wait(10, SC_NS); t2.sync_reset_off(); t2.suspend(); wait(sc_time(405, SC_NS) - sc_time_stamp()); count = 30; t3.resume(); wait(SC_ZERO_TIME); count = 31; wait(10, SC_NS); count = 32; t3.sync_reset_on(); wait(10, SC_NS); sc_stop(); } void target1() { //cout << "Target1 called/reset at " << sc_time_stamp() << " count = " << count << endl; switch (count) { case 1: sc_assert( sc_time_stamp() == sc_time(0, SC_NS) ); f0=1; break; case 2: sc_assert( sc_time_stamp() == sc_time(20, SC_NS) ); f1=1; break; case 3: sc_assert( sc_time_stamp() == sc_time(30, SC_NS) ); f2=1; break; case 7: sc_assert( sc_time_stamp() == sc_time(70, SC_NS) ); f3=1; break; case 15: sc_assert( sc_time_stamp() == sc_time(140, SC_NS) ); f4=1; break; case 18: sc_assert( sc_time_stamp() == sc_time(170, SC_NS) ); f5=1; break; case 19: sc_assert( sc_time_stamp() == sc_time(175, SC_NS) ); f6=1; break; case 20: sc_assert( sc_time_stamp() == sc_time(176, SC_NS) ); f7=1; break; case 21: sc_assert( sc_time_stamp() == sc_time(176, SC_NS) ); f8=1; break; case 22: sc_assert( sc_time_stamp() == sc_time(180, SC_NS) ); f9=1; break; case 23: sc_assert( sc_time_stamp() == sc_time(190, SC_NS) ); f10=1; break; case 26: sc_assert( sc_time_stamp() == sc_time(215, SC_NS) ); f11=1; break; default: sc_assert( false ); break; } for (;;) { try { wait(ev); //cout << "Target1 awoke at " << sc_time_stamp() << " count = " << count << endl; sc_assert( !sc_is_unwinding() ); switch (count) { case 1: sc_assert( sc_time_stamp() == sc_time(10, SC_NS) ); f12=1; break; case 4: sc_assert( sc_time_stamp() == sc_time(40, SC_NS) ); f13=1; break; case 5: sc_assert( sc_time_stamp() == sc_time(50, SC_NS) ); f14=1; break; case 10: sc_assert( sc_time_stamp() == sc_time(100, SC_NS) ); f15=1; break; case 13: sc_assert( sc_time_stamp() == sc_time(125, SC_NS) ); f16=1; break; case 14: sc_assert( sc_time_stamp() == sc_time(130, SC_NS) ); f17=1; break; case 16: sc_assert( sc_time_stamp() == sc_time(150, SC_NS) ); f18=1; break; case 17: sc_assert( sc_time_stamp() == sc_time(160, SC_NS) ); f19=1; break; case 24: sc_assert( sc_time_stamp() == sc_time(200, SC_NS) ); f20=1; break; case 25: sc_assert( sc_time_stamp() == sc_time(210, SC_NS) ); f21=1; break; default: sc_assert( false ); break; } } catch (const sc_unwind_exception& ex) { sc_assert( sc_is_unwinding() ); sc_assert( ex.is_reset() ); throw ex; } } } void reset_handler() { //cout << "reset_handler awoke at " << sc_time_stamp() << " count = " << count << endl; sc_assert( !sc_is_unwinding() ); switch (count) { case 2: sc_assert( sc_time_stamp() == sc_time(20, SC_NS) ); f22=1; break; case 3: sc_assert( sc_time_stamp() == sc_time(30, SC_NS) ); f23=1; break; case 7: sc_assert( sc_time_stamp() == sc_time(70, SC_NS) ); f24=1; break; case 15: sc_assert( sc_time_stamp() == sc_time(140, SC_NS) ); f27=1; break;; case 18: sc_assert( sc_time_stamp() == sc_time(170, SC_NS) ); f28=1; break; case 19: sc_assert( sc_time_stamp() == sc_time(175, SC_NS) ); f29=1; break; case 21: sc_assert( sc_time_stamp() == sc_time(176, SC_NS) ); f31=1; break; case 22: sc_assert( sc_time_stamp() == sc_time(180, SC_NS) ); f32=1; break; case 23: sc_assert( sc_time_stamp() == sc_time(190, SC_NS) ); f33=1; break; case 26: sc_assert( sc_time_stamp() == sc_time(215, SC_NS) ); f34=1; break; default: sc_assert( false ); break; } } void target2() { if (sc_delta_count() == 0) t2.suspend(); // Hack to work around not being able to call suspend during elab switch (count) { case 27: sc_assert( sc_time_stamp() == sc_time(300, SC_NS) ); f35=1; break; case 29: sc_assert( sc_time_stamp() == sc_time(320, SC_NS) ); f37=1; break; default: sc_assert( false ); break; } while(1) { try { wait(10, SC_NS); } catch (const sc_unwind_exception& e) { switch (count) { case 29: sc_assert( sc_time_stamp() == sc_time(320, SC_NS) ); f38=1; break; default: sc_assert( false ); break; } throw e; } switch (count) { case 28: sc_assert( sc_time_stamp() == sc_time(310, SC_NS) ); f36=1; break; default: sc_assert( false ); break; } } } void target3() { if (sc_delta_count() == 0) t3.suspend(); // Hack to work around not being able to call suspend during elab switch (count) { case 1: sc_assert( sc_time_stamp() == sc_time(0, SC_NS) ); break; case 30: sc_assert( sc_time_stamp() == sc_time(405, SC_NS) ); f39=1; break; case 31: sc_assert( sc_time_stamp() == sc_time(410, SC_NS) ); f40=1; break; case 32: sc_assert( sc_time_stamp() == sc_time(420, SC_NS) ); f41=1; break; default: sc_assert( false ); break; } } SC_HAS_PROCESS(M2); }; int sc_main(int argc, char* argv[]) { M2 m("m"); sc_start(); sc_assert(m.f0); sc_assert(m.f1); sc_assert(m.f2); sc_assert(m.f3); sc_assert(m.f4); sc_assert(m.f5); sc_assert(m.f6); sc_assert(m.f7); sc_assert(m.f8); sc_assert(m.f9); sc_assert(m.f10); sc_assert(m.f11); sc_assert(m.f12); sc_assert(m.f13); sc_assert(m.f14); sc_assert(m.f15); sc_assert(m.f16); sc_assert(m.f17); sc_assert(m.f18); sc_assert(m.f19); sc_assert(m.f20); sc_assert(m.f21); sc_assert(m.f22); sc_assert(m.f23); sc_assert(m.f24); sc_assert(m.f27); sc_assert(m.f28); sc_assert(m.f29); sc_assert(m.f31); sc_assert(m.f32); sc_assert(m.f33); sc_assert(m.f34); sc_assert(m.f35); sc_assert(m.f36); sc_assert(m.f37); sc_assert(m.f38); sc_assert(m.f39); sc_assert(m.f40); sc_assert(m.f41); cout << endl << "Success" << endl; return 0; }
gpl-3.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/blimp/common/compositor/reference_tracker_unittest.cc
6177
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "blimp/common/compositor/reference_tracker.h" #include <stdint.h> #include <algorithm> #include <unordered_set> #include <vector> #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace blimp { namespace { class ReferenceTrackerTest : public testing::Test { public: ReferenceTrackerTest() = default; ~ReferenceTrackerTest() override = default; protected: ReferenceTracker tracker_; std::vector<uint32_t> added_; std::vector<uint32_t> removed_; private: DISALLOW_COPY_AND_ASSIGN(ReferenceTrackerTest); }; TEST_F(ReferenceTrackerTest, SingleItemCommitFlow) { tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); uint32_t item = 1; tracker_.IncrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); tracker_.DecrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item)); } TEST_F(ReferenceTrackerTest, SingleItemMultipleTimesInSingleCommit) { uint32_t item = 1; tracker_.IncrementRefCount(item); tracker_.IncrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); tracker_.DecrementRefCount(item); tracker_.DecrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item)); } TEST_F(ReferenceTrackerTest, SingleItemMultipleTimesAcrossCommits) { uint32_t item = 1; tracker_.IncrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.IncrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); tracker_.DecrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); tracker_.DecrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item)); } TEST_F(ReferenceTrackerTest, SingleItemComplexInteractions) { uint32_t item = 1; tracker_.IncrementRefCount(item); tracker_.DecrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); tracker_.IncrementRefCount(item); tracker_.DecrementRefCount(item); tracker_.IncrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.DecrementRefCount(item); tracker_.IncrementRefCount(item); tracker_.DecrementRefCount(item); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item)); } TEST_F(ReferenceTrackerTest, MultipleItems) { uint32_t item1 = 1; uint32_t item2 = 2; uint32_t item3 = 3; tracker_.IncrementRefCount(item1); tracker_.IncrementRefCount(item2); tracker_.IncrementRefCount(item3); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item1, item2, item3)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.DecrementRefCount(item3); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item3)); removed_.clear(); tracker_.DecrementRefCount(item2); tracker_.IncrementRefCount(item3); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item3)); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item2)); added_.clear(); removed_.clear(); tracker_.IncrementRefCount(item2); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item2)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.DecrementRefCount(item1); tracker_.DecrementRefCount(item2); tracker_.DecrementRefCount(item3); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item1, item2, item3)); } TEST_F(ReferenceTrackerTest, MultipleItemsWithClear) { uint32_t item1 = 1; uint32_t item2 = 2; tracker_.IncrementRefCount(item1); tracker_.IncrementRefCount(item2); tracker_.ClearRefCounts(); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_TRUE(added_.empty()); EXPECT_TRUE(removed_.empty()); tracker_.IncrementRefCount(item1); tracker_.IncrementRefCount(item2); tracker_.ClearRefCounts(); tracker_.IncrementRefCount(item1); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item1)); EXPECT_TRUE(removed_.empty()); added_.clear(); tracker_.ClearRefCounts(); tracker_.IncrementRefCount(item2); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item2)); EXPECT_THAT(removed_, testing::UnorderedElementsAre(item1)); added_.clear(); removed_.clear(); tracker_.ClearRefCounts(); tracker_.IncrementRefCount(item1); tracker_.IncrementRefCount(item2); tracker_.CommitRefCounts(&added_, &removed_); EXPECT_THAT(added_, testing::UnorderedElementsAre(item1)); EXPECT_TRUE(removed_.empty()); added_.clear(); } } // namespace } // namespace blimp
gpl-3.0
ahilles107/Newscoop
newscoop/js/tinymce/plugins/codehighlighting/langs/pt.js
494
// UK lang variables tinyMCE.addI18n('pt.codehighlighting',{ codehighlighting_desc : "Code Highlighting", codehighlighting_title : "Code Highlighting", codehighlighting_langaugepicker : "Choose the language", codehighlighting_pagecode : "Paste your code here", codehighlighting_button_desc: "Insert code", codehighlighting_nogutter : "No Gutter", codehighlighting_collapse : "Collapse", codehighlighting_nocontrols : "No Controls", codehighlighting_showcolumns : "Show Columns" });
gpl-3.0
victorzhao/miniblink49
v8_4_5/test/mjsunit/array-length.js
4264
// Copyright 2008 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var a = [0,1,2,3]; assertEquals(0, a.length = 0); assertEquals('undefined', typeof a[0]); assertEquals('undefined', typeof a[1]); assertEquals('undefined', typeof a[2]); assertEquals('undefined', typeof a[3]); var a = [0,1,2,3]; assertEquals(2, a.length = 2); assertEquals(0, a[0]); assertEquals(1, a[1]); assertEquals('undefined', typeof a[2]); assertEquals('undefined', typeof a[3]); var a = new Array(); a[0] = 0; a[1000] = 1000; a[1000000] = 1000000; a[2000000] = 2000000; assertEquals(2000001, a.length); assertEquals(0, a.length = 0); assertEquals(0, a.length); assertEquals('undefined', typeof a[0]); assertEquals('undefined', typeof a[1000]); assertEquals('undefined', typeof a[1000000]); assertEquals('undefined', typeof a[2000000]); var a = new Array(); a[0] = 0; a[1000] = 1000; a[1000000] = 1000000; a[2000000] = 2000000; assertEquals(2000001, a.length); assertEquals(2000, a.length = 2000); assertEquals(2000, a.length); assertEquals(0, a[0]); assertEquals(1000, a[1000]); assertEquals('undefined', typeof a[1000000]); assertEquals('undefined', typeof a[2000000]); var a = new Array(); a[Math.pow(2,31)-1] = 0; a[Math.pow(2,30)-1] = 0; assertEquals(Math.pow(2,31), a.length); var a = new Array(); a[0] = 0; a[1000] = 1000; a[Math.pow(2,30)-1] = Math.pow(2,30)-1; a[Math.pow(2,31)-1] = Math.pow(2,31)-1; a[Math.pow(2,32)-2] = Math.pow(2,32)-2; assertEquals(Math.pow(2,30)-1, a[Math.pow(2,30)-1]); assertEquals(Math.pow(2,31)-1, a[Math.pow(2,31)-1]); assertEquals(Math.pow(2,32)-2, a[Math.pow(2,32)-2]); assertEquals(Math.pow(2,32)-1, a.length); assertEquals(Math.pow(2,30) + 1, a.length = Math.pow(2,30)+1); // not a smi! assertEquals(Math.pow(2,30)+1, a.length); assertEquals(0, a[0]); assertEquals(1000, a[1000]); assertEquals(Math.pow(2,30)-1, a[Math.pow(2,30)-1]); assertEquals('undefined', typeof a[Math.pow(2,31)-1]); assertEquals('undefined', typeof a[Math.pow(2,32)-2], "top"); var a = new Array(); assertEquals(Object(12), a.length = new Number(12)); assertEquals(12, a.length); Number.prototype.valueOf = function() { return 10; } var n = new Number(100); assertEquals(n, a.length = n); assertEquals(10, a.length); n.valueOf = function() { return 20; } assertEquals(n, a.length = n); assertEquals(20, a.length); var o = { length: -23 }; Array.prototype.pop.apply(o); assertEquals(4294967272, o.length); // Check case of compiled stubs. var a = []; for (var i = 0; i < 7; i++) { assertEquals(3, a.length = 3); var t = 239; t = a.length = 7; assertEquals(7, t); } (function () { "use strict"; var frozen_object = Object.freeze({__proto__:[]}); assertThrows(function () { frozen_object.length = 10 }); })();
gpl-3.0
mupen64plus-ae/mupen64plus-ae
mupen64plus-video-gliden64/upstream/src/Debugger.h
4229
#ifndef DEBUGGER_H #include <set> #include <list> #include <array> #include <vector> #include <memory> #include "Graphics/Context.h" #include "Graphics/Parameters.h" #include "gSP.h" #include "gDP.h" #include "Textures.h" enum TriangleType { ttTriangle, ttTexrect, ttFillrect, ttBackground }; class Debugger { public: Debugger(); ~Debugger(); void checkDebugState(); void addTriangles(const graphics::Context::DrawTriangleParameters & _params); void addRects(const graphics::Context::DrawRectParameters & _params); bool isDebugMode() const { return m_bDebugMode; } bool isCaptureMode() const { return m_bCapture; } void draw(); private: struct TexInfo { f32 scales, scalet; const CachedTexture * texture; gDPLoadTileInfo texLoadInfo; }; struct Vertex { f32 x, y, z, w; f32 r, g, b, a; f32 s0, t0, s1, t1; u32 modify; Vertex() = default; Vertex(const SPVertex & _v) : x(_v.x) , y(_v.y) , z(_v.z) , w(_v.w) , r(_v.r) , g(_v.g) , b(_v.b) , a(_v.a) , s0(_v.s) , t0(_v.t) , s1(_v.s) , t1(_v.t) , modify(_v.modify) {} Vertex(const RectVertex & _v) : x(_v.x) , y(_v.y) , z(_v.z) , w(_v.w) , s0(_v.s0) , t0(_v.t0) , s1(_v.s1) , t1(_v.t1) , modify(MODIFY_XY | MODIFY_Z) { r = g = b = a = 0.0f; } }; struct TriInfo { std::array<Vertex, 3> vertices; gDPCombine combine; // Combine mode at the time of rendering u32 cycle_type; gDPInfo::OtherMode otherMode; u32 geometryMode; // geometry mode flags u32 frameBufferAddress; u32 tri_n; // Triangle number TriangleType type; // 0-normal, 1-texrect, 2-fillrect gSPInfo::Viewport viewport; // texture info std::array<std::unique_ptr<TexInfo>, 2> tex_info; // colors gDPInfo::Color fog_color; gDPInfo::Color blend_color; gDPInfo::Color env_color; gDPInfo::FillColor fill_color; gDPInfo::PrimColor prim_color; f32 primDepthZ, primDepthDeltaZ; f32 fogMultiplier, fogOffset; s32 K4, K5; f32 getScreenX(const Vertex & _v) const; f32 getScreenY(const Vertex & _v) const; f32 getScreenZ(const Vertex & _v) const; f32 getModelX(const Vertex & _v) const; f32 getModelY(const Vertex & _v) const; f32 getModelZ(const Vertex & _v) const; bool isInside(long x, long y) const; }; enum class Page { general, tex1, tex2, colors, blender, othermode_l, othermode_h, texcoords, coords, texinfo }; enum class TextureMode { texture, alpha, both }; void _fillTriInfo(TriInfo & _info); void _addTriangles(const graphics::Context::DrawTriangleParameters & _params); void _addTrianglesByElements(const graphics::Context::DrawTriangleParameters & _params); void _debugKeys(); void _drawFrameBuffer(FrameBuffer * _pBuffer); void _drawDebugInfo(); void _setTextureCombiner(); void _setLineCombiner(); void _drawTextureFrame(const RectVertex * _rect); void _drawTextureCache(); void _drawGeneral(f32 _ulx, f32 _uly, f32 _yShift); void _drawTex(f32 _ulx, f32 _uly, f32 _yShift); void _drawColors(f32 _ulx, f32 _uly, f32 _yShift); void _drawBlender(f32 _ulx, f32 _uly, f32 _yShift); void _drawOthermodeL(f32 _ulx, f32 _uly, f32 _yShift); void _drawOthermodeH(f32 _ulx, f32 _uly, f32 _yShift); void _drawTexCoords(f32 _ulx, f32 _uly, f32 _yShift); void _drawVertexCoords(f32 _ulx, f32 _uly, f32 _yShift); void _drawTexture(f32 _ulx, f32 _uly, f32 _lrx, f32 _lry, f32 _yShift); void _drawTriangleFrame(); void _drawMouseCursor(); void _findSelected(); typedef std::list<TriInfo> Triangles; typedef std::list<const TexInfo*> TexInfos; typedef std::set<u32> FrameBufferAddrs; Triangles m_triangles; Triangles::const_iterator m_triSel; const TexInfo * m_pCurTexInfo = nullptr; TextureMode m_textureMode = TextureMode::both; FrameBufferAddrs m_fbAddrs; FrameBufferAddrs::const_iterator m_curFBAddr; Page m_curPage = Page::general; bool m_bDebugMode = false; bool m_bCapture = false; long m_clickX = 0; long m_clickY = 0; u32 m_tmu = 0; u32 m_startTexRow[2]; TexInfos m_texturesToDisplay[2]; struct { u32 row, col; } m_selectedTexPos[2]; const u32 m_cacheViewerRows = 4; const u32 m_cacheViewerCols = 16; }; extern Debugger g_debugger; #endif // DEBUGGER_H
gpl-3.0
tpokorra/openpetra.js
csharp/ICT/Petra/Client/MPartner/Gui/UC_IndividualData_PreviousExperience.ManualCode.cs
9535
// // DO NOT REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // @Authors: // christiank // dinwiggy // // Copyright 2004-2010 by OM International // // This file is part of OpenPetra.org. // // OpenPetra.org is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // OpenPetra.org is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with OpenPetra.org. If not, see <http://www.gnu.org/licenses/>. // using System; using System.Data; using System.Windows.Forms; using Ict.Common; using Ict.Common.Controls; using Ict.Common.Remoting.Client; using Ict.Common.Verification; using Ict.Petra.Client.App.Core; using Ict.Petra.Client.App.Core.RemoteObjects; using Ict.Petra.Client.MPartner; using Ict.Petra.Shared; using Ict.Petra.Shared.Interfaces.MPartner; using Ict.Petra.Shared.MCommon; using Ict.Petra.Shared.MCommon.Data; using Ict.Petra.Shared.MPartner.Partner.Data; using Ict.Petra.Shared.MPersonnel; using Ict.Petra.Shared.MPersonnel.Personnel.Data; using Ict.Petra.Shared.MPersonnel.Person; using Ict.Petra.Shared.MPersonnel.Validation; namespace Ict.Petra.Client.MPartner.Gui { public partial class TUC_IndividualData_PreviousExperience { /// <summary>holds a reference to the Proxy System.Object of the Serverside UIConnector</summary> private IPartnerUIConnectorsPartnerEdit FPartnerEditUIConnector; #region Properties /// <summary>used for passing through the Clientside Proxy for the UIConnector</summary> public IPartnerUIConnectorsPartnerEdit PartnerEditUIConnector { get { return FPartnerEditUIConnector; } set { FPartnerEditUIConnector = value; } } #endregion #region Events /// <summary>todoComment</summary> public event TRecalculateScreenPartsEventHandler RecalculateScreenParts; #endregion /// <summary> /// todoComment /// </summary> public void SpecialInitUserControl(IndividualDataTDS AMainDS) { FMainDS = AMainDS; LoadDataOnDemand(); } /// <summary> /// add a new batch /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void NewRecord(System.Object sender, EventArgs e) { this.CreateNewPmPastExperience(); } // Sets the key for a new row private void NewRowManual(ref PmPastExperienceRow ARow) { ARow.PartnerKey = FMainDS.PPerson[0].PartnerKey; ARow.Key = Convert.ToInt32(TRemote.MCommon.WebConnectors.GetNextSequence(TSequenceNames.seq_past_experience)); } /// <summary> /// Performs checks to determine whether a deletion of the current /// row is permissable /// </summary> /// <param name="ARowToDelete">the currently selected row to be deleted</param> /// <param name="ADeletionQuestion">can be changed to a context-sensitive deletion confirmation question</param> /// <returns>true if user is permitted and able to delete the current row</returns> private bool PreDeleteManual(PmPastExperienceRow ARowToDelete, ref string ADeletionQuestion) { /*Code to execute before the delete can take place*/ ADeletionQuestion = Catalog.GetString("Are you sure you want to delete the current row?"); ADeletionQuestion += String.Format("{0}{0}({1} {2}, {3} {4})", Environment.NewLine, lblLocation.Text, txtLocation.Text, lblRole.Text, txtRole.Text); return true; } /// <summary> /// Code to be run after the deletion process /// </summary> /// <param name="ARowToDelete">the row that was/was to be deleted</param> /// <param name="AAllowDeletion">whether or not the user was permitted to delete</param> /// <param name="ADeletionPerformed">whether or not the deletion was performed successfully</param> /// <param name="ACompletionMessage">if specified, is the deletion completion message</param> private void PostDeleteManual(PmPastExperienceRow ARowToDelete, bool AAllowDeletion, bool ADeletionPerformed, string ACompletionMessage) { if (ADeletionPerformed) { DoRecalculateScreenParts(); } } private void DoRecalculateScreenParts() { OnRecalculateScreenParts(new TRecalculateScreenPartsEventArgs() { ScreenPart = TScreenPartEnum.spCounters }); } private void ShowDetailsManual(PmPastExperienceRow ARow) { // In theory, the next Method call could be done in Methods NewRowManual; however, NewRowManual runs before // the Row is actually added and this would result in the Count to be one too less, so we do the Method call here, short // of a non-existing 'AfterNewRowManual' Method.... DoRecalculateScreenParts(); } /// <summary> /// Gets the data from all controls on this UserControl. /// The data is stored in the DataTables/DataColumns to which the Controls /// are mapped. /// </summary> public void GetDataFromControls2() { // Get data out of the Controls only if there is at least one row of data (Note: Column Headers count as one row) if (grdDetails.Rows.Count > 1) { GetDataFromControls(); } } /// <summary> /// This Method is needed for UserControls who get dynamicly loaded on TabPages. /// Since we don't have controls on this UserControl that need adjusting after resizing /// on 'Large Fonts (120 DPI)', we don't need to do anything here. /// </summary> public void AdjustAfterResizing() { } /// <summary> /// called for HereFlag event for work location check box /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HereFlagChanged(object sender, EventArgs e) { if (this.chkHereFlag.Checked) { chkSimilarOrgFlag.Enabled = false; chkSimilarOrgFlag.Checked = true; } else { chkSimilarOrgFlag.Enabled = true; chkSimilarOrgFlag.Checked = false; } } /// <summary> /// Loads Previous Experience Data from Petra Server into FMainDS, if not already loaded. /// </summary> /// <returns>true if successful, otherwise false.</returns> private Boolean LoadDataOnDemand() { Boolean ReturnValue; try { // Make sure that Typed DataTables are already there at Client side if (FMainDS.PmPastExperience == null) { FMainDS.Tables.Add(new PmPastExperienceTable()); FMainDS.InitVars(); } if (TClientSettings.DelayedDataLoading && (FMainDS.PmPastExperience.Rows.Count == 0)) { FMainDS.Merge(FPartnerEditUIConnector.GetDataPersonnelIndividualData(TIndividualDataItemEnum.idiPreviousExperiences)); // Make DataRows unchanged if (FMainDS.PmPastExperience.Rows.Count > 0) { if (FMainDS.PmPastExperience.Rows[0].RowState != DataRowState.Added) { FMainDS.PmPastExperience.AcceptChanges(); } } } if (FMainDS.PmPastExperience.Rows.Count != 0) { ReturnValue = true; } else { ReturnValue = false; } } catch (System.NullReferenceException) { return false; } catch (Exception) { throw; } return ReturnValue; } private void OnRecalculateScreenParts(TRecalculateScreenPartsEventArgs e) { if (RecalculateScreenParts != null) { RecalculateScreenParts(this, e); } } private void ValidateDataDetailsManual(PmPastExperienceRow ARow) { TVerificationResultCollection VerificationResultCollection = FPetraUtilsObject.VerificationResultCollection; TSharedPersonnelValidation_Personnel.ValidatePreviousExperienceManual(this, ARow, ref VerificationResultCollection, FValidationControlsDict); } } }
gpl-3.0
uwehermann/pulseview
pv/data/analogsegment.hpp
2563
/* * This file is part of the PulseView project. * * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ #ifndef PULSEVIEW_PV_DATA_ANALOGSEGMENT_HPP #define PULSEVIEW_PV_DATA_ANALOGSEGMENT_HPP #include "segment.hpp" #include <utility> #include <vector> #include <QObject> using std::enable_shared_from_this; using std::pair; namespace AnalogSegmentTest { struct Basic; } namespace pv { namespace data { class Analog; class AnalogSegment : public Segment, public enable_shared_from_this<Segment> { Q_OBJECT public: struct EnvelopeSample { float min; float max; }; struct EnvelopeSection { uint64_t start; unsigned int scale; uint64_t length; EnvelopeSample *samples; }; private: struct Envelope { uint64_t length; uint64_t data_length; EnvelopeSample *samples; }; private: static const unsigned int ScaleStepCount = 10; static const int EnvelopeScalePower; static const int EnvelopeScaleFactor; static const float LogEnvelopeScaleFactor; static const uint64_t EnvelopeDataUnit; public: AnalogSegment(Analog& owner, uint32_t segment_id, uint64_t samplerate); virtual ~AnalogSegment(); void append_interleaved_samples(const float *data, size_t sample_count, size_t stride); float get_sample(int64_t sample_num) const; void get_samples(int64_t start_sample, int64_t end_sample, float* dest) const; const pair<float, float> get_min_max() const; float* get_iterator_value_ptr(SegmentDataIterator* it); void get_envelope_section(EnvelopeSection &s, uint64_t start, uint64_t end, float min_length) const; private: void reallocate_envelope(Envelope &e); void append_payload_to_envelope_levels(); private: Analog& owner_; struct Envelope envelope_levels_[ScaleStepCount]; float min_value_, max_value_; friend struct AnalogSegmentTest::Basic; }; } // namespace data } // namespace pv #endif // PULSEVIEW_PV_DATA_ANALOGSEGMENT_HPP
gpl-3.0
seemoo-lab/nexmon
buildtools/gcc-arm-none-eabi-5_4-2016q2-linux-x86/share/doc/gcc-arm-none-eabi/html/gdb/Set-Tracepoints.html
6285
<html lang="en"> <head> <title>Set Tracepoints - Debugging with GDB</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Debugging with GDB"> <meta name="generator" content="makeinfo 4.11"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Tracepoints.html#Tracepoints" title="Tracepoints"> <link rel="next" href="Analyze-Collected-Data.html#Analyze-Collected-Data" title="Analyze Collected Data"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- Copyright (C) 1988-2015 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being ``Free Software'' and ``Free Software Needs Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,'' and with the Back-Cover Texts as in (a) below. (a) The FSF's Back-Cover Text is: ``You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom.'' --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <p> <a name="Set-Tracepoints"></a> Next:&nbsp;<a rel="next" accesskey="n" href="Analyze-Collected-Data.html#Analyze-Collected-Data">Analyze Collected Data</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Tracepoints.html#Tracepoints">Tracepoints</a> <hr> </div> <h3 class="section">13.1 Commands to Set Tracepoints</h3> <p>Before running such a <dfn>trace experiment</dfn>, an arbitrary number of tracepoints can be set. A tracepoint is actually a special type of breakpoint (see <a href="Set-Breaks.html#Set-Breaks">Set Breaks</a>), so you can manipulate it using standard breakpoint commands. For instance, as with breakpoints, tracepoint numbers are successive integers starting from one, and many of the commands associated with tracepoints take the tracepoint number as their argument, to identify which tracepoint to work on. <p>For each tracepoint, you can specify, in advance, some arbitrary set of data that you want the target to collect in the trace buffer when it hits that tracepoint. The collected data can include registers, local variables, or global data. Later, you can use <span class="sc">gdb</span> commands to examine the values these data had at the time the tracepoint was hit. <p>Tracepoints do not support every breakpoint feature. Ignore counts on tracepoints have no effect, and tracepoints cannot run <span class="sc">gdb</span> commands when they are hit. Tracepoints may not be thread-specific either. <p><a name="index-fast-tracepoints-810"></a>Some targets may support <dfn>fast tracepoints</dfn>, which are inserted in a different way (such as with a jump instead of a trap), that is faster but possibly restricted in where they may be installed. <p><a name="index-static-tracepoints-811"></a><a name="index-markers_002c-static-tracepoints-812"></a><a name="index-probing-markers_002c-static-tracepoints-813"></a>Regular and fast tracepoints are dynamic tracing facilities, meaning that they can be used to insert tracepoints at (almost) any location in the target. Some targets may also support controlling <dfn>static tracepoints</dfn> from <span class="sc">gdb</span>. With static tracing, a set of instrumentation points, also known as <dfn>markers</dfn>, are embedded in the target program, and can be activated or deactivated by name or address. These are usually placed at locations which facilitate investigating what the target is actually doing. <span class="sc">gdb</span>'s support for static tracing includes being able to list instrumentation points, and attach them with <span class="sc">gdb</span> defined high level tracepoints that expose the whole range of convenience of <span class="sc">gdb</span>'s tracepoints support. Namely, support for collecting registers values and values of global or local (to the instrumentation point) variables; tracepoint conditions and trace state variables. The act of installing a <span class="sc">gdb</span> static tracepoint on an instrumentation point, or marker, is referred to as <dfn>probing</dfn> a static tracepoint marker. <p><code>gdbserver</code> supports tracepoints on some target systems. See <a href="Server.html#Server">Tracepoints support in <code>gdbserver</code></a>. <p>This section describes commands to set tracepoints and associated conditions and actions. <ul class="menu"> <li><a accesskey="1" href="Create-and-Delete-Tracepoints.html#Create-and-Delete-Tracepoints">Create and Delete Tracepoints</a> <li><a accesskey="2" href="Enable-and-Disable-Tracepoints.html#Enable-and-Disable-Tracepoints">Enable and Disable Tracepoints</a> <li><a accesskey="3" href="Tracepoint-Passcounts.html#Tracepoint-Passcounts">Tracepoint Passcounts</a> <li><a accesskey="4" href="Tracepoint-Conditions.html#Tracepoint-Conditions">Tracepoint Conditions</a> <li><a accesskey="5" href="Trace-State-Variables.html#Trace-State-Variables">Trace State Variables</a> <li><a accesskey="6" href="Tracepoint-Actions.html#Tracepoint-Actions">Tracepoint Actions</a> <li><a accesskey="7" href="Listing-Tracepoints.html#Listing-Tracepoints">Listing Tracepoints</a> <li><a accesskey="8" href="Listing-Static-Tracepoint-Markers.html#Listing-Static-Tracepoint-Markers">Listing Static Tracepoint Markers</a> <li><a accesskey="9" href="Starting-and-Stopping-Trace-Experiments.html#Starting-and-Stopping-Trace-Experiments">Starting and Stopping Trace Experiments</a> <li><a href="Tracepoint-Restrictions.html#Tracepoint-Restrictions">Tracepoint Restrictions</a> </ul> </body></html>
gpl-3.0
GitHubiyca/ARK-Dedicated-Server-Tool
SteamKit2/Base/Generated/Unified/SteamMsgPublishedFile.cs
92408
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ #pragma warning disable 1591 // Generated from: steammessages_publishedfile.steamclient.proto // Note: requires additional types generated from: google/protobuf/descriptor.proto // Note: requires additional types generated from: steammessages_unified_base.steamclient.proto namespace SteamKit2.Unified.Internal { [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Subscribe_Request")] public partial class CPublishedFile_Subscribe_Request : global::ProtoBuf.IExtensible { public CPublishedFile_Subscribe_Request() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private uint _list_type = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"list_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint list_type { get { return _list_type; } set { _list_type = value; } } private int _appid = default(int); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(int))] public int appid { get { return _appid; } set { _appid = value; } } private bool _notify_client = default(bool); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"notify_client", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool notify_client { get { return _notify_client; } set { _notify_client = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Subscribe_Response")] public partial class CPublishedFile_Subscribe_Response : global::ProtoBuf.IExtensible { public CPublishedFile_Subscribe_Response() {} private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Unsubscribe_Request")] public partial class CPublishedFile_Unsubscribe_Request : global::ProtoBuf.IExtensible { public CPublishedFile_Unsubscribe_Request() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private uint _list_type = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"list_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint list_type { get { return _list_type; } set { _list_type = value; } } private int _appid = default(int); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(int))] public int appid { get { return _appid; } set { _appid = value; } } private bool _notify_client = default(bool); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"notify_client", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool notify_client { get { return _notify_client; } set { _notify_client = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Unsubscribe_Response")] public partial class CPublishedFile_Unsubscribe_Response : global::ProtoBuf.IExtensible { public CPublishedFile_Unsubscribe_Response() {} private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_CanSubscribe_Request")] public partial class CPublishedFile_CanSubscribe_Request : global::ProtoBuf.IExtensible { public CPublishedFile_CanSubscribe_Request() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_CanSubscribe_Response")] public partial class CPublishedFile_CanSubscribe_Response : global::ProtoBuf.IExtensible { public CPublishedFile_CanSubscribe_Response() {} private bool _can_subscribe = default(bool); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"can_subscribe", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool can_subscribe { get { return _can_subscribe; } set { _can_subscribe = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Publish_Request")] public partial class CPublishedFile_Publish_Request : global::ProtoBuf.IExtensible { public CPublishedFile_Publish_Request() {} private uint _appid = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint appid { get { return _appid; } set { _appid = value; } } private uint _consumer_appid = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"consumer_appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint consumer_appid { get { return _consumer_appid; } set { _consumer_appid = value; } } private string _cloudfilename = ""; [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"cloudfilename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string cloudfilename { get { return _cloudfilename; } set { _cloudfilename = value; } } private string _preview_cloudfilename = ""; [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"preview_cloudfilename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string preview_cloudfilename { get { return _preview_cloudfilename; } set { _preview_cloudfilename = value; } } private string _title = ""; [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"title", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string title { get { return _title; } set { _title = value; } } private string _file_description = ""; [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"file_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string file_description { get { return _file_description; } set { _file_description = value; } } private uint _file_type = default(uint); [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"file_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint file_type { get { return _file_type; } set { _file_type = value; } } private string _consumer_shortcut_name = ""; [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"consumer_shortcut_name", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string consumer_shortcut_name { get { return _consumer_shortcut_name; } set { _consumer_shortcut_name = value; } } private string _youtube_username = ""; [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"youtube_username", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string youtube_username { get { return _youtube_username; } set { _youtube_username = value; } } private string _youtube_videoid = ""; [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"youtube_videoid", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string youtube_videoid { get { return _youtube_videoid; } set { _youtube_videoid = value; } } private uint _visibility = default(uint); [global::ProtoBuf.ProtoMember(11, IsRequired = false, Name=@"visibility", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint visibility { get { return _visibility; } set { _visibility = value; } } private string _redirect_uri = ""; [global::ProtoBuf.ProtoMember(12, IsRequired = false, Name=@"redirect_uri", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string redirect_uri { get { return _redirect_uri; } set { _redirect_uri = value; } } private readonly global::System.Collections.Generic.List<string> _tags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(13, Name=@"tags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> tags { get { return _tags; } } private string _collection_type = ""; [global::ProtoBuf.ProtoMember(14, IsRequired = false, Name=@"collection_type", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string collection_type { get { return _collection_type; } set { _collection_type = value; } } private string _game_type = ""; [global::ProtoBuf.ProtoMember(15, IsRequired = false, Name=@"game_type", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string game_type { get { return _game_type; } set { _game_type = value; } } private string _url = ""; [global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"url", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string url { get { return _url; } set { _url = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Publish_Response")] public partial class CPublishedFile_Publish_Response : global::ProtoBuf.IExtensible { public CPublishedFile_Publish_Response() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private string _redirect_uri = ""; [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"redirect_uri", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string redirect_uri { get { return _redirect_uri; } set { _redirect_uri = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetDetails_Request")] public partial class CPublishedFile_GetDetails_Request : global::ProtoBuf.IExtensible { public CPublishedFile_GetDetails_Request() {} private readonly global::System.Collections.Generic.List<ulong> _publishedfileids = new global::System.Collections.Generic.List<ulong>(); [global::ProtoBuf.ProtoMember(1, Name=@"publishedfileids", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] public global::System.Collections.Generic.List<ulong> publishedfileids { get { return _publishedfileids; } } private bool _includetags = default(bool); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"includetags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includetags { get { return _includetags; } set { _includetags = value; } } private bool _includeadditionalpreviews = default(bool); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"includeadditionalpreviews", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includeadditionalpreviews { get { return _includeadditionalpreviews; } set { _includeadditionalpreviews = value; } } private bool _includechildren = default(bool); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"includechildren", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includechildren { get { return _includechildren; } set { _includechildren = value; } } private bool _includekvtags = default(bool); [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"includekvtags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includekvtags { get { return _includekvtags; } set { _includekvtags = value; } } private bool _includevotes = default(bool); [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"includevotes", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includevotes { get { return _includevotes; } set { _includevotes = value; } } private bool _short_description = default(bool); [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"short_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool short_description { get { return _short_description; } set { _short_description = value; } } private bool _includeforsaledata = default(bool); [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"includeforsaledata", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includeforsaledata { get { return _includeforsaledata; } set { _includeforsaledata = value; } } private bool _includemetadata = default(bool); [global::ProtoBuf.ProtoMember(11, IsRequired = false, Name=@"includemetadata", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool includemetadata { get { return _includemetadata; } set { _includemetadata = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"PublishedFileDetails")] public partial class PublishedFileDetails : global::ProtoBuf.IExtensible { public PublishedFileDetails() {} private uint _result = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"result", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint result { get { return _result; } set { _result = value; } } private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private ulong _creator = default(ulong); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"creator", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong creator { get { return _creator; } set { _creator = value; } } private uint _creator_appid = default(uint); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"creator_appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint creator_appid { get { return _creator_appid; } set { _creator_appid = value; } } private uint _consumer_appid = default(uint); [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"consumer_appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint consumer_appid { get { return _consumer_appid; } set { _consumer_appid = value; } } private uint _consumer_shortcutid = default(uint); [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"consumer_shortcutid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint consumer_shortcutid { get { return _consumer_shortcutid; } set { _consumer_shortcutid = value; } } private string _filename = ""; [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"filename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string filename { get { return _filename; } set { _filename = value; } } private ulong _file_size = default(ulong); [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"file_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong file_size { get { return _file_size; } set { _file_size = value; } } private ulong _preview_file_size = default(ulong); [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"preview_file_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong preview_file_size { get { return _preview_file_size; } set { _preview_file_size = value; } } private string _file_url = ""; [global::ProtoBuf.ProtoMember(10, IsRequired = false, Name=@"file_url", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string file_url { get { return _file_url; } set { _file_url = value; } } private string _preview_url = ""; [global::ProtoBuf.ProtoMember(11, IsRequired = false, Name=@"preview_url", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string preview_url { get { return _preview_url; } set { _preview_url = value; } } private string _youtubevideoid = ""; [global::ProtoBuf.ProtoMember(12, IsRequired = false, Name=@"youtubevideoid", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string youtubevideoid { get { return _youtubevideoid; } set { _youtubevideoid = value; } } private string _url = ""; [global::ProtoBuf.ProtoMember(13, IsRequired = false, Name=@"url", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string url { get { return _url; } set { _url = value; } } private ulong _hcontent_file = default(ulong); [global::ProtoBuf.ProtoMember(14, IsRequired = false, Name=@"hcontent_file", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong hcontent_file { get { return _hcontent_file; } set { _hcontent_file = value; } } private ulong _hcontent_preview = default(ulong); [global::ProtoBuf.ProtoMember(15, IsRequired = false, Name=@"hcontent_preview", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong hcontent_preview { get { return _hcontent_preview; } set { _hcontent_preview = value; } } private string _title = ""; [global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"title", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string title { get { return _title; } set { _title = value; } } private string _file_description = ""; [global::ProtoBuf.ProtoMember(17, IsRequired = false, Name=@"file_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string file_description { get { return _file_description; } set { _file_description = value; } } private string _short_description = ""; [global::ProtoBuf.ProtoMember(18, IsRequired = false, Name=@"short_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string short_description { get { return _short_description; } set { _short_description = value; } } private uint _time_created = default(uint); [global::ProtoBuf.ProtoMember(19, IsRequired = false, Name=@"time_created", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint time_created { get { return _time_created; } set { _time_created = value; } } private uint _time_updated = default(uint); [global::ProtoBuf.ProtoMember(20, IsRequired = false, Name=@"time_updated", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint time_updated { get { return _time_updated; } set { _time_updated = value; } } private uint _visibility = default(uint); [global::ProtoBuf.ProtoMember(21, IsRequired = false, Name=@"visibility", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint visibility { get { return _visibility; } set { _visibility = value; } } private uint _flags = default(uint); [global::ProtoBuf.ProtoMember(22, IsRequired = false, Name=@"flags", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint flags { get { return _flags; } set { _flags = value; } } private bool _workshop_file = default(bool); [global::ProtoBuf.ProtoMember(23, IsRequired = false, Name=@"workshop_file", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool workshop_file { get { return _workshop_file; } set { _workshop_file = value; } } private bool _workshop_accepted = default(bool); [global::ProtoBuf.ProtoMember(24, IsRequired = false, Name=@"workshop_accepted", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool workshop_accepted { get { return _workshop_accepted; } set { _workshop_accepted = value; } } private bool _show_subscribe_all = default(bool); [global::ProtoBuf.ProtoMember(25, IsRequired = false, Name=@"show_subscribe_all", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool show_subscribe_all { get { return _show_subscribe_all; } set { _show_subscribe_all = value; } } private int _num_comments_developer = default(int); [global::ProtoBuf.ProtoMember(26, IsRequired = false, Name=@"num_comments_developer", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(int))] public int num_comments_developer { get { return _num_comments_developer; } set { _num_comments_developer = value; } } private int _num_comments_public = default(int); [global::ProtoBuf.ProtoMember(27, IsRequired = false, Name=@"num_comments_public", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(int))] public int num_comments_public { get { return _num_comments_public; } set { _num_comments_public = value; } } private bool _banned = default(bool); [global::ProtoBuf.ProtoMember(28, IsRequired = false, Name=@"banned", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool banned { get { return _banned; } set { _banned = value; } } private string _ban_reason = ""; [global::ProtoBuf.ProtoMember(29, IsRequired = false, Name=@"ban_reason", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string ban_reason { get { return _ban_reason; } set { _ban_reason = value; } } private ulong _banner = default(ulong); [global::ProtoBuf.ProtoMember(30, IsRequired = false, Name=@"banner", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong banner { get { return _banner; } set { _banner = value; } } private bool _can_be_deleted = default(bool); [global::ProtoBuf.ProtoMember(31, IsRequired = false, Name=@"can_be_deleted", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool can_be_deleted { get { return _can_be_deleted; } set { _can_be_deleted = value; } } private bool _incompatible = default(bool); [global::ProtoBuf.ProtoMember(32, IsRequired = false, Name=@"incompatible", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool incompatible { get { return _incompatible; } set { _incompatible = value; } } private string _app_name = ""; [global::ProtoBuf.ProtoMember(33, IsRequired = false, Name=@"app_name", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string app_name { get { return _app_name; } set { _app_name = value; } } private uint _file_type = default(uint); [global::ProtoBuf.ProtoMember(34, IsRequired = false, Name=@"file_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint file_type { get { return _file_type; } set { _file_type = value; } } private bool _can_subscribe = default(bool); [global::ProtoBuf.ProtoMember(35, IsRequired = false, Name=@"can_subscribe", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool can_subscribe { get { return _can_subscribe; } set { _can_subscribe = value; } } private uint _subscriptions = default(uint); [global::ProtoBuf.ProtoMember(36, IsRequired = false, Name=@"subscriptions", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint subscriptions { get { return _subscriptions; } set { _subscriptions = value; } } private uint _favorited = default(uint); [global::ProtoBuf.ProtoMember(37, IsRequired = false, Name=@"favorited", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint favorited { get { return _favorited; } set { _favorited = value; } } private uint _followers = default(uint); [global::ProtoBuf.ProtoMember(38, IsRequired = false, Name=@"followers", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint followers { get { return _followers; } set { _followers = value; } } private uint _lifetime_subscriptions = default(uint); [global::ProtoBuf.ProtoMember(39, IsRequired = false, Name=@"lifetime_subscriptions", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint lifetime_subscriptions { get { return _lifetime_subscriptions; } set { _lifetime_subscriptions = value; } } private uint _lifetime_favorited = default(uint); [global::ProtoBuf.ProtoMember(40, IsRequired = false, Name=@"lifetime_favorited", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint lifetime_favorited { get { return _lifetime_favorited; } set { _lifetime_favorited = value; } } private uint _lifetime_followers = default(uint); [global::ProtoBuf.ProtoMember(41, IsRequired = false, Name=@"lifetime_followers", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint lifetime_followers { get { return _lifetime_followers; } set { _lifetime_followers = value; } } private uint _views = default(uint); [global::ProtoBuf.ProtoMember(42, IsRequired = false, Name=@"views", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint views { get { return _views; } set { _views = value; } } private uint _image_width = default(uint); [global::ProtoBuf.ProtoMember(43, IsRequired = false, Name=@"image_width", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint image_width { get { return _image_width; } set { _image_width = value; } } private uint _image_height = default(uint); [global::ProtoBuf.ProtoMember(44, IsRequired = false, Name=@"image_height", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint image_height { get { return _image_height; } set { _image_height = value; } } private string _image_url = ""; [global::ProtoBuf.ProtoMember(45, IsRequired = false, Name=@"image_url", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string image_url { get { return _image_url; } set { _image_url = value; } } private bool _spoiler_tag = default(bool); [global::ProtoBuf.ProtoMember(46, IsRequired = false, Name=@"spoiler_tag", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool spoiler_tag { get { return _spoiler_tag; } set { _spoiler_tag = value; } } private uint _shortcutid = default(uint); [global::ProtoBuf.ProtoMember(47, IsRequired = false, Name=@"shortcutid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint shortcutid { get { return _shortcutid; } set { _shortcutid = value; } } private string _shortcutname = ""; [global::ProtoBuf.ProtoMember(48, IsRequired = false, Name=@"shortcutname", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string shortcutname { get { return _shortcutname; } set { _shortcutname = value; } } private uint _num_children = default(uint); [global::ProtoBuf.ProtoMember(49, IsRequired = false, Name=@"num_children", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint num_children { get { return _num_children; } set { _num_children = value; } } private uint _num_reports = default(uint); [global::ProtoBuf.ProtoMember(50, IsRequired = false, Name=@"num_reports", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint num_reports { get { return _num_reports; } set { _num_reports = value; } } private readonly global::System.Collections.Generic.List<PublishedFileDetails.Preview> _previews = new global::System.Collections.Generic.List<PublishedFileDetails.Preview>(); [global::ProtoBuf.ProtoMember(51, Name=@"previews", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails.Preview> previews { get { return _previews; } } private readonly global::System.Collections.Generic.List<PublishedFileDetails.Tag> _tags = new global::System.Collections.Generic.List<PublishedFileDetails.Tag>(); [global::ProtoBuf.ProtoMember(52, Name=@"tags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails.Tag> tags { get { return _tags; } } private readonly global::System.Collections.Generic.List<PublishedFileDetails.Child> _children = new global::System.Collections.Generic.List<PublishedFileDetails.Child>(); [global::ProtoBuf.ProtoMember(53, Name=@"children", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails.Child> children { get { return _children; } } private readonly global::System.Collections.Generic.List<PublishedFileDetails.KVTag> _kvtags = new global::System.Collections.Generic.List<PublishedFileDetails.KVTag>(); [global::ProtoBuf.ProtoMember(54, Name=@"kvtags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails.KVTag> kvtags { get { return _kvtags; } } private PublishedFileDetails.VoteData _vote_data = null; [global::ProtoBuf.ProtoMember(55, IsRequired = false, Name=@"vote_data", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(null)] public PublishedFileDetails.VoteData vote_data { get { return _vote_data; } set { _vote_data = value; } } private uint _time_subscribed = default(uint); [global::ProtoBuf.ProtoMember(56, IsRequired = false, Name=@"time_subscribed", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint time_subscribed { get { return _time_subscribed; } set { _time_subscribed = value; } } private PublishedFileDetails.ForSaleData _for_sale_data = null; [global::ProtoBuf.ProtoMember(57, IsRequired = false, Name=@"for_sale_data", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(null)] public PublishedFileDetails.ForSaleData for_sale_data { get { return _for_sale_data; } set { _for_sale_data = value; } } private string _metadata = ""; [global::ProtoBuf.ProtoMember(58, IsRequired = false, Name=@"metadata", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string metadata { get { return _metadata; } set { _metadata = value; } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Tag")] public partial class Tag : global::ProtoBuf.IExtensible { public Tag() {} private string _tag = ""; [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"tag", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string tag { get { return _tag; } set { _tag = value; } } private bool _adminonly = default(bool); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"adminonly", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool adminonly { get { return _adminonly; } set { _adminonly = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Preview")] public partial class Preview : global::ProtoBuf.IExtensible { public Preview() {} private ulong _previewid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"previewid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong previewid { get { return _previewid; } set { _previewid = value; } } private uint _sortorder = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"sortorder", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint sortorder { get { return _sortorder; } set { _sortorder = value; } } private string _url = ""; [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"url", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string url { get { return _url; } set { _url = value; } } private uint _size = default(uint); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint size { get { return _size; } set { _size = value; } } private string _filename = ""; [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"filename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string filename { get { return _filename; } set { _filename = value; } } private string _youtubevideoid = ""; [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"youtubevideoid", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string youtubevideoid { get { return _youtubevideoid; } set { _youtubevideoid = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"Child")] public partial class Child : global::ProtoBuf.IExtensible { public Child() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private uint _sortorder = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"sortorder", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint sortorder { get { return _sortorder; } set { _sortorder = value; } } private uint _file_type = default(uint); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"file_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint file_type { get { return _file_type; } set { _file_type = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"KVTag")] public partial class KVTag : global::ProtoBuf.IExtensible { public KVTag() {} private string _key = ""; [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"key", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string key { get { return _key; } set { _key = value; } } private string _value = ""; [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"value", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string value { get { return _value; } set { _value = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"VoteData")] public partial class VoteData : global::ProtoBuf.IExtensible { public VoteData() {} private float _score = default(float); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"score", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(float))] public float score { get { return _score; } set { _score = value; } } private uint _votes_up = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"votes_up", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint votes_up { get { return _votes_up; } set { _votes_up = value; } } private uint _votes_down = default(uint); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"votes_down", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint votes_down { get { return _votes_down; } set { _votes_down = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ForSaleData")] public partial class ForSaleData : global::ProtoBuf.IExtensible { public ForSaleData() {} private bool _is_for_sale = default(bool); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"is_for_sale", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool is_for_sale { get { return _is_for_sale; } set { _is_for_sale = value; } } private uint _price_category = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"price_category", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint price_category { get { return _price_category; } set { _price_category = value; } } private PublishedFileDetails.EPublishedFileForSaleStatus _estatus = PublishedFileDetails.EPublishedFileForSaleStatus.k_PFFSS_NotForSale; [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"estatus", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(PublishedFileDetails.EPublishedFileForSaleStatus.k_PFFSS_NotForSale)] public PublishedFileDetails.EPublishedFileForSaleStatus estatus { get { return _estatus; } set { _estatus = value; } } private uint _price_category_floor = default(uint); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"price_category_floor", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint price_category_floor { get { return _price_category_floor; } set { _price_category_floor = value; } } private bool _price_is_pay_what_you_want = default(bool); [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"price_is_pay_what_you_want", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool price_is_pay_what_you_want { get { return _price_is_pay_what_you_want; } set { _price_is_pay_what_you_want = value; } } private uint _discount_percentage = default(uint); [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"discount_percentage", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint discount_percentage { get { return _discount_percentage; } set { _discount_percentage = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::ProtoBuf.ProtoContract(Name=@"EPublishedFileForSaleStatus", EnumPassthru=true)] public enum EPublishedFileForSaleStatus { [global::ProtoBuf.ProtoEnum(Name=@"k_PFFSS_NotForSale", Value=0)] k_PFFSS_NotForSale = 0, [global::ProtoBuf.ProtoEnum(Name=@"k_PFFSS_PendingApproval", Value=1)] k_PFFSS_PendingApproval = 1, [global::ProtoBuf.ProtoEnum(Name=@"k_PFFSS_ApprovedForSale", Value=2)] k_PFFSS_ApprovedForSale = 2, [global::ProtoBuf.ProtoEnum(Name=@"k_PFFSS_RejectedForSale", Value=3)] k_PFFSS_RejectedForSale = 3, [global::ProtoBuf.ProtoEnum(Name=@"k_PFFSS_NoLongerForSale", Value=4)] k_PFFSS_NoLongerForSale = 4 } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetDetails_Response")] public partial class CPublishedFile_GetDetails_Response : global::ProtoBuf.IExtensible { public CPublishedFile_GetDetails_Response() {} private readonly global::System.Collections.Generic.List<PublishedFileDetails> _publishedfiledetails = new global::System.Collections.Generic.List<PublishedFileDetails>(); [global::ProtoBuf.ProtoMember(1, Name=@"publishedfiledetails", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails> publishedfiledetails { get { return _publishedfiledetails; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetUserFiles_Request")] public partial class CPublishedFile_GetUserFiles_Request : global::ProtoBuf.IExtensible { public CPublishedFile_GetUserFiles_Request() {} private ulong _steamid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"steamid", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong steamid { get { return _steamid; } set { _steamid = value; } } private uint _appid = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint appid { get { return _appid; } set { _appid = value; } } private uint _page = (uint)1; [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"page", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue((uint)1)] public uint page { get { return _page; } set { _page = value; } } private uint _numperpage = (uint)1; [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"numperpage", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue((uint)1)] public uint numperpage { get { return _numperpage; } set { _numperpage = value; } } private string _type = @"myfiles"; [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"type", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(@"myfiles")] public string type { get { return _type; } set { _type = value; } } private string _sortmethod = @"lastupdated"; [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"sortmethod", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(@"lastupdated")] public string sortmethod { get { return _sortmethod; } set { _sortmethod = value; } } private uint _privacy = default(uint); [global::ProtoBuf.ProtoMember(9, IsRequired = false, Name=@"privacy", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint privacy { get { return _privacy; } set { _privacy = value; } } private readonly global::System.Collections.Generic.List<string> _requiredtags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(10, Name=@"requiredtags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> requiredtags { get { return _requiredtags; } } private readonly global::System.Collections.Generic.List<string> _excludedtags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(11, Name=@"excludedtags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> excludedtags { get { return _excludedtags; } } private uint _filetype = default(uint); [global::ProtoBuf.ProtoMember(14, IsRequired = false, Name=@"filetype", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint filetype { get { return _filetype; } set { _filetype = value; } } private uint _creator_appid = default(uint); [global::ProtoBuf.ProtoMember(15, IsRequired = false, Name=@"creator_appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint creator_appid { get { return _creator_appid; } set { _creator_appid = value; } } private string _match_cloud_filename = ""; [global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"match_cloud_filename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string match_cloud_filename { get { return _match_cloud_filename; } set { _match_cloud_filename = value; } } private uint _cache_max_age_seconds = (uint)0; [global::ProtoBuf.ProtoMember(27, IsRequired = false, Name=@"cache_max_age_seconds", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue((uint)0)] public uint cache_max_age_seconds { get { return _cache_max_age_seconds; } set { _cache_max_age_seconds = value; } } private bool _totalonly = default(bool); [global::ProtoBuf.ProtoMember(17, IsRequired = false, Name=@"totalonly", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool totalonly { get { return _totalonly; } set { _totalonly = value; } } private bool _ids_only = default(bool); [global::ProtoBuf.ProtoMember(18, IsRequired = false, Name=@"ids_only", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool ids_only { get { return _ids_only; } set { _ids_only = value; } } private bool _return_vote_data = (bool)true; [global::ProtoBuf.ProtoMember(19, IsRequired = false, Name=@"return_vote_data", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)true)] public bool return_vote_data { get { return _return_vote_data; } set { _return_vote_data = value; } } private bool _return_tags = default(bool); [global::ProtoBuf.ProtoMember(20, IsRequired = false, Name=@"return_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_tags { get { return _return_tags; } set { _return_tags = value; } } private bool _return_kv_tags = (bool)true; [global::ProtoBuf.ProtoMember(21, IsRequired = false, Name=@"return_kv_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)true)] public bool return_kv_tags { get { return _return_kv_tags; } set { _return_kv_tags = value; } } private bool _return_previews = default(bool); [global::ProtoBuf.ProtoMember(22, IsRequired = false, Name=@"return_previews", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_previews { get { return _return_previews; } set { _return_previews = value; } } private bool _return_children = default(bool); [global::ProtoBuf.ProtoMember(23, IsRequired = false, Name=@"return_children", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_children { get { return _return_children; } set { _return_children = value; } } private bool _return_short_description = (bool)true; [global::ProtoBuf.ProtoMember(24, IsRequired = false, Name=@"return_short_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)true)] public bool return_short_description { get { return _return_short_description; } set { _return_short_description = value; } } private bool _return_for_sale_data = default(bool); [global::ProtoBuf.ProtoMember(26, IsRequired = false, Name=@"return_for_sale_data", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_for_sale_data { get { return _return_for_sale_data; } set { _return_for_sale_data = value; } } private bool _return_metadata = (bool)false; [global::ProtoBuf.ProtoMember(28, IsRequired = false, Name=@"return_metadata", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)false)] public bool return_metadata { get { return _return_metadata; } set { _return_metadata = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetUserFiles_Response")] public partial class CPublishedFile_GetUserFiles_Response : global::ProtoBuf.IExtensible { public CPublishedFile_GetUserFiles_Response() {} private uint _total = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"total", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint total { get { return _total; } set { _total = value; } } private uint _startindex = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"startindex", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint startindex { get { return _startindex; } set { _startindex = value; } } private readonly global::System.Collections.Generic.List<PublishedFileDetails> _publishedfiledetails = new global::System.Collections.Generic.List<PublishedFileDetails>(); [global::ProtoBuf.ProtoMember(3, Name=@"publishedfiledetails", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails> publishedfiledetails { get { return _publishedfiledetails; } } private readonly global::System.Collections.Generic.List<CPublishedFile_GetUserFiles_Response.App> _apps = new global::System.Collections.Generic.List<CPublishedFile_GetUserFiles_Response.App>(); [global::ProtoBuf.ProtoMember(4, Name=@"apps", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<CPublishedFile_GetUserFiles_Response.App> apps { get { return _apps; } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"App")] public partial class App : global::ProtoBuf.IExtensible { public App() {} private uint _appid = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint appid { get { return _appid; } set { _appid = value; } } private string _name = ""; [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"name", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string name { get { return _name; } set { _name = value; } } private uint _shortcutid = default(uint); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"shortcutid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint shortcutid { get { return _shortcutid; } set { _shortcutid = value; } } private bool _private = default(bool); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"private", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool @private { get { return _private; } set { _private = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Update_Request")] public partial class CPublishedFile_Update_Request : global::ProtoBuf.IExtensible { public CPublishedFile_Update_Request() {} private uint _appid = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint appid { get { return _appid; } set { _appid = value; } } private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private string _title = ""; [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"title", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string title { get { return _title; } set { _title = value; } } private string _file_description = ""; [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"file_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string file_description { get { return _file_description; } set { _file_description = value; } } private uint _visibility = default(uint); [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"visibility", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint visibility { get { return _visibility; } set { _visibility = value; } } private readonly global::System.Collections.Generic.List<string> _tags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(6, Name=@"tags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> tags { get { return _tags; } } private string _filename = ""; [global::ProtoBuf.ProtoMember(7, IsRequired = false, Name=@"filename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string filename { get { return _filename; } set { _filename = value; } } private string _preview_filename = ""; [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"preview_filename", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string preview_filename { get { return _preview_filename; } set { _preview_filename = value; } } private uint _image_width = default(uint); [global::ProtoBuf.ProtoMember(15, IsRequired = false, Name=@"image_width", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint image_width { get { return _image_width; } set { _image_width = value; } } private uint _image_height = default(uint); [global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"image_height", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint image_height { get { return _image_height; } set { _image_height = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_Update_Response")] public partial class CPublishedFile_Update_Response : global::ProtoBuf.IExtensible { public CPublishedFile_Update_Response() {} private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetChangeHistoryEntry_Request")] public partial class CPublishedFile_GetChangeHistoryEntry_Request : global::ProtoBuf.IExtensible { public CPublishedFile_GetChangeHistoryEntry_Request() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private uint _timestamp = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetChangeHistoryEntry_Response")] public partial class CPublishedFile_GetChangeHistoryEntry_Response : global::ProtoBuf.IExtensible { public CPublishedFile_GetChangeHistoryEntry_Response() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private uint _timestamp = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } private string _change_description = ""; [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"change_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string change_description { get { return _change_description; } set { _change_description = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetChangeHistory_Request")] public partial class CPublishedFile_GetChangeHistory_Request : global::ProtoBuf.IExtensible { public CPublishedFile_GetChangeHistory_Request() {} private ulong _publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"publishedfileid", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong publishedfileid { get { return _publishedfileid; } set { _publishedfileid = value; } } private bool _total_only = default(bool); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"total_only", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool total_only { get { return _total_only; } set { _total_only = value; } } private uint _startindex = default(uint); [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"startindex", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint startindex { get { return _startindex; } set { _startindex = value; } } private uint _count = default(uint); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"count", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint count { get { return _count; } set { _count = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_GetChangeHistory_Response")] public partial class CPublishedFile_GetChangeHistory_Response : global::ProtoBuf.IExtensible { public CPublishedFile_GetChangeHistory_Response() {} private readonly global::System.Collections.Generic.List<CPublishedFile_GetChangeHistory_Response.ChangeLog> _changes = new global::System.Collections.Generic.List<CPublishedFile_GetChangeHistory_Response.ChangeLog>(); [global::ProtoBuf.ProtoMember(1, Name=@"changes", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<CPublishedFile_GetChangeHistory_Response.ChangeLog> changes { get { return _changes; } } private uint _total = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"total", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint total { get { return _total; } set { _total = value; } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"ChangeLog")] public partial class ChangeLog : global::ProtoBuf.IExtensible { public ChangeLog() {} private uint _timestamp = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"timestamp", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint timestamp { get { return _timestamp; } set { _timestamp = value; } } private string _change_description = ""; [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"change_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string change_description { get { return _change_description; } set { _change_description = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_RefreshVotingQueue_Request")] public partial class CPublishedFile_RefreshVotingQueue_Request : global::ProtoBuf.IExtensible { public CPublishedFile_RefreshVotingQueue_Request() {} private uint _appid = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint appid { get { return _appid; } set { _appid = value; } } private uint _matching_file_type = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"matching_file_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint matching_file_type { get { return _matching_file_type; } set { _matching_file_type = value; } } private readonly global::System.Collections.Generic.List<string> _tags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(3, Name=@"tags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> tags { get { return _tags; } } private bool _match_all_tags = (bool)true; [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"match_all_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)true)] public bool match_all_tags { get { return _match_all_tags; } set { _match_all_tags = value; } } private readonly global::System.Collections.Generic.List<string> _excluded_tags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(5, Name=@"excluded_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> excluded_tags { get { return _excluded_tags; } } private uint _desired_queue_size = default(uint); [global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"desired_queue_size", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint desired_queue_size { get { return _desired_queue_size; } set { _desired_queue_size = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_RefreshVotingQueue_Response")] public partial class CPublishedFile_RefreshVotingQueue_Response : global::ProtoBuf.IExtensible { public CPublishedFile_RefreshVotingQueue_Response() {} private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_QueryFiles_Request")] public partial class CPublishedFile_QueryFiles_Request : global::ProtoBuf.IExtensible { public CPublishedFile_QueryFiles_Request() {} private uint _query_type = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"query_type", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint query_type { get { return _query_type; } set { _query_type = value; } } private uint _page = default(uint); [global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"page", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint page { get { return _page; } set { _page = value; } } private uint _numperpage = (uint)1; [global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"numperpage", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue((uint)1)] public uint numperpage { get { return _numperpage; } set { _numperpage = value; } } private uint _creator_appid = default(uint); [global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"creator_appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint creator_appid { get { return _creator_appid; } set { _creator_appid = value; } } private uint _appid = default(uint); [global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"appid", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint appid { get { return _appid; } set { _appid = value; } } private readonly global::System.Collections.Generic.List<string> _requiredtags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(6, Name=@"requiredtags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> requiredtags { get { return _requiredtags; } } private readonly global::System.Collections.Generic.List<string> _excludedtags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(7, Name=@"excludedtags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> excludedtags { get { return _excludedtags; } } private bool _match_all_tags = (bool)true; [global::ProtoBuf.ProtoMember(8, IsRequired = false, Name=@"match_all_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)true)] public bool match_all_tags { get { return _match_all_tags; } set { _match_all_tags = value; } } private readonly global::System.Collections.Generic.List<string> _required_flags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(9, Name=@"required_flags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> required_flags { get { return _required_flags; } } private readonly global::System.Collections.Generic.List<string> _omitted_flags = new global::System.Collections.Generic.List<string>(); [global::ProtoBuf.ProtoMember(10, Name=@"omitted_flags", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<string> omitted_flags { get { return _omitted_flags; } } private string _search_text = ""; [global::ProtoBuf.ProtoMember(11, IsRequired = false, Name=@"search_text", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue("")] public string search_text { get { return _search_text; } set { _search_text = value; } } private uint _filetype = default(uint); [global::ProtoBuf.ProtoMember(12, IsRequired = false, Name=@"filetype", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint filetype { get { return _filetype; } set { _filetype = value; } } private ulong _child_publishedfileid = default(ulong); [global::ProtoBuf.ProtoMember(13, IsRequired = false, Name=@"child_publishedfileid", DataFormat = global::ProtoBuf.DataFormat.FixedSize)] [global::System.ComponentModel.DefaultValue(default(ulong))] public ulong child_publishedfileid { get { return _child_publishedfileid; } set { _child_publishedfileid = value; } } private uint _days = default(uint); [global::ProtoBuf.ProtoMember(14, IsRequired = false, Name=@"days", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint days { get { return _days; } set { _days = value; } } private bool _include_recent_votes_only = default(bool); [global::ProtoBuf.ProtoMember(15, IsRequired = false, Name=@"include_recent_votes_only", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool include_recent_votes_only { get { return _include_recent_votes_only; } set { _include_recent_votes_only = value; } } private uint _cache_max_age_seconds = (uint)0; [global::ProtoBuf.ProtoMember(31, IsRequired = false, Name=@"cache_max_age_seconds", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue((uint)0)] public uint cache_max_age_seconds { get { return _cache_max_age_seconds; } set { _cache_max_age_seconds = value; } } private bool _totalonly = default(bool); [global::ProtoBuf.ProtoMember(16, IsRequired = false, Name=@"totalonly", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool totalonly { get { return _totalonly; } set { _totalonly = value; } } private bool _return_vote_data = default(bool); [global::ProtoBuf.ProtoMember(17, IsRequired = false, Name=@"return_vote_data", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_vote_data { get { return _return_vote_data; } set { _return_vote_data = value; } } private bool _return_tags = default(bool); [global::ProtoBuf.ProtoMember(18, IsRequired = false, Name=@"return_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_tags { get { return _return_tags; } set { _return_tags = value; } } private bool _return_kv_tags = default(bool); [global::ProtoBuf.ProtoMember(19, IsRequired = false, Name=@"return_kv_tags", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_kv_tags { get { return _return_kv_tags; } set { _return_kv_tags = value; } } private bool _return_previews = default(bool); [global::ProtoBuf.ProtoMember(20, IsRequired = false, Name=@"return_previews", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_previews { get { return _return_previews; } set { _return_previews = value; } } private bool _return_children = default(bool); [global::ProtoBuf.ProtoMember(21, IsRequired = false, Name=@"return_children", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_children { get { return _return_children; } set { _return_children = value; } } private bool _return_short_description = default(bool); [global::ProtoBuf.ProtoMember(22, IsRequired = false, Name=@"return_short_description", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_short_description { get { return _return_short_description; } set { _return_short_description = value; } } private bool _return_for_sale_data = default(bool); [global::ProtoBuf.ProtoMember(30, IsRequired = false, Name=@"return_for_sale_data", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue(default(bool))] public bool return_for_sale_data { get { return _return_for_sale_data; } set { _return_for_sale_data = value; } } private bool _return_metadata = (bool)false; [global::ProtoBuf.ProtoMember(32, IsRequired = false, Name=@"return_metadata", DataFormat = global::ProtoBuf.DataFormat.Default)] [global::System.ComponentModel.DefaultValue((bool)false)] public bool return_metadata { get { return _return_metadata; } set { _return_metadata = value; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } [global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"CPublishedFile_QueryFiles_Response")] public partial class CPublishedFile_QueryFiles_Response : global::ProtoBuf.IExtensible { public CPublishedFile_QueryFiles_Response() {} private uint _total = default(uint); [global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"total", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)] [global::System.ComponentModel.DefaultValue(default(uint))] public uint total { get { return _total; } set { _total = value; } } private readonly global::System.Collections.Generic.List<PublishedFileDetails> _publishedfiledetails = new global::System.Collections.Generic.List<PublishedFileDetails>(); [global::ProtoBuf.ProtoMember(2, Name=@"publishedfiledetails", DataFormat = global::ProtoBuf.DataFormat.Default)] public global::System.Collections.Generic.List<PublishedFileDetails> publishedfiledetails { get { return _publishedfiledetails; } } private global::ProtoBuf.IExtension extensionObject; global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing) { return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); } } public interface IPublishedFile { CPublishedFile_Subscribe_Response Subscribe(CPublishedFile_Subscribe_Request request); CPublishedFile_Unsubscribe_Response Unsubscribe(CPublishedFile_Unsubscribe_Request request); CPublishedFile_CanSubscribe_Response CanSubscribe(CPublishedFile_CanSubscribe_Request request); CPublishedFile_Publish_Response Publish(CPublishedFile_Publish_Request request); CPublishedFile_GetDetails_Response GetDetails(CPublishedFile_GetDetails_Request request); CPublishedFile_GetUserFiles_Response GetUserFiles(CPublishedFile_GetUserFiles_Request request); CPublishedFile_Update_Response Update(CPublishedFile_Update_Request request); CPublishedFile_GetChangeHistoryEntry_Response GetChangeHistoryEntry(CPublishedFile_GetChangeHistoryEntry_Request request); CPublishedFile_GetChangeHistory_Response GetChangeHistory(CPublishedFile_GetChangeHistory_Request request); CPublishedFile_RefreshVotingQueue_Response RefreshVotingQueue(CPublishedFile_RefreshVotingQueue_Request request); CPublishedFile_QueryFiles_Response QueryFiles(CPublishedFile_QueryFiles_Request request); } } #pragma warning restore 1591
gpl-3.0
eethomas/eucalyptus
clc/modules/msgs/src/main/java/com/eucalyptus/ws/EucalyptusRemoteFault.java
4910
/************************************************************************* * Copyright 2009-2014 Eucalyptus Systems, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. * * Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta * CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need * additional information or have any questions. * * This file may incorporate work covered under the following copyright * and permission notice: * * Software License Agreement (BSD License) * * Copyright (c) 2008, Regents of the University of California * All rights reserved. * * Redistribution and use of this software in source and binary forms, * with or without modification, are permitted provided that the * following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. USERS OF THIS SOFTWARE ACKNOWLEDGE * THE POSSIBLE PRESENCE OF OTHER OPEN SOURCE LICENSED MATERIAL, * COPYRIGHTED MATERIAL OR PATENTED MATERIAL IN THIS SOFTWARE, * AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY DISCOVERING * IT MAY INFORM DR. RICH WOLSKI AT THE UNIVERSITY OF CALIFORNIA, * SANTA BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY, * WHICH IN THE REGENTS' DISCRETION MAY INCLUDE, WITHOUT LIMITATION, * REPLACEMENT OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO * IDENTIFIED, OR WITHDRAWAL OF THE CODE CAPABILITY TO THE EXTENT * NEEDED TO COMPLY WITH ANY SUCH LICENSES OR RIGHTS. ************************************************************************/ package com.eucalyptus.ws; import javax.annotation.Nullable; import org.jboss.netty.handler.codec.http.HttpResponseStatus; public class EucalyptusRemoteFault extends Exception { String relatesTo; String action; String faultDetail; String faultCode; String faultString; HttpResponseStatus status; public EucalyptusRemoteFault( final String action, final String relatesTo, final String faultCode, final String faultString ) { super( String.format( "Action:%s Code:%s Id:%s Error: %s", action, faultCode, relatesTo, faultString ) ); this.relatesTo = relatesTo; this.action = action; this.faultCode = faultCode; this.faultString = faultString; } public EucalyptusRemoteFault( final String action, final String relatesTo, final String faultCode, final String faultString, final String faultDetail, final HttpResponseStatus status ) { this( action, relatesTo, faultCode, faultString ); this.faultDetail = faultDetail; this.status = status; } public String getRelatesTo( ) { return this.relatesTo; } public String getAction( ) { return this.action; } public String getFaultDetail( ) { return this.faultDetail; } public String getFaultCode( ) { return this.faultCode; } public String getFaultString( ) { return this.faultString; } @Nullable public HttpResponseStatus getStatus( ) { return status; } }
gpl-3.0