text:
<?php

/**
 * projectsModelMembers Class
 *
 * @category   Project_Management
 * @package    ExtranetOffice
 * @subpackage com_projects
 * @author     Luis Montero <luis.montero@e-noise.com>
 * @license    http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @link       http://code.google.com/p/extranetoffice/source/browse
 * @since      1.0
 */
class projectsModelMembers extends PHPFrame_MVC_Model
{
    /**
     * A reference to the project this activity log belongs to
     *
     * @var object
     */
    private $_project=null;

    /**
     * Constructor
     *
     * @param PHPFrame_Database_Row $project The project row this activity
     *                                       log belongs to.
     *
     * @access public
     * @return void
     * @since  1.0
     */
    public function __construct(PHPFrame_Database_Row $project)
    {
        $this->_project = $project;
    }

    /**
     * Get project members as a row collection
     *
     * @access public
     * @return PHPFrame_Database_RowCollection
     * @since  1.0
     */
    public function getCollection()
    {
        $rows = new PHPFrame_Database_RowCollection();
        $rows->select(array("ur.id AS id",
                            "ur.userid",
                            "ur.roleid",
                            "r.name AS rolename",
                            "u.username",
                            "u.firstname AS firstname",
                            "u.lastname AS lastname",
                            "u.email",
                            "u.photo"))
             ->from("#__users_roles AS ur")
             ->join("JOIN #__users u ON u.id = ur.userid")
             ->join("JOIN #__roles r ON r.id = ur.roleid")
             ->where("u.deleted = '0000-00-00 00:00:00'", "OR", "u.deleted IS NULL")
             ->where("ur.projectid", "=", ":projectid")
             ->params(":projectid", $this->_project->id)
             ->orderby("ur.roleid", "ASC");

        $rows->load();

        // Process row data before returning
        foreach ($rows as $row) {
            // Translate photo field to valid URL for frontend
            $photo = $row->photo;
            $photo_url = PHPFrame::Config()->get("UPLOAD_DIR").'/users/';
            $photo_url .= !empty($photo) ? $photo : 'default.png';
            $row->photo = $photo_url;

            // Add url to detail page
            $detail_url = "index.php?component=com_users&action=get_user";
            $detail_url .= "&userid=".$row->userid;
            $detail_url = PHPFrame_Utils_Rewrite::rewriteURL($detail_url);
            $row->detail_url = $detail_url;
        }

        return $rows;
    }

    /**
     * Get a single project member as a row
     *
     * @param int $userid
     *
     * @access public
     * @return PHPFrame_Database_Row
     * @since  1.0
     */
    public function getMember($userid)
    {
        $id_obj = new PHPFrame_Database_IdObject();
        $id_obj->select(array("ur.*",
                              "r.name AS rolename",
                              "u.username",
                              "u.firstname AS firstname",
                              "u.lastname AS lastname",
                              "u.email",
                              "u.photo"))
               ->from("#__users_roles AS ur")
               ->join("JOIN #__users u ON u.id = ur.userid")
               ->join("JOIN #__roles r ON r.id = ur.roleid")
               ->where("u.deleted = '0000-00-00 00:00:00'", "OR", "u.deleted IS NULL")
               ->where("ur.projectid", "=", ":projectid")
               ->params(":projectid", $this->_project->id)
               ->where("ur.userid", "=", ":userid")
               ->params(":userid", $userid);

        $row = new PHPFrame_Database_Row("#__users_roles");

        // Add array with foreign field names to allow as row columns
        $foreign_fields = array("rolename","username","firstname","lastname","email","photo");
        $row->load($id_obj, null, $foreign_fields);

        return $row;
    }

    /**
     * Add a user as a project member
     *
     * @param int  $projectid
     * @param int  $userid
     * @param int  $roleid
     * @param bool $notify
     *
     * @access public
     * @return bool
     * @since  1.0
     */
    public function saveMember($projectid, $userid, $roleid, $notify=true)
    {
        // Create new row object
        $row = new PHPFrame_Database_Row("#__users_roles");

        // Load existing entry before we overwrite with new values
        $id_obj = new PHPFrame_Database_IdObject();
        $id_obj->select("*")
               ->from("#__users_roles")
               ->where("projectid", "=", ":projectid")
               ->where("userid", "=", ":userid")
               ->params(":projectid", $projectid)
               ->params(":userid", $userid);

        $row->load($id_obj);

        $row->set('userid', $userid);
        $row->set('projectid', $projectid);
        $row->set('roleid', $roleid);

        $row->store();

        // Send notification via email
        if ($notify) {
            // Prepare project data
            $project_name = $this->_project->name;
            $role_name = projectsHelperProjects::project_roleid2name($roleid);

            // Prepare new member data
            $new_member_email = PHPFrame_User_Helper::id2email($userid);
            $new_member_name = PHPFrame_User_Helper::id2name($userid);

            // Prepare "inviting" user's full name
            $name = PHPFrame::Session()->getUser()->firstname;
            $name .= " ".PHPFrame::Session()->getUser()->lastname;

            // Get base url
            $uri = new PHPFrame_Utils_URI();
            $base_url = $uri->getBase();

            // Create new email
            $new_mail = new PHPFrame_Mail_Mailer();
            $new_mail->AddAddress($new_member_email, $new_member_name);
            $new_mail->Subject = sprintf(
                                     _LANG_PROJECTS_INVITATION_SUBJECT,
                                     $name,
                                     $project_name,
                                     PHPFrame::Config()->get("SITENAME")
                                 );

            $new_mail->Body = sprintf(
                                  _LANG_PROJECTS_INVITATION_BODY,
                                  $name,
                                  $project_name,
                                  $role_name,
                                  $base_url
                              );

            // Send email
            if ($new_mail->Send() !== true) {
                $this->_error[] = sprintf(_LANG_EMAIL_NOT_SENT, $new_member_email);
                return false;
            }
        }

        return true;
    }

    /**
     * Invite new user to the system and make them a project member
     *
     * @param array $post
     * @param int   $projectid
     * @param int   $roleid
     *
     * @access public
     * @return unknown_type
     * @since  1.0
     */
    public function inviteNewUser($post, $projectid, $roleid)
    {
        // Create new user object
        $user = new PHPFrame_User();

        $user->set('block', '0');
        $user->set('created', date("Y-m-d H:i:s"));
        // Generate random password and store in local variable to be used
        // when sending email to user.
        $password = PHPFrame_Utils_Crypt::genRandomPassword();
        // Assign newly generated password to row object (this password will
        // be encrypted when stored).
        $user->set('password', $password);

        // Bind the post data to the row array
        $user->bind($post, 'password');

        $user->store();

        // add user to project
        $row = new PHPFrame_Database_Row("#__users_roles");

        $row->set('userid', $user->id);
        $row->set('projectid', $projectid);
        $row->set('roleid', $roleid);

        $row->store();

        // Send notification to new users
        // Prepare project data
        $project_name = $this->_project->name;
        $role_name = projectsHelperProjects::project_roleid2name($roleid);

        // Prepare new member data
        $new_member_name = $user->firstname." ".$user->lastname;

        // Prepare "inviting" user's full name
        $name = PHPFrame::Session()->getUser()->firstname;
        $name .= " ".PHPFrame::Session()->getUser()->lastname;

        // Get base url
        $uri = new PHPFrame_Utils_URI();
        $base_url = $uri->getBase();

        $new_mail = new PHPFrame_Mail_Mailer();
        $new_mail->AddAddress($user->email, $new_member_name);
        $new_mail->Subject = sprintf(
                                 _LANG_PROJECTS_INVITATION_SUBJECT,
                                 $name,
                                 $project_name,
                                 PHPFrame::Config()->get("SITENAME")
                             );
        $new_mail->Body = sprintf(
                              _LANG_PROJECTS_INVITATION_NEW_USER_BODY,
                              $name,
                              $project_name,
                              $role_name,
                              $user->username,
                              $password,
                              $base_url
                          );

        // Send email
        if ($new_mail->Send() !== true) {
            $this->_error[] = sprintf(_LANG_EMAIL_NOT_SENT, $user->email);
            return false;
        }

        return true;
    }

    /**
     * Delete project member
     *
     * This method will throw an exception if the SQL query fails
     *
     * @param int $userid The userid of the user to remove as member of the
     *                    current project.
     *
     * @access public
     * @return void
     * @since  1.0
     */
    public function deleteMember($userid)
    {
        $sql = "DELETE FROM #__users_roles ";
        $sql .= " WHERE projectid = :projectid AND userid = :userid";

        $params = array(":projectid"=>$this->_project->id,
                        ":userid"=>$userid);

        // Run the SQL query
        PHPFrame::DB()->query($sql, $params);
    }

    /**
     * Change member's role in given project
     *
     * This method will throw an exception if the SQL query fails
     *
     * @param int $userid
     * @param int $roleid
     *
     * @access public
     * @return bool   Returns TRUE on success or FALSE on failure
     * @since  1.0
     */
    public function changeMemberRole($userid, $roleid)
    {
        $sql = "UPDATE #__users_roles ";
        $sql .= " SET roleid = :roleid";
        $sql .= " WHERE projectid = :projectid AND userid = :userid";

        $params = array(":roleid"=>$roleid,
                        ":projectid"=>$this->_project->id,
                        ":userid"=>$userid);

        // Run the SQL query
        PHPFrame::DB()->query($sql, $params);
    }

    /**
     * Check if given user is a member of the specified project
     *
     * @param int $projectid
     * @param int $userid
     *
     * @access public
     * @return bool
     * @since  1.0
     */
    public function isMember($projectid, $userid)
    {
        $sql = "SELECT roleid FROM #__users_roles ";
        $sql .= " WHERE projectid = :projectid AND userid = :userid";

        $params = array(":projectid"=>$projectid, ":userid"=>$userid);

        $roleid = PHPFrame::DB()->fetchColumn($sql, $params);

        if (!empty($roleid)) {
            return $roleid;
        } else {
            return false;
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/ac_toolbar_copy"
        android:icon="@drawable/icon"
        android:orderInCategory="60"
        android:title="复制"
        app:showAsAction="ifRoom" />
    <item
        android:id="@+id/ac_toolbar_cut"
        android:icon="@drawable/icon"
        android:orderInCategory="70"
        android:title="剪切"
        app:showAsAction="ifRoom" />
    <item
        android:id="@+id/ac_toolbar_del"
        android:icon="@drawable/icon"
        android:orderInCategory="80"
        android:title="删除"
        app:showAsAction="ifRoom" />
    <item
        android:id="@+id/ac_toolbar_edit"
        android:icon="@drawable/icon"
        android:orderInCategory="90"
        android:title="编辑"
        app:showAsAction="ifRoom" />

    <item
        android:id="@+id/ac_toolbar_email"
        android:icon="@drawable/icon"
        android:orderInCategory="100"
        android:title="邮箱"
        app:showAsAction="ifRoom" />
</menu>

redpajama_set_name: RedPajamaGithub


text:
function SearchAssistant() {
	/* this is the creator function for your scene assistant object. It will be passed all the
	   additional parameters (after the scene name) that were passed to pushScene. The reference
	   to the scene controller (this.controller) has not be established yet, so any initialization
	   that needs the scene controller should be done in the setup function below. */
}

SearchAssistant.prototype.setup = function() {
	/* this function is for setup tasks that have to happen when the scene is first created */

	/* use Mojo.View.render to render view templates and add them to the scene, if needed. */

	/* setup widgets here */

	/* add event handlers to listen to events from widgets */
	TM.helpers.setupDefaultMenu.call(this);
	TM.helpers.setupBaseLayout.call(this, 'search');

	this.searchModel = {value: ''};
	this.searchAttr = {
		hintText: "Type your search...",
		autoFocus: true,
		autoReplace: false,
		requiresEnterKey: true,
		textCase: Mojo.Widget.steModeLowerCase};
	this.controller.setupWidget("search-query", this.searchAttr, this.searchModel);
	this.submitHandler = this.handleSubmit.bindAsEventListener(this);
	this.controller.listen('search-query', Mojo.Event.propertyChange, this.submitHandler);

	this.buttonModel = {label: $L('Search'), disabled: false};
	this.controller.setupWidget("search-button", {}, this.buttonModel);

	this.savedSearchesModel = { items: [] };
	this.controller.setupWidget("listWidget",
		{
			itemTemplate: "partials/regular-list-item",
			swipeToDelete: false,
			reorderable: false,
			hasNoWidget: true,
			fixedHeightItems: true,
			renderLimit: 35,
			lookahead: 20
		},
		this.savedSearchesModel);

	this.showSearchResultsHandler = this.pushSearchResults.bindAsEventListener(this);
	this.controller.listen('search-button', Mojo.Event.tap, this.showSearchResultsHandler);

	this.successfulFetchHandler = this.successfulFetch.bind(this);
	Twitter.savedSearches({onSuccess: this.successfulFetchHandler});
}

SearchAssistant.prototype.handleSubmit = function (event) {
//	If enter is pressed, pretend the search button was tapped.
//	Remember that requiresEnterKey must be set to true in the textfield's attributes
	if (event && Mojo.Char.isEnterKey(event.originalEvent.keyCode)) {
		Mojo.Log.info('Enter was pressed');
		Event.stop(event);
		this.showSearchResultsHandler(event);
	}
}

SearchAssistant.prototype.handleCommand = function (event){
	TM.helpers.handleCommand.bind(this, event)();
}

SearchAssistant.prototype.successfulFetch = function (transport){
	this.controller.get('savedSearchLoader').addClassName('hide');
	this.savedSearchesModel.items = transport.responseJSON;
	this.controller.modelChanged(this.savedSearchesModel);
}

SearchAssistant.prototype.pushSearchResults = function(event){
	if (event.type === 'mojo-list-tap') {
	  Mojo.Log.info('Query for saerch is ..... ', event.item.query);
		this.controller.stageController.pushScene('search-results', event.item.query);
	}
	else if (this.searchModel.value.length > 0) {
	  Mojo.Log.info('Typed search query is', this.searchModel.value);
		this.controller.stageController.pushScene('search-results', this.searchModel.value);
	}
}

SearchAssistant.prototype.activate = function(event) {
	/* put in event handlers here that should only be in effect when this scene is active. For
	   example, key handlers that are observing the document */
	// this.pushedSavedHandler = this.pushSearchResults.bindAsEventListener(this);
	this.controller.listen('listWidget', Mojo.Event.listTap, this.showSearchResultsHandler);
	TM.helpers.handleActivate.call(this, event);
	Mojo.View.advanceFocus(this.controller.get('divEntryPane'));
}

SearchAssistant.prototype.deactivate = function(event) {
	/* remove any event handlers you added in activate and do any other cleanup that should happen before
	   this scene is popped or another scene is pushed on top */
	this.controller.stopListening('listWidget', Mojo.Event.listTap, this.showSearchResultsHandler);
}

SearchAssistant.prototype.cleanup = function(event) {
	/* this function should do any cleanup needed before the scene is destroyed as
	   a result of being popped off the scene stack */
	this.controller.stopListening('search-button', Mojo.Event.tap, this.showSearchResultsHandler);
	TM.helpers.defaultCleanup.call(this);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@color/colorPrimaryDark" />
        </shape>
    </item>
    <item android:bottom="1dp">
        <shape android:shape="rectangle">
            <solid android:color="#ffffff" />
        </shape>
    </item>
</layer-list>


text:
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;

using NUnit.Framework;

namespace MonoTests.System.Reflection.Emit
{

[TestFixture]
public class PropertyBuilderTest : Assertion
{
    private TypeBuilder tb;

	private ModuleBuilder module;

	[SetUp]
	protected void SetUp () {
		AssemblyName assemblyName = new AssemblyName();
		assemblyName.Name = "MonoTests.System.Reflection.Emit.PropertyBuilderTest";

		AssemblyBuilder assembly
			= Thread.GetDomain().DefineDynamicAssembly(
				assemblyName, AssemblyBuilderAccess.Run);

		module = assembly.DefineDynamicModule("module1");

	    tb = module.DefineType("class1",
							   TypeAttributes.Public);
	}

	[Test]
	public void TestProperties () {

		FieldBuilder propField = tb.DefineField("propField",
												typeof(int),
												FieldAttributes.Private);

		PropertyBuilder property =
			tb.DefineProperty ("prop", PropertyAttributes.HasDefault, typeof (int), new Type [0] { });
		property.SetConstant (44);

		MethodBuilder propertyGet = tb.DefineMethod("GetProp",
													MethodAttributes.Public,
													typeof(int),
													new Type[] { });

		{
			ILGenerator il = propertyGet.GetILGenerator();

			il.Emit(OpCodes.Ldarg_0);
			il.Emit(OpCodes.Ldfld, propField);
			il.Emit(OpCodes.Ret);
		}

		MethodBuilder propertySet = tb.DefineMethod("SetProp",
													MethodAttributes.Public,
													null,
													new Type[] { typeof(int) });
		{
			ILGenerator il = propertySet.GetILGenerator();

			il.Emit(OpCodes.Ldarg_0);
			il.Emit(OpCodes.Ldarg_1);
			il.Emit(OpCodes.Stfld, propField);
			il.Emit(OpCodes.Ret);
		}

		property.SetGetMethod(propertyGet);
		property.SetSetMethod(propertySet);

		Type t = tb.CreateType ();

		PropertyInfo[] props = t.GetProperties (BindingFlags.Public|BindingFlags.Instance);
		AssertEquals (1, props.Length);

		PropertyInfo p = t.GetProperty ("prop");

		AssertEquals (PropertyAttributes.HasDefault, p.Attributes);
		AssertEquals (true, p.CanRead);
		AssertEquals (true, p.CanWrite);
		AssertEquals ("prop", p.Name);
		AssertEquals (MemberTypes.Property, p.MemberType);
		AssertEquals (typeof (int), p.PropertyType);
		MethodInfo[] methods = p.GetAccessors ();
		AssertEquals (2, methods.Length);
		AssertNotNull (p.GetGetMethod ());
		AssertNotNull (p.GetSetMethod ());

		object o = Activator.CreateInstance (t);
		p.SetValue (o, 42, null);
		AssertEquals (42, p.GetValue (o, null));
	}
}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ABCForTravelers.DAL;
using ABCForTravelers.EN;

namespace ABCForTravelers.Biz
{
    public class UserBiz
    {
        public UserEN Login(UserEN user)
        {
            UserDAL userDAL = new UserDAL();
            UserEN activeUser = userDAL.Find(user);
            if(activeUser.ID != 0)
            {
                string password = Util.EnryptDecrypt.Decrypt(activeUser.Password, true);
                if(password == user.Password)
                {
                    activeUser.Password = string.Empty;
                    return activeUser;
                }
            }
            return null;
        }

        public UserEN Register(UserEN registerUser)
        {
            UserDAL userDAL = new UserDAL();
            UserEN existingUser = userDAL.Find(registerUser);
            if (existingUser.ID == 0)
            {
                registerUser.Password = Util.EnryptDecrypt.Encrypt(registerUser.Password, true);
                registerUser.Status = 1;
                UserEN activeUser = userDAL.Save(registerUser);
                if (activeUser.ID != 0)
                {
                    activeUser.Password = "";
                    return activeUser;
                }
                return null;
            }
            return null;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ $Id:$
  ~
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF 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.
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
        <property name="scopes">
            <map>
                <entry key="session">
                    <bean class="org.springframework.context.support.SimpleThreadScope"/>
                </entry>
            </map>
        </property>
    </bean>

    <bean id="testAction" class="org.apache.struts2.JUnitTestAction"/>
    <bean id="mySessionBean" class="org.apache.struts2.MySessionBean" scope="session" />
</beans>


text:
import test from 'tape';
import {makeWidthFlexible} from 'make-vis-flexible';

test('makeWidthFlexible: displayName given', t => {
  function ChildComponent() {}
  ChildComponent.displayName = 'ChildComponentWithDisplayName';
  const FlexibleComponent = makeWidthFlexible(ChildComponent);
  t.equal(FlexibleComponent.displayName, 'FlexibleChildComponentWithDisplayName', 'should use component display name');
  t.end();
});

test('makeWidthFlexible: displayName not given', t => {
  function ChildComponent() {}
  const FlexibleComponent = makeWidthFlexible(ChildComponent);
  t.equal(FlexibleComponent.displayName, 'FlexibleChildComponent', 'should default to component name');
  t.end();
});


text:
module SaysServicesClient
  module Models
    module Campaigns
      module StateConcerns
        extend ActiveSupport::Concern

        def abandoned?
          self.state == 'abandoned'
        end

        def draft?
          self.state == 'draft'
        end

        def ready?
          self.state == 'ready'
        end

        def paused?
          self.state == 'paused'
        end

        def scheduled?
          self.state == 'scheduled'
        end

        def active?
          self.state == 'active'
        end

        def completed?
          self.state == 'completed'
        end

        def archiving?
          self.state == 'archiving'
        end

        def archived?
          self.state == 'archived'
        end

        def abandoned?
          self.state == 'abandoned'
        end
      end
    end
  end
end


text:
/*
 *
 * written or collected and sometimes rewritten by
 * Ingo Assmus <ingo.assmus@keymile.com>
 *
 */

#include <common.h>
#include "../include/core.h"
#include "../include/memory.h"

/*******************************************************************************
* memoryGetBankBaseAddress - Returns the base address of a memory bank.
* DESCRIPTION:
*       This function returns the base address of one of the SDRAM's memory
*       banks. There are 4 memory banks and each one represents one DIMM side.
* INPUT:
*       MEMORY_BANK bank - Selects one of the four banks as defined in Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       32 bit Memory bank base address.
*******************************************************************************/
static unsigned long memoryGetBankRegOffset (MEMORY_BANK bank)
{
	switch (bank) {
	case BANK0:
		return SCS_0_LOW_DECODE_ADDRESS;
	case BANK1:
		return SCS_1_LOW_DECODE_ADDRESS;
	case BANK2:
		return SCS_2_LOW_DECODE_ADDRESS;
	case BANK3:
		return SCS_3_LOW_DECODE_ADDRESS;

	}
	return SCS_0_LOW_DECODE_ADDRESS;	/* default value */
}

unsigned int memoryGetBankBaseAddress (MEMORY_BANK bank)
{
	unsigned int base;
	unsigned int regOffset = memoryGetBankRegOffset (bank);

	GT_REG_READ (regOffset, &base);
	base = base << 16;	/* MV6436x */
	return base;
}

/*******************************************************************************
* memoryGetDeviceBaseAddress - Returns the base address of a device.
* DESCRIPTION:
*       This function returns the base address of a device on the system. There
*       are 5 possible devices (0 - 4 and one boot device) as defined in
*       gtMemory.h. Each of the device parameters is maped to one of the CS
*       (Devices chip selects) base address register.
* INPUT:
*       device - Selects one of the five devices as defined in Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       32 bit Device base address.
*
*******************************************************************************/
static unsigned int memoryGetDeviceRegOffset (DEVICE device)
{
	switch (device) {
	case DEVICE0:
		return CS_0_LOW_DECODE_ADDRESS;
	case DEVICE1:
		return CS_1_LOW_DECODE_ADDRESS;
	case DEVICE2:
		return CS_2_LOW_DECODE_ADDRESS;
	case DEVICE3:
		return CS_3_LOW_DECODE_ADDRESS;
	case BOOT_DEVICE:
		return BOOTCS_LOW_DECODE_ADDRESS;
	}
	return CS_0_LOW_DECODE_ADDRESS;	/* default value */
}

unsigned int memoryGetDeviceBaseAddress (DEVICE device)
{
	unsigned int regBase;
	unsigned int regOffset = memoryGetDeviceRegOffset (device);

	GT_REG_READ (regOffset, &regBase);

	regBase = regBase << 16;	/* MV6436x */
	return regBase;
}

/*******************************************************************************
* MemoryGetPciBaseAddr - Returns the base address of a PCI window.
* DESCRIPTION:
*       This function returns the base address of a PCI window. There are 5
*       possible PCI windows (memory 0 - 3 and one for I/O) for each PCI
*       interface as defined in gtMemory.h, used by the CPU's address decoding
*       mechanism.
*	New in MV6436x
* INPUT:
*       pciWindow - Selects one of the PCI windows as defined in Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       32 bit PCI window base address.
*******************************************************************************/
unsigned int MemoryGetPciBaseAddr (PCI_MEM_WINDOW pciWindow)
{
	unsigned int baseAddrReg, base;

	switch (pciWindow) {
	case PCI_0_IO:
		baseAddrReg = PCI_0I_O_LOW_DECODE_ADDRESS;	/*PCI_0_IO_BASE_ADDR;  */
		break;
	case PCI_0_MEM0:
		baseAddrReg = PCI_0MEMORY0_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY0_BASE_ADDR; */
		break;
	case PCI_0_MEM1:
		baseAddrReg = PCI_0MEMORY1_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY1_BASE_ADDR; */
		break;
	case PCI_0_MEM2:
		baseAddrReg = PCI_0MEMORY2_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY2_BASE_ADDR;  */
		break;
	case PCI_0_MEM3:
		baseAddrReg = PCI_0MEMORY3_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY3_BASE_ADDR;  */
		break;
#ifdef INCLUDE_PCI_1
	case PCI_1_IO:
		baseAddrReg = PCI_1I_O_LOW_DECODE_ADDRESS;	/*PCI_1_IO_BASE_ADDR;  */
		break;
	case PCI_1_MEM0:
		baseAddrReg = PCI_1MEMORY0_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY0_BASE_ADDR; */
		break;
	case PCI_1_MEM1:
		baseAddrReg = PCI_1MEMORY1_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY1_BASE_ADDR;  */
		break;
	case PCI_1_MEM2:
		baseAddrReg = PCI_1MEMORY2_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY2_BASE_ADDR;  */
		break;
	case PCI_1_MEM3:
		baseAddrReg = PCI_1MEMORY3_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY3_BASE_ADDR; */
		break;
#endif /* INCLUDE_PCI_1 */
	default:
		return 0xffffffff;
	}
	GT_REG_READ (baseAddrReg, &base);
	return (base << 16);
}

/*******************************************************************************
* memoryGetBankSize - Returns the size of a memory bank.
* DESCRIPTION:
*       This function returns the size of memory bank as described in
*       'gtMemoryGetBankBaseAddress' function.
* INPUT:
*       bank - Selects one of the four banks as defined in Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       32 bit size memory bank size or 0 for a closed or non populated bank.
*
*******************************************************************************/
unsigned int memoryGetBankSize (MEMORY_BANK bank)
{
	unsigned int sizeReg, size;
	MEMORY_WINDOW window;

	switch (bank) {
	case BANK0:
		sizeReg = SCS_0_HIGH_DECODE_ADDRESS;	/* CS_0_SIZE; */
		window = CS_0_WINDOW;
		break;
	case BANK1:
		sizeReg = SCS_1_HIGH_DECODE_ADDRESS;	/* CS_1_SIZE; */
		window = CS_1_WINDOW;
		break;
	case BANK2:
		sizeReg = SCS_2_HIGH_DECODE_ADDRESS;	/* CS_2_SIZE; */
		window = CS_2_WINDOW;
		break;
	case BANK3:
		sizeReg = SCS_3_HIGH_DECODE_ADDRESS;	/* CS_3_SIZE; */
		window = CS_3_WINDOW;
		break;
	default:
		return 0;
		break;
	}
	/* If the window is closed, a size of 0 is returned */
	if (MemoryGetMemWindowStatus (window) != MEM_WINDOW_ENABLED)
		return 0;
	GT_REG_READ (sizeReg, &size);
	size = ((size << 16) | 0xffff) + 1;
	return size;
}

/*******************************************************************************
* memoryGetDeviceSize - Returns the size of a device memory space.
* DESCRIPTION:
*       This function returns the memory space size of a given device.
* INPUT:
*       device - Selects one of the five devices as defined in Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       32 bit size of a device memory space.
*******************************************************************************/
unsigned int memoryGetDeviceSize (DEVICE device)
{
	unsigned int sizeReg, size;
	MEMORY_WINDOW window;

	switch (device) {
	case DEVICE0:
		sizeReg = CS_0_HIGH_DECODE_ADDRESS;	/*DEV_CS0_SIZE; */
		window = DEVCS_0_WINDOW;
		break;
	case DEVICE1:
		sizeReg = CS_1_HIGH_DECODE_ADDRESS;	/*DEV_CS1_SIZE; */
		window = DEVCS_1_WINDOW;
		break;
	case DEVICE2:
		sizeReg = CS_2_HIGH_DECODE_ADDRESS;	/*DEV_CS2_SIZE; */
		window = DEVCS_2_WINDOW;
		break;
	case DEVICE3:
		sizeReg = CS_3_HIGH_DECODE_ADDRESS;	/*DEV_CS3_SIZE; */
		window = DEVCS_3_WINDOW;
		break;
	case BOOT_DEVICE:
		sizeReg = BOOTCS_HIGH_DECODE_ADDRESS;	/*BOOTCS_SIZE; */
		window = BOOT_CS_WINDOW;
		break;
	default:
		return 0;
		break;
	}
	/* If the window is closed, a size of 0 is returned */
	if (MemoryGetMemWindowStatus (window) != MEM_WINDOW_ENABLED)
		return 0;
	GT_REG_READ (sizeReg, &size);
	size = ((size << 16) | 0xffff) + 1;
	return size;
}

/*******************************************************************************
* MemoryGetPciWindowSize - Returns the size of a PCI memory window.
* DESCRIPTION:
*       This function returns the size of a PCI window.
* INPUT:
*       pciWindow - Selects one of the PCI memory windows as defined in
*       Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       32 bit size of a PCI memory window.
*******************************************************************************/
unsigned int MemoryGetPciWindowSize (PCI_MEM_WINDOW pciWindow)
{
	unsigned int sizeReg, size;

	switch (pciWindow) {
	case PCI_0_IO:
		sizeReg = PCI_0I_O_HIGH_DECODE_ADDRESS;	/*PCI_0_IO_SIZE; */
		break;
	case PCI_0_MEM0:
		sizeReg = PCI_0MEMORY0_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY0_SIZE; */
		break;
	case PCI_0_MEM1:
		sizeReg = PCI_0MEMORY1_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY1_SIZE; */
		break;
	case PCI_0_MEM2:
		sizeReg = PCI_0MEMORY2_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY2_SIZE; */
		break;
	case PCI_0_MEM3:
		sizeReg = PCI_0MEMORY3_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY3_SIZE; */
		break;
#ifdef INCLUDE_PCI_1
	case PCI_1_IO:
		sizeReg = PCI_1I_O_HIGH_DECODE_ADDRESS;	/*PCI_1_IO_SIZE; */
		break;
	case PCI_1_MEM0:
		sizeReg = PCI_1MEMORY0_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY0_SIZE; */
		break;
	case PCI_1_MEM1:
		sizeReg = PCI_1MEMORY1_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY1_SIZE;  */
		break;
	case PCI_1_MEM2:
		sizeReg = PCI_1MEMORY2_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY2_SIZE;  */
		break;
	case PCI_1_MEM3:
		sizeReg = PCI_1MEMORY3_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY3_SIZE; */
		break;
#endif /* INCLUDE_PCI_1 */
	default:
		return 0x0;
	}
	/* If the memory window is disabled, retrun size = 0 */
	if (MemoryGetMemWindowStatus (PCI_0_IO_WINDOW << pciWindow)
	    == MEM_WINDOW_DISABLED)
		return 0;
	GT_REG_READ (sizeReg, &size);
	size = ((size << 16) | 0xffff) + 1;
	return size;
}

/*******************************************************************************
* memoryGetDeviceWidth - Returns the width of a given device.
* DESCRIPTION:
*       The MV's device interface supports up to 32 Bit wide devices. A device
*       can have a  1, 2, 4 or 8 Bytes data width. This function returns the
*       width of a device as defined by the user or the operating system.
* INPUT:
*       device - Selects one of the five devices as defined in Memory.h.
* OUTPUT:
*       None.
* RETURN:
*       Device width in Bytes (1,2,4 or 8), 0 if error had occurred.
*******************************************************************************/
unsigned int memoryGetDeviceWidth (DEVICE device)
{
	unsigned int width;
	unsigned int regValue;

	GT_REG_READ (DEVICE_BANK0PARAMETERS + device * 4, &regValue);
	width = (regValue & (BIT20 | BIT21)) >> 20;
	return (BIT0 << width);
}

/*******************************************************************************
* memoryMapBank - Set new base address and size for one of the memory
*                         banks.
*
* DESCRIPTION:
*       The CPU interface address decoding map consists of 21 address windows
*       for the different devices (e.g. CS[3:0] ,PCI0 Mem 0/1/2/3...). Each
*       window can have a minimum of 1Mbytes of address space, and up to 4Gbyte
*       space. Each address window is defined by two registers - base and size.
*       The CPU address is compared with the values in the various CPU windows
*       until a match is found and the address is than targeted to that window.
*       This function sets new base and size for one the memory banks
*       (CS0 - CS3). It is the programmer`s responsibility to make sure that
*       there are no conflicts with other memory spaces. When two memory spaces
*       overlap, the MV's behavior is not defined .If a bank needs to be closed,
*       set the 'bankLength' parameter size to 0x0.
*
* INPUT:
*       bank      - One of the memory banks (CS0-CS3) as defined in gtMemory.h.
*       bankBase  - The memory bank base address.
*       bankLength  - The memory bank size. This function will decrement the
*                   'bankLength' parameter by one and then check if the size is
*                   valid. A valid size must be programed from LSB to MSB as
*                   sequence of '1's followed by sequence of '0's.
*                   To close a memory window simply set the size to 0.
*      NOTE!!!
*       The size must be in 64Kbyte granularity.
*       The base address must be aligned to the size.
* OUTPUT:
*       None.
* RETURN:
*       false for invalid size, true otherwise.
*
* CAUTION: PCI_functions must be implemented later To_do !!!!!!!!!!!!!!!!!
*
*******************************************************************************/

bool memoryMapBank (MEMORY_BANK bank, unsigned int bankBase,
		    unsigned int bankLength)
{
	unsigned int newBase, newSize, baseReg, sizeReg, temp, rShift;

/*    PCI_INTERNAL_BAR pciBAR; */

	switch (bank) {
	case BANK0:
		baseReg = SCS_0_LOW_DECODE_ADDRESS;	/*CS_0_BASE_ADDR; */
		sizeReg = SCS_0_HIGH_DECODE_ADDRESS;	/*CS_0_SIZE; */
/*        pciBAR = PCI_CS0_BAR; */
		break;
	case BANK1:
		baseReg = SCS_1_LOW_DECODE_ADDRESS;	/*CS_1_BASE_ADDR; */
		sizeReg = SCS_1_HIGH_DECODE_ADDRESS;	/*CS_1_SIZE; */
		/*        pciBAR = SCS_0_HIGH_DECODE_ADDRESS; */ /*PCI_CS1_BAR; */
		break;
	case BANK2:
		baseReg = SCS_2_LOW_DECODE_ADDRESS;	/*CS_2_BASE_ADDR; */
		sizeReg = SCS_2_HIGH_DECODE_ADDRESS;	/*CS_2_SIZE; */
/*        pciBAR = PCI_CS2_BAR;*/
		break;
	case BANK3:
		baseReg = SCS_3_LOW_DECODE_ADDRESS;	/*CS_3_BASE_ADDR; */
		sizeReg = SCS_3_HIGH_DECODE_ADDRESS;	/*CS_3_SIZE; */
/*        pciBAR = PCI_CS3_BAR; */
		break;
	default:
		return false;
	}
	/* If the size is 0, the window will be disabled */
	if (bankLength == 0) {
		MemoryDisableWindow (CS_0_WINDOW << bank);
		/* Disable the BAR from the PCI slave side */
/*        gtPci0DisableInternalBAR(pciBAR); */
/*        gtPci1DisableInternalBAR(pciBAR); */
		return true;
	}
	/* The base address must be aligned to the size */
	if ((bankBase % bankLength) != 0) {
		return false;
	}
	if (bankLength >= MINIMUM_MEM_BANK_SIZE) {
		newBase = bankBase >> 16;
		newSize = bankLength >> 16;
		/* Checking that the size is a sequence of '1' followed by a
		   sequence of '0' starting from LSB to MSB. */
		temp = newSize - 1;
		for (rShift = 0; rShift < 16; rShift++) {
			temp = temp >> rShift;
			if ((temp & 0x1) == 0) {	/* Either we got to the last '1' */
							/* or the size is not valid	 */
				if (temp > 0x0)
					return false;
				else
					break;
			}
		}
#ifdef DEBUG
		{
			unsigned int oldBase, oldSize;

			GT_REG_READ (baseReg, &oldBase);
			GT_REG_READ (sizeReg + 8, &oldSize);

			printf ("b%d Base:%x Size:%x -> Base:%x Size:%x\n",
				bank, oldBase, oldSize, newBase, newSize);
		}
#endif
		/* writing the new values */
		GT_REG_WRITE (baseReg, newBase);
		GT_REG_WRITE (sizeReg, newSize - 1);
		/* Enable back the window */
		MemoryEnableWindow (CS_0_WINDOW << bank);
		/* Enable the BAR from the PCI slave side */
/*        gtPci0EnableInternalBAR(pciBAR); */
/*        gtPci1EnableInternalBAR(pciBAR); */
		return true;
	}
	return false;
}

/*******************************************************************************
* memoryMapDeviceSpace - Set new base address and size for one of the device
*                           windows.
*
* DESCRIPTION:
*       The CPU interface address decoding map consists of 21 address windows
*       for the different devices (e.g. CS[3:0] ,PCI0 Mem 0/1/2/3...). Each
*       window can have a minimum of 1Mbytes of address space, and up to 4Gbyte
*       space. Each address window is defined by two registers - base and size.
*       The CPU address is compared with the values in the various CPU windows
*       until a match is found and the address is than targeted to that window.
*       This function sets new base and size for one the device windows
*       (DEV_CS0 - DEV_CS3). It is the programmer`s responsibility to make sure
*       that there are no conflicts with other memory spaces. When two memory
*       spaces overlap, the MV's behavior is not defined .If a device window
*       needs to be closed, set the 'deviceLength' parameter size to 0x0.
*
* INPUT:
*       device           - One of the device windows (DEV_CS0-DEV_CS3) as
*                          defined in gtMemory.h.
*       deviceBase - The device window base address.
*       deviceLength - The device window size. This function will decrement
*                          the 'deviceLength' parameter by one and then
*                          check if the size is valid. A valid size must be
*                          programed from LSB to MSB as sequence of '1's
*                          followed by sequence of '0's.
*                          To close a memory window simply set the size to 0.
*
*      NOTE!!!
*       The size must be in 64Kbyte granularity.
*       The base address must be aligned to the size.
*
* OUTPUT:
*       None.
*
* RETURN:
*       false for invalid size, true otherwise.
*
* CAUTION: PCI_functions must be implemented later To_do !!!!!!!!!!!!!!!!!
*
*******************************************************************************/

bool memoryMapDeviceSpace (DEVICE device, unsigned int deviceBase,
			   unsigned int deviceLength)
{
	unsigned int newBase, newSize, baseReg, sizeReg, temp, rShift;

/*    PCI_INTERNAL_BAR pciBAR;*/

	switch (device) {
	case DEVICE0:
		baseReg = CS_0_LOW_DECODE_ADDRESS;	/*DEV_CS0_BASE_ADDR; */
		sizeReg = CS_0_HIGH_DECODE_ADDRESS;	/*DEV_CS0_SIZE; */
/*        pciBAR = PCI_DEV_CS0_BAR; */
		break;
	case DEVICE1:
		baseReg = CS_1_LOW_DECODE_ADDRESS;	/*DEV_CS1_BASE_ADDR; */
		sizeReg = CS_1_HIGH_DECODE_ADDRESS;	/*DEV_CS1_SIZE; */
/*        pciBAR = PCI_DEV_CS1_BAR; */
		break;
	case DEVICE2:
		baseReg = CS_2_LOW_DECODE_ADDRESS;	/*DEV_CS2_BASE_ADDR; */
		sizeReg = CS_2_HIGH_DECODE_ADDRESS;	/*DEV_CS2_SIZE; */
/*        pciBAR = PCI_DEV_CS2_BAR; */
		break;
	case DEVICE3:
		baseReg = CS_3_LOW_DECODE_ADDRESS;	/*DEV_CS3_BASE_ADDR; */
		sizeReg = CS_3_HIGH_DECODE_ADDRESS;	/*DEV_CS3_SIZE; */
/*        pciBAR = PCI_DEV_CS3_BAR; */
		break;
	case BOOT_DEVICE:
		baseReg = BOOTCS_LOW_DECODE_ADDRESS;	/*BOOTCS_BASE_ADDR; */
		sizeReg = BOOTCS_HIGH_DECODE_ADDRESS;	/*BOOTCS_SIZE; */
/*        pciBAR = PCI_BOOT_CS_BAR; */
		break;
	default:
		return false;
	}
	if (deviceLength == 0) {
		MemoryDisableWindow (DEVCS_0_WINDOW << device);
		/* Disable the BAR from the PCI slave side */
/*        gtPci0DisableInternalBAR(pciBAR); */
/*        gtPci1DisableInternalBAR(pciBAR); */
		return true;
	}
	/* The base address must be aligned to the size */
	if ((deviceBase % deviceLength) != 0) {
		return false;
	}
	if (deviceLength >= MINIMUM_DEVICE_WINDOW_SIZE) {
		newBase = deviceBase >> 16;
		newSize = deviceLength >> 16;
		/* Checking that the size is a sequence of '1' followed by a
		   sequence of '0' starting from LSB to MSB. */
		temp = newSize - 1;
		for (rShift = 0; rShift < 16; rShift++) {
			temp = temp >> rShift;
			if ((temp & 0x1) == 0) {	/* Either we got to the last '1' */
							/* or the size is not valid       */
				if (temp > 0x0)
					return false;
				else
					break;
			}
		}
		/* writing the new values */
		GT_REG_WRITE (baseReg, newBase);
		GT_REG_WRITE (sizeReg, newSize - 1);
		MemoryEnableWindow (DEVCS_0_WINDOW << device);
		/* Enable the BAR from the PCI slave side */
/*        gtPci0EnableInternalBAR(pciBAR); */
/*        gtPci1EnableInternalBAR(pciBAR); */
		return true;
	}
	return false;
}

/*******************************************************************************
* MemorySetPciWindow - Set new base address and size for one of the PCI
*                        windows.
*
* DESCRIPTION:
*       The CPU interface address decoding map consists of 21 address windows
*       for the different devices (e.g. CS[3:0] ,PCI0 Mem 0/1/2/3...). Each
*       window can have a minimum of 1Mbytes of address space, and up to 4Gbyte
*       space. Each address window is defined by two registers - base and size.
*       The CPU address is compared with the values in the various CPU windows
*       until a match is found and the address is than targeted to that window.
*       This function sets new base and size for one the PCI windows
*       (PCI memory0/1/2..). It is the programmer`s responsibility to make sure
*       that there are no conflicts with other memory spaces. When two memory
*       spaces overlap, the MV's behavior is not defined. If a PCI window
*       needs to be closed, set the 'pciWindowSize' parameter size to 0x0.
*
* INPUT:
*       pciWindow     - One of the PCI windows as defined in gtMemory.h.
*       pciWindowBase - The PCI window base address.
*       pciWindowSize - The PCI window size. This function will decrement the
*                       'pciWindowSize' parameter by one and then check if the
*                       size is valid. A valid size must be programed from LSB
*                       to MSB as sequence of '1's followed by sequence of '0's.
*                       To close a memory window simply set the size to 0.
*
*      NOTE!!!
*       The size must be in 64Kbyte granularity.
*       The base address must be aligned to the size.
*
* OUTPUT:
*       None.
*
* RETURN:
*       false for invalid size, true otherwise.
*
*******************************************************************************/
bool memorySetPciWindow (PCI_MEM_WINDOW pciWindow, unsigned int pciWindowBase,
			 unsigned int pciWindowSize)
{
	unsigned int currentLow, baseAddrReg, sizeReg, temp, rShift;

	switch (pciWindow) {
	case PCI_0_IO:
		baseAddrReg = PCI_1I_O_LOW_DECODE_ADDRESS;	/*PCI_0_IO_BASE_ADDR; */
		sizeReg = PCI_0I_O_HIGH_DECODE_ADDRESS;	/*PCI_0_IO_SIZE; */
		break;
	case PCI_0_MEM0:
		baseAddrReg = PCI_0MEMORY0_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY0_BASE_ADDR; */
		sizeReg = PCI_0MEMORY0_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY0_SIZE; */
		break;
	case PCI_0_MEM1:
		baseAddrReg = PCI_0MEMORY1_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY1_BASE_ADDR; */
		sizeReg = PCI_0MEMORY1_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY1_SIZE; */
		break;
	case PCI_0_MEM2:
		baseAddrReg = PCI_0MEMORY2_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY2_BASE_ADDR; */
		sizeReg = PCI_0MEMORY2_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY2_SIZE; */
		break;
	case PCI_0_MEM3:
		baseAddrReg = PCI_0MEMORY3_LOW_DECODE_ADDRESS;	/*PCI_0_MEMORY3_BASE_ADDR; */
		sizeReg = PCI_0MEMORY3_HIGH_DECODE_ADDRESS;	/*PCI_0_MEMORY3_SIZE; */
		break;
#ifdef INCLUDE_PCI_1
	case PCI_1_IO:
		baseAddrReg = PCI_1I_O_LOW_DECODE_ADDRESS;	/*PCI_1_IO_BASE_ADDR; */
		sizeReg = PCI_1I_O_HIGH_DECODE_ADDRESS;	/*PCI_1_IO_SIZE; */
		break;
	case PCI_1_MEM0:
		baseAddrReg = PCI_1MEMORY0_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY0_BASE_ADDR; */
		sizeReg = PCI_1MEMORY0_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY0_SIZE; */
		break;
	case PCI_1_MEM1:
		baseAddrReg = PCI_1MEMORY1_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY1_BASE_ADDR;  */
		sizeReg = PCI_1MEMORY1_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY1_SIZE; */
		break;
	case PCI_1_MEM2:
		baseAddrReg = PCI_1MEMORY2_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY2_BASE_ADDR;  */
		sizeReg = PCI_1MEMORY2_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY2_SIZE; */
		break;
	case PCI_1_MEM3:
		baseAddrReg = PCI_1MEMORY3_LOW_DECODE_ADDRESS;	/*PCI_1_MEMORY3_BASE_ADDR; */
		sizeReg = PCI_1MEMORY3_HIGH_DECODE_ADDRESS;	/*PCI_1_MEMORY3_SIZE; */
		break;
#endif /* INCLUDE_PCI_1 */
	default:
		return false;
	}
	if (pciWindowSize == 0) {
		MemoryDisableWindow (PCI_0_IO_WINDOW << pciWindow);
		return true;
	}
	/* The base address must be aligned to the size */
	if ((pciWindowBase % pciWindowSize) != 0) {
		return false;
	}
	if (pciWindowSize >= MINIMUM_PCI_WINDOW_SIZE) {
		pciWindowBase >>= 16;
		pciWindowSize >>= 16;
		/* Checking that the size is a sequence of '1' followed by a
		   sequence of '0' starting from LSB to MSB. */
		temp = pciWindowSize - 1;
		for (rShift = 0; rShift < 16; rShift++) {
			temp = temp >> rShift;
			if ((temp & 0x1) == 0) {	/* Either we got to the last '1' */
							/* or the size is not valid       */
				if (temp > 0x0)
					return false;
				else
					break;
			}
		}
		GT_REG_WRITE (sizeReg, pciWindowSize - 1);
		GT_REG_READ (baseAddrReg, &currentLow);
		pciWindowBase =
			(pciWindowBase & 0xfffff) | (currentLow & 0xfff00000);
		GT_REG_WRITE (baseAddrReg, pciWindowBase);
		MemoryEnableWindow (PCI_0_IO_WINDOW << pciWindow);
		return true;
	}
	return false;
}

/*******************************************************************************
* memoryMapInternalRegistersSpace - Sets new base address for the internal
*                                  registers memory space.
*
* DESCRIPTION:
*       This function set new base address for the internal registers memory
*       space (the size is fixed and cannot be modified). The function does not
*       handle overlapping with other memory spaces, it is the programer's
*       responsibility to ensure that overlapping does not occur.
*       When two memory spaces overlap, the MV's behavior is not defined.
*
* INPUT:
*       internalRegBase - new base address for the internal registers memory
*                         space.
*
* OUTPUT:
*       None.
*
* RETURN:
*        true on success, false on failure
*
*******************************************************************************/
/********************************************************************
* memoryMapInternalRegistersSpace - Sets new base address for the internals
*                                   registers.
*
* INPUTS:  unsigned int internalRegBase - The new base address.
* RETURNS: true on success, false on failure
*********************************************************************/
bool memoryMapInternalRegistersSpace (unsigned int internalRegBase)
{
	unsigned int currentValue;
	unsigned int internalValue = internalRegBase;

	internalRegBase = (internalRegBase >> 16);
	GT_REG_READ (INTERNAL_SPACE_DECODE, &currentValue);
	internalRegBase = (currentValue & 0xff000000) | internalRegBase;
	GT_REG_WRITE (INTERNAL_SPACE_DECODE, internalRegBase);
	/* initializing also the global variable 'internalRegBaseAddr' */
/*    gtInternalRegBaseAddr = internalValue; */
	INTERNAL_REG_BASE_ADDR = internalValue;
	return true;
}

/*******************************************************************************
* memoryGetInternalRegistersSpace - Returns the internal registers Base
*                                     address.
*
* DESCRIPTION:
*       This function returns the base address of  the internal registers
*       memory space .
*
* INPUT:
*       None.
*
* OUTPUT:
*       None.
*
* RETURN:
*       32 bit base address of the internal registers memory space.
*
*******************************************************************************/
unsigned int memoryGetInternalRegistersSpace (void)
{
	unsigned int currentValue = 0;

	GT_REG_READ (INTERNAL_SPACE_DECODE, &currentValue);
	return ((currentValue & 0x000fffff) << 16);
}

/*******************************************************************************
* gtMemoryGetInternalSramBaseAddr - Returns the integrated SRAM base address.
*
* DESCRIPTION:
*       The Atlantis incorporate integrated 2Mbit SRAM for general use. This
*       funcnion return the SRAM's base address.
* INPUT:
*       None.
* OUTPUT:
*       None.
* RETURN:
*       32 bit SRAM's base address.
*
*******************************************************************************/
unsigned int memoryGetInternalSramBaseAddr (void)
{
	return ((GTREGREAD (INTEGRATED_SRAM_BASE_ADDR) & 0xfffff) << 16);
}

/*******************************************************************************
* gtMemorySetInternalSramBaseAddr - Set the integrated SRAM base address.
*
* DESCRIPTION:
*       The Atlantis incorporate integrated 2Mbit SRAM for general use. This
*       function sets a new base address to the SRAM .
* INPUT:
*       sramBaseAddress - The SRAM's base address.
* OUTPUT:
*       None.
* RETURN:
*       None.
*
*******************************************************************************/
void gtMemorySetInternalSramBaseAddr (unsigned int sramBaseAddress)
{
	GT_REG_WRITE (INTEGRATED_SRAM_BASE_ADDR, sramBaseAddress >> 16);
}

/*******************************************************************************
* memorySetProtectRegion - Set protection mode for one of the 8 regions.
*
* DESCRIPTION:
*       The CPU interface supports configurable access protection. This includes
*       up to eight address ranges defined to a different protection type :
*       whether the address range is cacheable or not, whether it is writable or
*       not , and whether it is accessible or not. A Low and High registers
*       define each window while the minimum address range of each window is
*       1Mbyte. An address driven by the CPU, in addition to the address
*       decoding and remapping process, is compared against the eight Access
*       Protection Low/High registers , if an address matches one of the windows
*       , the MV device checks the transaction type against the protection bits
*       defined in CPU Access Protection register, to determine if the access is
*       allowed. This function set a protection mode to one of the 8 possible
*       regions.
*      NOTE:
*       The CPU address windows are restricted to a size of  2 power n and the
*       start address must be aligned to the window size. For example, if using
*       a 16 MB window, the start address bits [23:0] must be 0.The MV's
*       internal registers space is not protected, even if the access protection
*       windows contain this space.
*
* INPUT:
*       region - selects which region to be configured. The values defined in
*                gtMemory.h:
*
*                 - MEM_REGION0
*                 - MEM_REGION1
*                 - etc.
*
*       memAccess - Allows or forbids access (read or write ) to the region. The
*                   values defined in gtMemory.h:
*
*                    - MEM_ACCESS_ALLOWED
*                    - MEM_ACCESS_FORBIDEN
*
*       memWrite - CPU write protection to the region. The values defined in
*                  gtMemory.h:
*
*                   - MEM_WRITE_ALLOWED
*                   - MEM_WRITE_FORBIDEN
*
*       cacheProtection - Defines whether caching the region is allowed or not.
*                         The values defined in gtMemory.h:
*
*                          - MEM_CACHE_ALLOWED
*                          - MEM_CACHE_FORBIDEN
*
*       baseAddress - the region's base Address.
*       regionSize  - The region's size. This function will decrement the
*                     'regionSize' parameter by one and then check if the size
*                     is valid. A valid size must be programed from LSB to MSB
*                     as sequence of '1's followed by sequence of '0's.
*                     To close a memory window simply set the size to 0.
*
*      NOTE!!!
*       The size must be in 64Kbyte granularity.
*       The base address must be aligned to the size.
*
* OUTPUT:
*       None.
*
* RETURN:
*       false for invalid size, true otherwise.
*
*******************************************************************************/
bool memorySetProtectRegion (MEMORY_PROTECT_WINDOW window,
			     MEMORY_ACCESS memAccess,
			     MEMORY_ACCESS_WRITE memWrite,
			     MEMORY_CACHE_PROTECT cacheProtection,
			     unsigned int baseAddress, unsigned int size)
{
	unsigned int dataForReg, temp, rShift;

	if (size == 0) {
		GT_REG_WRITE ((CPU_PROTECT_WINDOW_0_SIZE + 0x10 * window),
			      0x0);
		return true;
	}
	/* The base address must be aligned to the size.  */
	if (baseAddress % size != 0) {
		return false;
	}
	if (size >= MINIMUM_ACCESS_WIN_SIZE) {
		baseAddress = ((baseAddress >> 16) & 0xfffff);
		dataForReg = baseAddress | ((memAccess << 20) & BIT20) |
			((memWrite << 21) & BIT21) | ((cacheProtection << 22)
						      & BIT22) | BIT31;
		GT_REG_WRITE (CPU_PROTECT_WINDOW_0_BASE_ADDR + 0x10 * window,
			      dataForReg);
		size >>= 16;
		/* Checking that the size is a sequence of '1' followed by a
		   sequence of '0' starting from LSB to MSB. */
		temp = size - 1;
		for (rShift = 0; rShift < 16; rShift++) {
			temp = temp >> rShift;
			if ((temp & 0x1) == 0) {	/* Either we got to the last '1' */
							/* or the size is not valid       */
				if (temp > 0x0)
					return false;
				else
					break;
			}
		}
		GT_REG_WRITE ((CPU_PROTECT_WINDOW_0_SIZE + 0x10 * window),
			      size - 1);
		return true;
	}
	return false;
}

/*******************************************************************************
* gtMemoryDisableProtectRegion - Disable a protected window.
*
* DESCRIPTION:
*       This function disable a protected window set by
*       'gtMemorySetProtectRegion' function.
*
* INPUT:
*       window - one of the 4 windows ( defined in gtMemory.h ).
*
* OUTPUT:
*       None.
*
* RETURN:
*       None.
*
*******************************************************************************/
void memoryDisableProtectRegion (MEMORY_PROTECT_WINDOW window)
{
	RESET_REG_BITS (((CPU_PROTECT_WINDOW_0_BASE_ADDR) + (0x10 * window)),
			BIT31);
}

/*******************************************************************************
* memorySetPciRemapValue - Set a remap value to a PCI memory space target.
*
* DESCRIPTION:
*       In addition to the address decoding mechanism, the CPU has an address
*       remapping mechanism to be used by every PCI decoding window. Each PCI
*       window can be remaped to a desired address target according to the remap
*       value within the remap register. The address remapping is useful when a
*       CPU address range must be reallocated to a different location on the
*       PCI bus. Also, it enables CPU access to a PCI agent located above the
*       4Gbyte space. On system boot, each of the PCI memory spaces is maped to
*       a defualt value (see CPU interface section in the MV spec for the
*       default values). The remap mechanism does not always produce the desired
*       address on the PCI bus because of the remap mechanism way of working
*       (to fully understand why, please see the 'Address Remapping' section in
*       the MV's spec). Therefor, this function sets a desired remap value to
*       one of the PCI memory windows and return the effective address that
*       should be used when exiting the PCI memory window. You should ALWAYS use
*       the returned value by this function when remapping a PCI window and
*       exiting it. If for example the base address of PCI0 memory 0 is
*       0x90000000, the size is 0x03ffffff and the remap value is 0x11000000,
*       the function will return the value of 0x91000000 that MUST
*       be used to exit this memory window in order to achive the deisred
*       remapping.
*
* INPUT:
*       memoryWindow   - One of the PCI memory windows as defined in Memory.h
*       remapValueLow  - The low remap value.
*       remapValueHigh - The high remap value.
* OUTPUT:
*       None.
*
* RETURN:
*       The effective base address to exit the PCI, or 0xffffffff if one of the
*       parameters is erroneous or the effective base address is higher the top
*       decode value.
*
*******************************************************************************/
unsigned int memorySetPciRemapValue (PCI_MEM_WINDOW memoryWindow,
				     unsigned int remapValueHigh,
				     unsigned int remapValueLow)
{
	unsigned int pciMemWindowBaseAddrReg = 0, baseAddrValue = 0;
	unsigned int pciMemWindowSizeReg = 0, windowSizeValue = 0;
	unsigned int effectiveBaseAddress, remapRegLow, remapRegHigh;

	/* Initializing the base and size variables of the PCI
	   memory windows */
	switch (memoryWindow) {
	case PCI_0_IO:
		pciMemWindowBaseAddrReg = PCI_0_IO_BASE_ADDR;
		pciMemWindowSizeReg = PCI_0_IO_SIZE;
		remapRegLow = PCI_0_IO_ADDR_REMAP;
		remapRegHigh = PCI_0_IO_ADDR_REMAP;
		break;
	case PCI_0_MEM0:
		pciMemWindowBaseAddrReg = PCI_0_MEMORY0_BASE_ADDR;
		pciMemWindowSizeReg = PCI_0_MEMORY0_SIZE;
		remapRegLow = PCI_0_MEMORY0_LOW_ADDR_REMAP;
		remapRegHigh = PCI_0_MEMORY0_HIGH_ADDR_REMAP;
		break;
	case PCI_0_MEM1:
		pciMemWindowBaseAddrReg = PCI_0_MEMORY1_BASE_ADDR;
		pciMemWindowSizeReg = PCI_0_MEMORY1_SIZE;
		remapRegLow = PCI_0_MEMORY1_LOW_ADDR_REMAP;
		remapRegHigh = PCI_0_MEMORY1_HIGH_ADDR_REMAP;
		break;
	case PCI_0_MEM2:
		pciMemWindowBaseAddrReg = PCI_0_MEMORY2_BASE_ADDR;
		pciMemWindowSizeReg = PCI_0_MEMORY2_SIZE;
		remapRegLow = PCI_0_MEMORY2_LOW_ADDR_REMAP;
		remapRegHigh = PCI_0_MEMORY2_HIGH_ADDR_REMAP;
		break;
	case PCI_0_MEM3:
		pciMemWindowBaseAddrReg = PCI_0_MEMORY3_BASE_ADDR;
		pciMemWindowSizeReg = PCI_0_MEMORY3_SIZE;
		remapRegLow = PCI_0_MEMORY3_LOW_ADDR_REMAP;
		remapRegHigh = PCI_0_MEMORY3_HIGH_ADDR_REMAP;
		break;
#ifdef INCLUDE_PCI_1
	case PCI_1_IO:
		pciMemWindowBaseAddrReg = PCI_1_IO_BASE_ADDR;
		pciMemWindowSizeReg = PCI_1_IO_SIZE;
		remapRegLow = PCI_1_IO_ADDR_REMAP;
		remapRegHigh = PCI_1_IO_ADDR_REMAP;
		break;
	case PCI_1_MEM0:
		pciMemWindowBaseAddrReg = PCI_1_MEMORY0_BASE_ADDR;
		pciMemWindowSizeReg = PCI_1_MEMORY0_SIZE;
		remapRegLow = PCI_1_MEMORY0_LOW_ADDR_REMAP;
		remapRegHigh = PCI_1_MEMORY0_HIGH_ADDR_REMAP;
		break;
	case PCI_1_MEM1:
		pciMemWindowBaseAddrReg = PCI_1_MEMORY1_BASE_ADDR;
		pciMemWindowSizeReg = PCI_1_MEMORY1_SIZE;
		remapRegLow = PCI_1_MEMORY1_LOW_ADDR_REMAP;
		remapRegHigh = PCI_1_MEMORY1_HIGH_ADDR_REMAP;
		break;
	case PCI_1_MEM2:
		pciMemWindowBaseAddrReg = PCI_1_MEMORY1_BASE_ADDR;
		pciMemWindowSizeReg = PCI_1_MEMORY1_SIZE;
		remapRegLow = PCI_1_MEMORY1_LOW_ADDR_REMAP;
		remapRegHigh = PCI_1_MEMORY1_HIGH_ADDR_REMAP;
		break;
	case PCI_1_MEM3:
		pciMemWindowBaseAddrReg = PCI_1_MEMORY3_BASE_ADDR;
		pciMemWindowSizeReg = PCI_1_MEMORY3_SIZE;
		remapRegLow = PCI_1_MEMORY3_LOW_ADDR_REMAP;
		remapRegHigh = PCI_1_MEMORY3_HIGH_ADDR_REMAP;
		break;
#endif /* INCLUDE_PCI_1 */
	default:
		/* Retrun an invalid effective base address */
		return 0xffffffff;
	}
	/* Writing the remap value to the remap regisers */
	GT_REG_WRITE (remapRegHigh, remapValueHigh);
	GT_REG_WRITE (remapRegLow, remapValueLow >> 16);
	/* Reading the values from the base address and size registers */
	baseAddrValue = GTREGREAD (pciMemWindowBaseAddrReg) & 0xfffff;
	windowSizeValue = GTREGREAD (pciMemWindowSizeReg) & 0xffff;
	/* Start calculating the effective Base Address */
	effectiveBaseAddress = baseAddrValue << 16;
	/* The effective base address will be combined from the chopped (if any)
	   remap value (according to the size value and remap mechanism) and the
	   window's base address */
	effectiveBaseAddress |=
		(((windowSizeValue << 16) | 0xffff) & remapValueLow);
	/* If the effectiveBaseAddress exceed the window boundaries return an
	   invalid value. */
	if (effectiveBaseAddress >
	    ((baseAddrValue << 16) + ((windowSizeValue << 16) | 0xffff)))
		return 0xffffffff;
	return effectiveBaseAddress;
}

/********************************************************************
* memorySetRegionSnoopMode - This function modifys one of the 4 regions which
*                            supports Cache Coherency.
*
*
* Inputs: SNOOP_REGION region - One of the four regions.
*         SNOOP_TYPE snoopType - There is four optional Types:
*                               1. No Snoop.
*                               2. Snoop to WT region.
*                               3. Snoop to WB region.
*                               4. Snoop & Invalidate to WB region.
*         unsigned int baseAddress - Base Address of this region.
*         unsigned int topAddress - Top Address of this region.
* Returns: false if one of the parameters is wrong and true else
*********************************************************************/
/* evb6260 code */
#if 0
bool memorySetRegionSnoopMode(MEMORY_SNOOP_REGION region,
			      MEMORY_SNOOP_TYPE snoopType,
			      unsigned int baseAddress,
			      unsigned int regionLength)
{
    unsigned int snoopXbaseAddress;
    unsigned int snoopXtopAddress;
    unsigned int data;
    unsigned int snoopHigh = baseAddress + regionLength;

    if( (region > MEM_SNOOP_REGION3) || (snoopType > MEM_SNOOP_WB) )
	return false;
    snoopXbaseAddress = SNOOP_BASE_ADDRESS_0 + 0x10 * region;
    snoopXtopAddress = SNOOP_TOP_ADDRESS_0 + 0x10 * region;
				 if(regionLength == 0) /* closing the region */
    {
	GT_REG_WRITE(snoopXbaseAddress,0x0000ffff);
	GT_REG_WRITE(snoopXtopAddress,0);
	return true;
    }
    baseAddress = baseAddress & 0xffff0000;
    data = (baseAddress >> 16) | snoopType << 16;
    GT_REG_WRITE(snoopXbaseAddress,data);
    snoopHigh = (snoopHigh & 0xfff00000) >> 20;
    GT_REG_WRITE(snoopXtopAddress,snoopHigh - 1);
    return true;
}
#endif

/********************************************************************
* memoryRemapAddress - This fubction used for address remapping.
*
*
* Inputs: regOffset: remap register
*         remapValue :
* Returns: false if one of the parameters is erroneous,true otherwise.
*
* Not needed function To_do !!!!
*********************************************************************/
bool memoryRemapAddress (unsigned int remapReg, unsigned int remapValue)
{
	unsigned int valueForReg;

	valueForReg = (remapValue & 0xfff00000) >> 20;
	GT_REG_WRITE (remapReg, valueForReg);
	return true;
}

/*******************************************************************************
* memoryGetDeviceParam - Extract the device parameters from the device bank
*                          parameters register.
*
* DESCRIPTION:
*       To allow interfacing with very slow devices and fast synchronous SRAMs,
*       each device can be programed to different timing parameters. Each bank
*       has its own parameters register. Bank width can be programmed to 8, 16,
*       or 32-bits. Bank timing parameters can be programmed to support
*       different device types (e.g. Sync Burst SRAM, Flash , ROM, I/O
*       Controllers). The MV allows you to set timing parameters and width for
*       each device through parameters register .
*       This function extracts the parameters described from the Device Bank
*       parameters register and fills the given 'deviceParam' (defined in
*       gtMemory.h) structure with the read data.
*
* INPUT:
*       deviceParam -  pointer to a structure DEVICE_PARAM (defined in
*                      Memory.h).For details about each structure field please
*                      see the device timing parameter section in the MV
*                      datasheet.
*       deviceNum  -   Select on of the five device banks (defined in
*                      Memory.h) :
*
*                       - DEVICE0
*                       - DEVICE1
*                       - DEVICE2
*                       - etc.
*
* OUTPUT:
*       None.
*
* RETURN:
*       false if one of the parameters is erroneous,true otherwise.
*
*******************************************************************************/
/********************************************************************
* memoryGetDeviceParam - This function used for getting device parameters from
*                        DEVICE BANK PARAMETERS REGISTER
*
*
* Inputs:        - deviceParam: STRUCT with paramiters for DEVICE BANK
*                  PARAMETERS REGISTER
*                - deviceNum : number of device
* Returns: false if one of the parameters is erroneous,true otherwise.
*********************************************************************/

bool memoryGetDeviceParam (DEVICE_PARAM * deviceParam, DEVICE deviceNum)
{
	unsigned int valueOfReg;
	unsigned int calcData;

	if (deviceNum > 4)
		return false;
	GT_REG_READ (DEVICE_BANK0PARAMETERS + 4 * deviceNum, &valueOfReg);
	calcData = (0x7 & valueOfReg) + ((BIT22 & valueOfReg) >> 19);
	deviceParam->turnOff = calcData;	/* Turn Off */

	calcData = ((0x78 & valueOfReg) >> 3) + ((BIT23 & valueOfReg) >> 19);
	deviceParam->acc2First = calcData;	/* Access To First */

	calcData = ((0x780 & valueOfReg) >> 7) + ((BIT24 & valueOfReg) >> 20);
	deviceParam->acc2Next = calcData;	/* Access To Next */

	calcData =
		((0x3800 & valueOfReg) >> 11) + ((BIT25 & valueOfReg) >> 22);
	deviceParam->ale2Wr = calcData;	/* Ale To Write */

	calcData = ((0x1c000 & valueOfReg) >> 14) +
		((BIT26 & valueOfReg) >> 23);
	deviceParam->wrLow = calcData;	/* Write Active */

	calcData = ((0xe0000 & valueOfReg) >> 17) +
		((BIT27 & valueOfReg) >> 24);
	deviceParam->wrHigh = calcData;	/* Write High */

	calcData = ((0x300000 & valueOfReg) >> 20);
	deviceParam->deviceWidth = (BIT0 << calcData);	/* In bytes */
	calcData = ((0x30000000 & valueOfReg) >> 28);
	deviceParam->badrSkew = calcData;	/* Cycles gap between BAdr
						   toggle to read data sample. */
	calcData = ((0x40000000 & valueOfReg) >> 30);
	deviceParam->DPEn = calcData;	/*  Data Parity enable  */
	return true;
}

/*******************************************************************************
* memorySetDeviceParam - Set new parameters for a device.
*
*
* DESCRIPTION:
*       To allow interfacing with very slow devices and fast synchronous SRAMs,
*       each device can be programed to different timing parameters. Each bank
*       has its own parameters register. Bank width can be programmed to 8, 16,
*       or 32-bits. Bank timing parameters can be programmed to support
*       different device types (e.g. Sync Burst SRAM, Flash , ROM, I/O
*       Controllers). The MV allows you to set timing parameters and width for
*       each device through parameters register. This function set new
*       parameters to a device Bank from the delivered structure 'deviceParam'
*       (defined in gtMemory.h). The structure must be initialized with data
*       prior to the use of these function.
*
* INPUT:
*       deviceParam -  pointer to a structure DEVICE_PARAM (defined in
*                      Memory.h).For details about each structure field please
*                      see the device timing parameter section in the MV
*                      datasheet.
*       deviceNum  -   Select on of the five device banks (defined in
*                      Memory.h) :
*
*                       - DEVICE0
*                       - DEVICE1
*                       - DEVICE2
*                       - etc.
*
* OUTPUT:
*       None.
*
* RETURN:
*       false if one of the parameters is erroneous,true otherwise.
*
*******************************************************************************/
/********************************************************************
* memorySetDeviceParam - This function used for setting device parameters to
*                        DEVICE BANK PARAMETERS REGISTER
*
*
* Inputs:        - deviceParam: STRUCT for store paramiters from DEVICE BANK
*                  PARAMETERS REGISTER
*                - deviceNum : number of device
* Returns: false if one of the parameters is erroneous,true otherwise.
*********************************************************************/
bool memorySetDeviceParam (DEVICE_PARAM * deviceParam, DEVICE deviceNum)
{
	unsigned int valueForReg;

	if ((deviceParam->turnOff > 0x7) || (deviceParam->acc2First > 0xf) ||
	    (deviceParam->acc2Next > 0xf) || (deviceParam->ale2Wr > 0x7) ||
	    (deviceParam->wrLow > 0x7) || (deviceParam->wrHigh > 0x7) ||
	    (deviceParam->badrSkew > 0x2) || (deviceParam->DPEn > 0x1)) {
		return false;
	}
	valueForReg = (((deviceParam->turnOff) & 0x7) |
		       (((deviceParam->turnOff) & 0x8) << 19) |
		       (((deviceParam->acc2First) & 0xf) << 3) |
		       (((deviceParam->acc2First) & 0x10) << 19) |
		       (((deviceParam->acc2Next) & 0xf) << 7) |
		       (((deviceParam->acc2Next) & 0x10) << 20) |
		       (((deviceParam->ale2Wr) & 0x7) << 11) |
		       (((deviceParam->ale2Wr) & 0xf) << 22) |
		       (((deviceParam->wrLow) & 0x7) << 14) |
		       (((deviceParam->wrLow) & 0xf) << 23) |
		       (((deviceParam->wrHigh) & 0x7) << 17) |
		       (((deviceParam->wrHigh) & 0xf) << 24) |
		       (((deviceParam->badrSkew) & 0x3) << 28) |
		       (((deviceParam->DPEn) & 0x1) << 30));

	/* insert the device width: */
	switch (deviceParam->deviceWidth) {
	case 1:
		valueForReg = valueForReg | _8BIT;
		break;
	case 2:
		valueForReg = valueForReg | _16BIT;
		break;
	case 4:
		valueForReg = valueForReg | _32BIT;
		break;
	default:
		valueForReg = valueForReg | _8BIT;
		break;
	}
	GT_REG_WRITE (DEVICE_BANK0PARAMETERS + 4 * deviceNum, valueForReg);
	return true;
}

/*******************************************************************************
* MemoryDisableWindow - Disable a memory space by the disable bit.
* DESCRIPTION:
*       This function disables one of the 21 availiable windows dedicated for
*       the CPU decoding mechanism. Its possible to combine several windows with
*       the OR command.
* INPUT:
*       window - One or more of the memory windows (defined in gtMemory.h).
* OUTPUT:
*       None.
* RETURN:
*       None.
*******************************************************************************/
void MemoryDisableWindow (MEMORY_WINDOW window)
{
	SET_REG_BITS (BASE_ADDR_ENABLE, window);
}

/*******************************************************************************
* MemoryEnableWindow - Enable a memory space that was disabled by
*                       'MemoryDisableWindow'.
* DESCRIPTION:
*       This function enables one of the 21 availiable windows dedicated for the
*       CPU decoding mechanism. Its possible to combine several windows with the
*       OR command.
* INPUT:
*       window - One or more of the memory windows (defined in gtMemory.h).
* OUTPUT:
*       None.
* RETURN:
*       None.
*******************************************************************************/
void MemoryEnableWindow (MEMORY_WINDOW window)
{
	RESET_REG_BITS (BASE_ADDR_ENABLE, window);
}

/*******************************************************************************
* MemoryGetMemWindowStatus - This function check whether the memory window is
*                              disabled or not.
* DESCRIPTION:
*       This function checks if the given memory window is closed .
* INPUT:
*       window - One or more of the memory windows (defined in gtMemory.h).
* OUTPUT:
*       None.
* RETURN:
*       true for a closed window, false otherwise .
*******************************************************************************/
MEMORY_WINDOW_STATUS MemoryGetMemWindowStatus (MEMORY_WINDOW window)
{
	if (GTREGREAD (BASE_ADDR_ENABLE) & window)
		return MEM_WINDOW_DISABLED;
	return MEM_WINDOW_ENABLED;
}


text:
package net.glider.src.blocks;

import net.glider.src.items.ItemBlockMod;
import net.glider.src.utils.GliderModInfo;
import net.glider.src.utils.IDescrObject;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.common.registry.GameRegistry;

public class BlockMod extends Block implements IDescrObject {

	private String name;
	public boolean showDescr = false;

	public static BlockMod BuildpPoint;

	public static void init()
	{
		BuildpPoint = new BlockBuildPoint("buildPoint");
	}

	public BlockMod(String uln)
	{
		this(uln, GliderModInfo.ModTestures + ":" + uln, Block.soundTypeStone, Material.rock, 0.5F, 10.0F, true);
	}

	public BlockMod(String uln, boolean reg)
	{
		super(Material.rock);
		this.name = uln;
		this.setBlockName(uln);
		if (reg)
			GameRegistry.registerBlock(this, this.getItemBlockClass(), uln);
	}

	public BlockMod(String uln, String texture)
	{
		this(uln, texture, Block.soundTypeStone, Material.rock, 0.5F, 10.0F, true);
	}

	public BlockMod(String uln, String texture, Block.SoundType sound, Material material, float har, float res, boolean reg)
	{
		super(material);
		this.name = uln;
		this.setBlockName(uln);
		this.setStepSound(sound);
		this.setResistance(res);
		this.setHardness(har);
		this.setCreativeTab(CreativeTabs.tabDecorations);
		this.setBlockTextureName(texture);
		if (reg)
			GameRegistry.registerBlock(this, this.getItemBlockClass(), uln);
	}

	public boolean getItem(EntityPlayer ep, int size)
	{
		if (ep.getCurrentEquippedItem().stackSize >= size)
		{
			if (!ep.capabilities.isCreativeMode)
			{
				ep.getCurrentEquippedItem().stackSize = ep.getCurrentEquippedItem().stackSize - size;
			}
			ep.swingItem();
			return true;
		}
		return false;
	}

	public void onItemBlockCreation(ItemBlockMod ibm)
	{}

	public Class<? extends ItemBlockMod> getItemBlockClass()
	{
		return ItemBlockMod.class;
	}

	@Override
	public String getLocalizedName()
	{
		return StatCollector.translateToLocal(getUnlocalizedName() + ".name");
	}

	public String getUnlocalizedName(ItemStack is)
	{
		return getUnlocalizedName();
	}

	@Override
	public String getUnlocalizedName()
	{
		return GliderModInfo.MOD_ID + ":block." + name;
	}

	@Override
	public String getDescription(int meta)
	{
		return "";
	}

	@Override
	public String getShiftDescription(int meta)
	{
		return StatCollector.translateToLocal(GliderModInfo.MOD_ID + ":descr_shift." + name + ".name");
	}

	@Override
	public boolean showDescription(int meta)
	{
		return showDescr;
	}

	public void setShowDescr(boolean showDescr)
	{
		this.showDescr = showDescr;
	}
}


text:
import unittest
import muirc

class TranslateTestCase(unittest.TestCase):
    def test_parse(self):
        self.assertEqual(
            muirc.translate("PRIVMSG #irc :Hello, World! :-)\r\n"),
            {'nick': None, 'host': None, 'command': 'PRIVMSG', 'user': None, 'params': ['#irc', 'Hello, World! :-)']}
        )

    def test_generate(self):
        self.assertEqual(
            muirc.translate({'nick': None, 'host': None, 'command': 'PRIVMSG', 'user': None, 'params': ['#irc', 'Hello, World! :-)']}),
            'PRIVMSG #irc :Hello, World! :-)\r\n'
        )

    def test_identity(self):
        self.assertEqual(
            muirc.translate(muirc.translate("PRIVMSG #irc :Hello, World! :-)\r\n")),
            'PRIVMSG #irc :Hello, World! :-)\r\n'
        )

        self.assertEqual(
            muirc.translate(muirc.translate({'nick': None, 'host': None, 'command': 'PRIVMSG', 'user': None, 'params': ['#irc', 'Hello, World! :-)']})),
            {'nick': None, 'host': None, 'command': 'PRIVMSG', 'user': None, 'params': ['#irc', 'Hello, World! :-)']}
        )

    def test_parse_adv(self):
        self.assertEqual(
            muirc.translate(":nick!user@host PRIVMSG #irc :Hello, World! :-)"),
            {'nick': 'nick', 'host': 'host', 'command': 'PRIVMSG', 'user': 'user', 'params': ['#irc', 'Hello, World! :-)']}
        )

    def test_generate_adv(self):
        self.assertEqual(
            muirc.translate(muirc.translate(":nick!user@host PRIVMSG #irc :Hello, World! :-)")),
            ':nick!user@host PRIVMSG #irc :Hello, World! :-)\r\n'
        )

if __name__ == "__main__":
    unittest.main()


text:
import PromiseIO from 'promise.io/server'

const chat = PromiseIO.of('/chat')

chat.connection((socket) => {
  console.log('a new user connected')
  socket.receive('submit', (req, resolve, reject) => {
    chat.emit('message', req)
    resolve('success')
  })
})


text:
/**
 * @fileoverview This file is generated by the Angular template compiler.
 * Do not edit.
 * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride}
 */
 /* tslint:disable */

import * as i0 from '@angular/core';
import * as i1 from './app.module';
import * as i2 from './app.component';
import * as i3 from '../../../../../node_modules/@angular-mdl/core/components/dialog-outlet/mdl-dialog-outlet.component.ngfactory';
import * as i4 from '../../../../../node_modules/@angular-mdl/core/components/dialog-outlet/mdl-backdrop-overlay.component.ngfactory';
import * as i5 from '../../../../../node_modules/@angular-mdl/core/components/dialog/mdl-dialog.component.ngfactory';
import * as i6 from '../../../../../node_modules/@angular-mdl/core/components/dialog/mdl-alert.component.ngfactory';
import * as i7 from '../../../../../node_modules/@angular-mdl/core/components/dialog/mdl-dialog-host.component.ngfactory';
import * as i8 from '../../../../../node_modules/@angular-mdl/core/components/dialog/mdl-simple-dialog.component.ngfactory';
import * as i9 from '../../../../../node_modules/@angular-mdl/core/components/snackbar/mdl-snackbar.service.ngfactory';
import * as i10 from '../../../../../node_modules/@angular-mdl/core/components/tooltip/mdl-tooltip.component.ngfactory';
import * as i11 from './dashboard.component.ngfactory';
import * as i12 from './shucedule.component.ngfactory';
import * as i13 from './app.component.ngfactory';
import * as i14 from '@angular/common';
import * as i15 from '@angular/platform-browser';
import * as i16 from '@angular/forms';
import * as i17 from '@angular/http';
import * as i18 from '@angular-mdl/core/components/common/animations';
import * as i19 from '@angular-mdl/core/components/common/index';
import * as i20 from '@angular-mdl/core/components/dialog-outlet/mdl-dialog-outlet.service';
import * as i21 from '@angular-mdl/core/components/layout/mdl-layout.component';
import * as i22 from '@angular-mdl/core/components/dialog/mdl-dialog.service';
import * as i23 from '@angular-mdl/core/components/radio/mdl-radio.component';
import * as i24 from '@angular-mdl/core/components/snackbar/mdl-snackbar.service';
import * as i25 from '@angular-mdl/core/components/menu/mdl-menu.component';
import * as i26 from '@angular/router';
import * as i27 from './socketio.service';
import * as i28 from './shucedule.service';
import * as i29 from './reserve.service';
import * as i30 from '@angular-mdl/core/components/button/mdl-button.component';
import * as i31 from '@angular-mdl/core/components/icon/mdl-icon.component';
import * as i32 from '@angular-mdl/core/components/common/mdl-ripple.directive';
import * as i33 from '@angular-mdl/core/components/tabs/index';
import * as i34 from '@angular-mdl/core/components/layout/index';
import * as i35 from '@angular-mdl/core/components/checkbox/mdl-checkbox.component';
import * as i36 from '@angular-mdl/core/components/chips/index';
import * as i37 from '@angular-mdl/core/components/dialog-outlet/index';
import * as i38 from '@angular-mdl/core/components/dialog/index';
import * as i39 from '@angular-mdl/core/components/spinner/mdl-spinner.component';
import * as i40 from '@angular-mdl/core/components/badge/mdl-badge.directive';
import * as i41 from '@angular-mdl/core/components/shadow/mdl-shadow.directive';
import * as i42 from '@angular-mdl/core/components/card/mdl-card.component';
import * as i43 from '@angular-mdl/core/components/progress/mdl-progress.component';
import * as i44 from '@angular-mdl/core/components/icon-toggle/mdl-icon-toggle.component';
import * as i45 from '@angular-mdl/core/components/list/mdl-list.component';
import * as i46 from '@angular-mdl/core/components/slider/mdl-slider.component';
import * as i47 from '@angular-mdl/core/components/switch/mdl-switch.component';
import * as i48 from '@angular-mdl/core/components/tooltip/index';
import * as i49 from '@angular-mdl/core/components/table/index';
import * as i50 from '@angular-mdl/core/components/menu/index';
import * as i51 from '@angular-mdl/core/components/textfield/mdl-textfield.component';
import * as i52 from '@angular-mdl/core/components/index';
import * as i53 from './dashboard.component';
import * as i54 from './shucedule.component';
import * as i55 from './app-routing.module';
export const AppModuleNgFactory:i0.NgModuleFactory<i1.AppModule> = i0.ɵcmf(i1.AppModule,
    [i2.AppComponent],(_l:any) => {
      return i0.ɵmod([i0.ɵmpd(512,i0.ComponentFactoryResolver,i0.ɵCodegenComponentFactoryResolver,
          [[8,[i3.MdlDialogOutletComponentNgFactory,i4.MdlBackdropOverlayComponentNgFactory,
              i5.MdlDialogComponentNgFactory,i6.MdlAlertComponentNgFactory,i7.MdlDialogHostComponentNgFactory,
              i8.MdlSimpleDialogComponentNgFactory,i9.MdlSnackbarComponentNgFactory,
              i10.MdlSimpleTooltipComponentNgFactory,i11.DashboardComponentNgFactory,
              i12.ShuceduleComponentNgFactory,i13.AppComponentNgFactory]],[3,i0.ComponentFactoryResolver],
              i0.NgModuleRef]),i0.ɵmpd(5120,i0.LOCALE_ID,i0.ɵm,[[3,i0.LOCALE_ID]]),
          i0.ɵmpd(4608,i14.NgLocalization,i14.NgLocaleLocalization,[i0.LOCALE_ID]),
          i0.ɵmpd(5120,i0.APP_ID,i0.ɵf,([] as any[])),i0.ɵmpd(5120,i0.IterableDiffers,
              i0.ɵk,([] as any[])),i0.ɵmpd(5120,i0.KeyValueDiffers,i0.ɵl,([] as any[])),
          i0.ɵmpd(4608,i15.DomSanitizer,i15.ɵe,[i14.DOCUMENT]),i0.ɵmpd(6144,i0.Sanitizer,
              (null as any),[i15.DomSanitizer]),i0.ɵmpd(4608,i15.HAMMER_GESTURE_CONFIG,
              i15.HammerGestureConfig,([] as any[])),i0.ɵmpd(5120,i15.EVENT_MANAGER_PLUGINS,
              (p0_0:any,p1_0:any,p2_0:any,p2_1:any) => {
                return [new i15.ɵDomEventsPlugin(p0_0),new i15.ɵKeyEventsPlugin(p1_0),
                    new i15.ɵHammerGesturesPlugin(p2_0,p2_1)];
              },[i14.DOCUMENT,i14.DOCUMENT,i14.DOCUMENT,i15.HAMMER_GESTURE_CONFIG]),
          i0.ɵmpd(4608,i15.EventManager,i15.EventManager,[i15.EVENT_MANAGER_PLUGINS,
              i0.NgZone]),i0.ɵmpd(135680,i15.ɵDomSharedStylesHost,i15.ɵDomSharedStylesHost,
              [i14.DOCUMENT]),i0.ɵmpd(4608,i15.ɵDomRendererFactory2,i15.ɵDomRendererFactory2,
              [i15.EventManager,i15.ɵDomSharedStylesHost]),i0.ɵmpd(6144,i0.RendererFactory2,
              (null as any),[i15.ɵDomRendererFactory2]),i0.ɵmpd(6144,i15.ɵSharedStylesHost,
              (null as any),[i15.ɵDomSharedStylesHost]),i0.ɵmpd(4608,i0.Testability,
              i0.Testability,[i0.NgZone]),i0.ɵmpd(4608,i15.Meta,i15.Meta,[i14.DOCUMENT]),
          i0.ɵmpd(4608,i15.Title,i15.Title,[i14.DOCUMENT]),i0.ɵmpd(4608,i16.ɵi,i16.ɵi,
              ([] as any[])),i0.ɵmpd(4608,i17.BrowserXhr,i17.BrowserXhr,([] as any[])),
          i0.ɵmpd(4608,i17.ResponseOptions,i17.BaseResponseOptions,([] as any[])),
          i0.ɵmpd(5120,i17.XSRFStrategy,i17.ɵb,([] as any[])),i0.ɵmpd(4608,i17.XHRBackend,
              i17.XHRBackend,[i17.BrowserXhr,i17.ResponseOptions,i17.XSRFStrategy]),
          i0.ɵmpd(4608,i17.RequestOptions,i17.BaseRequestOptions,([] as any[])),i0.ɵmpd(5120,
              i17.Http,i17.ɵc,[i17.XHRBackend,i17.RequestOptions]),i0.ɵmpd(5120,i18.Animations,
              i19.instantiateSupportedAnimationDriver,([] as any[])),i0.ɵmpd(4608,
              i20.MdlDialogOutletService,i20.MdlDialogOutletService,[i0.ApplicationRef,
                  i0.ComponentFactoryResolver]),i0.ɵmpd(4608,i21.MdlScreenSizeService,
              i21.MdlScreenSizeService,[i0.NgZone,[2,i21.LAYOUT_SCREEN_SIZE_THRESHOLD]]),
          i0.ɵmpd(4608,i22.MdlDialogService,i22.MdlDialogService,[i0.ComponentFactoryResolver,
              i15.DOCUMENT,i0.ApplicationRef,i20.MdlDialogOutletService]),i0.ɵmpd(4608,
              i23.MdlRadioGroupRegisty,i23.MdlRadioGroupRegisty,([] as any[])),i0.ɵmpd(4608,
              i24.MdlSnackbarService,i24.MdlSnackbarService,[i0.ComponentFactoryResolver,
                  i20.MdlDialogOutletService]),i0.ɵmpd(4608,i25.MdlMenuRegisty,i25.MdlMenuRegisty,
              ([] as any[])),i0.ɵmpd(5120,i26.ActivatedRoute,i26.ɵf,[i26.Router]),
          i0.ɵmpd(4608,i26.NoPreloading,i26.NoPreloading,([] as any[])),i0.ɵmpd(6144,
              i26.PreloadingStrategy,(null as any),[i26.NoPreloading]),i0.ɵmpd(135680,
              i26.RouterPreloader,i26.RouterPreloader,[i26.Router,i0.NgModuleFactoryLoader,
                  i0.Compiler,i0.Injector,i26.PreloadingStrategy]),i0.ɵmpd(4608,i26.PreloadAllModules,
              i26.PreloadAllModules,([] as any[])),i0.ɵmpd(5120,i26.ROUTER_INITIALIZER,
              i26.ɵi,[i26.ɵg]),i0.ɵmpd(5120,i0.APP_BOOTSTRAP_LISTENER,(p0_0:any) => {
            return [p0_0];
          },[i26.ROUTER_INITIALIZER]),i0.ɵmpd(4608,i27.SocketIOService,i27.SocketIOService,
              ([] as any[])),i0.ɵmpd(4608,i28.ShuceduleService,i28.ShuceduleService,
              [i17.Http,i27.SocketIOService]),i0.ɵmpd(4608,i29.ReserveService,i29.ReserveService,
              [i17.Http,i27.SocketIOService]),i0.ɵmpd(512,i14.CommonModule,i14.CommonModule,
              ([] as any[])),i0.ɵmpd(1024,i0.ErrorHandler,i15.ɵa,([] as any[])),i0.ɵmpd(1024,
              i0.NgProbeToken,() => {
                return [i26.ɵb()];
              },([] as any[])),i0.ɵmpd(512,i26.ɵg,i26.ɵg,[i0.Injector]),i0.ɵmpd(1024,
              i0.APP_INITIALIZER,(p0_0:any,p0_1:any,p1_0:any) => {
                return [i15.ɵc(p0_0,p0_1),i26.ɵh(p1_0)];
              },[[2,i15.NgProbeToken],[2,i0.NgProbeToken],i26.ɵg]),i0.ɵmpd(512,i0.ApplicationInitStatus,
              i0.ApplicationInitStatus,[[2,i0.APP_INITIALIZER]]),i0.ɵmpd(131584,i0.ɵe,
              i0.ɵe,[i0.NgZone,i0.ɵConsole,i0.Injector,i0.ErrorHandler,i0.ComponentFactoryResolver,
                  i0.ApplicationInitStatus]),i0.ɵmpd(2048,i0.ApplicationRef,(null as any),
              [i0.ɵe]),i0.ɵmpd(512,i0.ApplicationModule,i0.ApplicationModule,[i0.ApplicationRef]),
          i0.ɵmpd(512,i15.BrowserModule,i15.BrowserModule,[[3,i15.BrowserModule]]),
          i0.ɵmpd(512,i16.ɵba,i16.ɵba,([] as any[])),i0.ɵmpd(512,i16.FormsModule,i16.FormsModule,
              ([] as any[])),i0.ɵmpd(512,i17.HttpModule,i17.HttpModule,([] as any[])),
          i0.ɵmpd(512,i30.MdlButtonModule,i30.MdlButtonModule,([] as any[])),i0.ɵmpd(512,
              i31.MdlIconModule,i31.MdlIconModule,([] as any[])),i0.ɵmpd(512,i32.MdlRippleModule,
              i32.MdlRippleModule,([] as any[])),i0.ɵmpd(512,i19.MdlCommonsModule,
              i19.MdlCommonsModule,([] as any[])),i0.ɵmpd(512,i33.MdlTabsModule,i33.MdlTabsModule,
              ([] as any[])),i0.ɵmpd(512,i34.MdlLayoutModule,i34.MdlLayoutModule,([] as any[])),
          i0.ɵmpd(512,i35.MdlCheckboxModule,i35.MdlCheckboxModule,([] as any[])),i0.ɵmpd(512,
              i36.MdlChipModule,i36.MdlChipModule,([] as any[])),i0.ɵmpd(512,i37.MdlDialogOutletModule,
              i37.MdlDialogOutletModule,([] as any[])),i0.ɵmpd(512,i38.MdlDialogModule,
              i38.MdlDialogModule,([] as any[])),i0.ɵmpd(512,i39.MdlSpinnerModule,
              i39.MdlSpinnerModule,([] as any[])),i0.ɵmpd(512,i40.MdlBadgeModule,i40.MdlBadgeModule,
              ([] as any[])),i0.ɵmpd(512,i41.MdlShadowModule,i41.MdlShadowModule,([] as any[])),
          i0.ɵmpd(512,i42.MdlCardModule,i42.MdlCardModule,([] as any[])),i0.ɵmpd(512,
              i23.MdlRadioModule,i23.MdlRadioModule,([] as any[])),i0.ɵmpd(512,i43.MdlProgressModule,
              i43.MdlProgressModule,([] as any[])),i0.ɵmpd(512,i44.MdlIconToggleModule,
              i44.MdlIconToggleModule,([] as any[])),i0.ɵmpd(512,i45.MdlListModule,
              i45.MdlListModule,([] as any[])),i0.ɵmpd(512,i46.MdlSliderModule,i46.MdlSliderModule,
              ([] as any[])),i0.ɵmpd(512,i47.MdlSwitchModule,i47.MdlSwitchModule,([] as any[])),
          i0.ɵmpd(512,i24.MdlSnackbaModule,i24.MdlSnackbaModule,([] as any[])),i0.ɵmpd(512,
              i48.MdlTooltipModule,i48.MdlTooltipModule,([] as any[])),i0.ɵmpd(512,
              i49.MdlTableModule,i49.MdlTableModule,([] as any[])),i0.ɵmpd(512,i50.MdlMenuModule,
              i50.MdlMenuModule,([] as any[])),i0.ɵmpd(512,i51.MdlTextFieldModule,
              i51.MdlTextFieldModule,([] as any[])),i0.ɵmpd(512,i52.MdlModule,i52.MdlModule,
              ([] as any[])),i0.ɵmpd(1024,i26.ɵa,i26.ɵd,[[3,i26.Router]]),i0.ɵmpd(512,
              i26.UrlSerializer,i26.DefaultUrlSerializer,([] as any[])),i0.ɵmpd(512,
              i26.ChildrenOutletContexts,i26.ChildrenOutletContexts,([] as any[])),
          i0.ɵmpd(256,i26.ROUTER_CONFIGURATION,{},([] as any[])),i0.ɵmpd(1024,i14.LocationStrategy,
              i26.ɵc,[i14.PlatformLocation,[2,i14.APP_BASE_HREF],i26.ROUTER_CONFIGURATION]),
          i0.ɵmpd(512,i14.Location,i14.Location,[i14.LocationStrategy]),i0.ɵmpd(512,
              i0.Compiler,i0.Compiler,([] as any[])),i0.ɵmpd(512,i0.NgModuleFactoryLoader,
              i0.SystemJsNgModuleLoader,[i0.Compiler,[2,i0.SystemJsNgModuleLoaderConfig]]),
          i0.ɵmpd(1024,i26.ROUTES,() => {
            return [[{path:'',redirectTo:'/dashboard',pathMatch:'full'},{path:'dashboard',
                component:i53.DashboardComponent},{path:'shucedule',component:i54.ShuceduleComponent}]];
          },([] as any[])),i0.ɵmpd(1024,i26.Router,i26.ɵe,[i0.ApplicationRef,i26.UrlSerializer,
              i26.ChildrenOutletContexts,i14.Location,i0.Injector,i0.NgModuleFactoryLoader,
              i0.Compiler,i26.ROUTES,i26.ROUTER_CONFIGURATION,[2,i26.UrlHandlingStrategy],
              [2,i26.RouteReuseStrategy]]),i0.ɵmpd(512,i26.RouterModule,i26.RouterModule,
              [[2,i26.ɵa],[2,i26.Router]]),i0.ɵmpd(512,i55.AppRoutingModule,i55.AppRoutingModule,
              ([] as any[])),i0.ɵmpd(512,i1.AppModule,i1.AppModule,([] as any[]))]);
    });
//# sourceMappingURL=data:application/json;base64,eyJmaWxlIjoiRDovcHJvZ3JhbS9BbXVtdS9saWIvY2hpbmFjaHUvcHJveHkvd2ViX21hdGVyaWFsL2FwcC9hcHAubW9kdWxlLm5nZmFjdG9yeS50cyIsInZlcnNpb24iOjMsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm5nOi8vL0Q6L3Byb2dyYW0vQW11bXUvbGliL2NoaW5hY2h1L3Byb3h5L3dlYl9tYXRlcmlhbC9hcHAvYXBwLm1vZHVsZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIgIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9